mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-25 20:22:30 +01:00
rsx/d3d12: dump program content when capturing frame
This commit is contained in:
parent
85cf918aeb
commit
b9d8d9383a
@ -294,6 +294,22 @@ public:
|
||||
clear();
|
||||
}
|
||||
|
||||
const typename BackendTraits::VertexProgramData* get_transform_program(const RSXVertexProgram& rsx_vp) const noexcept
|
||||
{
|
||||
typename binary2VS::const_iterator It = m_cacheVS.find(rsx_vp.data);
|
||||
if (It == m_cacheVS.end())
|
||||
return nullptr;
|
||||
return &It->second;
|
||||
}
|
||||
|
||||
const typename BackendTraits::FragmentProgramData* get_shader_program(const RSXFragmentProgram& rsx_fp) const noexcept
|
||||
{
|
||||
typename binary2FS::const_iterator It = m_cacheFS.find(vm::base(rsx_fp.addr));
|
||||
if (It == m_cacheFS.end())
|
||||
return nullptr;
|
||||
return &It->second;
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
for (auto pair : m_cachePSO)
|
||||
|
@ -66,6 +66,7 @@ private:
|
||||
|
||||
rsx::surface_info m_surface;
|
||||
|
||||
RSXVertexProgram vertex_program;
|
||||
RSXFragmentProgram fragment_program;
|
||||
PipelineStateObjectCache m_pso_cache;
|
||||
std::tuple<ID3D12PipelineState *, std::vector<size_t>, size_t> *m_current_pso;
|
||||
@ -215,4 +216,5 @@ protected:
|
||||
virtual void copy_render_targets_to_memory(void *buffer, u8 rtt) override;
|
||||
virtual void copy_depth_buffer_to_memory(void *buffer) override;
|
||||
virtual void copy_stencil_buffer_to_memory(void *buffer) override;
|
||||
virtual std::pair<std::string, std::string> get_programs() const override;
|
||||
};
|
||||
|
@ -11,6 +11,7 @@ extern pD3DCompile wrapD3DCompile;
|
||||
|
||||
void Shader::Compile(const std::string &code, SHADER_TYPE st)
|
||||
{
|
||||
content = code;
|
||||
HRESULT hr;
|
||||
ComPtr<ID3DBlob> errorBlob;
|
||||
UINT compileFlags;
|
||||
@ -35,7 +36,6 @@ void Shader::Compile(const std::string &code, SHADER_TYPE st)
|
||||
|
||||
bool D3D12GSRender::load_program()
|
||||
{
|
||||
RSXVertexProgram vertex_program;
|
||||
u32 transform_program_start = rsx::method_registers[NV4097_SET_TRANSFORM_PROGRAM_START];
|
||||
vertex_program.data.reserve((512 - transform_program_start) * 4);
|
||||
|
||||
@ -246,4 +246,9 @@ bool D3D12GSRender::load_program()
|
||||
m_current_pso = m_pso_cache.getGraphicPipelineState(&vertex_program, &fragment_program, prop, std::make_pair(m_device.Get(), m_root_signatures));
|
||||
return m_current_pso != nullptr;
|
||||
}
|
||||
|
||||
std::pair<std::string, std::string> D3D12GSRender::get_programs() const
|
||||
{
|
||||
return std::make_pair(m_pso_cache.get_transform_program(vertex_program)->content, m_pso_cache.get_shader_program(fragment_program)->content);
|
||||
}
|
||||
#endif
|
||||
|
@ -91,6 +91,8 @@ public:
|
||||
|
||||
u32 id;
|
||||
ComPtr<ID3DBlob> bytecode;
|
||||
// For debugging
|
||||
std::string content;
|
||||
std::vector<size_t> vertex_shader_inputs;
|
||||
std::vector<size_t> FragmentConstantOffsetCache;
|
||||
size_t m_textureCount;
|
||||
|
@ -939,6 +939,7 @@ namespace rsx
|
||||
draw_state.stencil.data.resize(clip_w * clip_h * 4);
|
||||
copy_stencil_buffer_to_memory(draw_state.stencil.data.data());
|
||||
}
|
||||
draw_state.programs = get_programs();
|
||||
draw_state.name = name;
|
||||
frame_debug.draw_calls.push_back(draw_state);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ struct frame_capture_data
|
||||
struct draw_state
|
||||
{
|
||||
std::string name;
|
||||
std::pair<std::string, std::string> programs;
|
||||
buffer color_buffer[4];
|
||||
buffer depth;
|
||||
buffer stencil;
|
||||
@ -284,6 +285,8 @@ namespace rsx
|
||||
* TODO: It's more efficient to combine multiple call of this function into one.
|
||||
*/
|
||||
virtual void copy_stencil_buffer_to_memory(void *buffer) {};
|
||||
|
||||
virtual std::pair<std::string, std::string> get_programs() const { return std::make_pair("", ""); };
|
||||
public:
|
||||
void reset();
|
||||
void init(const u32 ioAddress, const u32 ioSize, const u32 ctrlAddress, const u32 localAddress);
|
||||
|
Loading…
Reference in New Issue
Block a user