diff options
| author | 2021-11-17 04:19:29 +0100 | |
|---|---|---|
| committer | 2022-01-04 02:39:00 +0100 | |
| commit | f58ee3f15f7427a8b834286384931bcf821ed771 (patch) | |
| tree | 1ef8367f64cbee6220c4e5600249697e5cd8e826 /src/video_core/renderer_vulkan | |
| parent | Merge pull request #7648 from bunnei/thread-pinning (diff) | |
| download | yuzu-f58ee3f15f7427a8b834286384931bcf821ed771.tar.gz yuzu-f58ee3f15f7427a8b834286384931bcf821ed771.tar.xz yuzu-f58ee3f15f7427a8b834286384931bcf821ed771.zip | |
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); |