diff options
| author | 2022-01-03 17:56:30 -0800 | |
|---|---|---|
| committer | 2022-01-03 17:56:30 -0800 | |
| commit | c68a0d17fc30d9b91b8324b3899556e3ebfea8d5 (patch) | |
| tree | 3ec6f215ab86e6a9baf181efc9839eaa8bf56cf4 /src/video_core/renderer_vulkan | |
| parent | Merge pull request #7668 from ameerj/fence-stop-token (diff) | |
| parent | ShaderDecompiler: Add a debug option to dump the game's shaders. (diff) | |
| download | yuzu-c68a0d17fc30d9b91b8324b3899556e3ebfea8d5.tar.gz yuzu-c68a0d17fc30d9b91b8324b3899556e3ebfea8d5.tar.xz yuzu-c68a0d17fc30d9b91b8324b3899556e3ebfea8d5.zip | |
Merge pull request #7251 from FernandoS27/shader-dump
ShaderDecompiler: Add a debug option to dump the game's shaders.
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 2728353c8..a633b73e5 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -517,6 +517,9 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline( | |||
| 517 | 517 | ||
| 518 | const u32 cfg_offset{static_cast<u32>(env.StartAddress() + sizeof(Shader::ProgramHeader))}; | 518 | const u32 cfg_offset{static_cast<u32>(env.StartAddress() + sizeof(Shader::ProgramHeader))}; |
| 519 | Shader::Maxwell::Flow::CFG cfg(env, pools.flow_block, cfg_offset, index == 0); | 519 | Shader::Maxwell::Flow::CFG cfg(env, pools.flow_block, cfg_offset, index == 0); |
| 520 | if (Settings::values.dump_shaders) { | ||
| 521 | env.Dump(key.unique_hashes[index]); | ||
| 522 | } | ||
| 520 | if (!uses_vertex_a || index != 1) { | 523 | if (!uses_vertex_a || index != 1) { |
| 521 | // Normal path | 524 | // Normal path |
| 522 | programs[index] = TranslateProgram(pools.inst, pools.block, env, cfg, host_info); | 525 | programs[index] = TranslateProgram(pools.inst, pools.block, env, cfg, host_info); |
| @@ -613,6 +616,12 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline( | |||
| 613 | LOG_INFO(Render_Vulkan, "0x{:016x}", key.Hash()); | 616 | LOG_INFO(Render_Vulkan, "0x{:016x}", key.Hash()); |
| 614 | 617 | ||
| 615 | Shader::Maxwell::Flow::CFG cfg{env, pools.flow_block, env.StartAddress()}; | 618 | Shader::Maxwell::Flow::CFG cfg{env, pools.flow_block, env.StartAddress()}; |
| 619 | |||
| 620 | // Dump it before error. | ||
| 621 | if (Settings::values.dump_shaders) { | ||
| 622 | env.Dump(key.Hash()); | ||
| 623 | } | ||
| 624 | |||
| 616 | auto program{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)}; | 625 | auto program{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)}; |
| 617 | const std::vector<u32> code{EmitSPIRV(profile, program)}; | 626 | const std::vector<u32> code{EmitSPIRV(profile, program)}; |
| 618 | device.SaveShader(code); | 627 | device.SaveShader(code); |