summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2023-08-27 02:00:48 +0200
committerGravatar Fernando Sahmkow2023-08-27 03:47:04 +0200
commit710ca3ca494e1af4ce5481f650e67c75c235be83 (patch)
tree3c4d0db9c68e59e2b1e20a802226d056a3c49a7f
parentDMA Pusher: Fix regression caused by guest memory optimizations (diff)
downloadyuzu-710ca3ca494e1af4ce5481f650e67c75c235be83.tar.gz
yuzu-710ca3ca494e1af4ce5481f650e67c75c235be83.tar.xz
yuzu-710ca3ca494e1af4ce5481f650e67c75c235be83.zip
Shader Recompiler: Auto stub special registers and dump pipelines on exception.
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp3
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp13
2 files changed, 15 insertions, 1 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp
index 753c62098..e593132e6 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/move_special_register.cpp
@@ -161,7 +161,8 @@ enum class SpecialRegister : u64 {
161 LOG_WARNING(Shader, "(STUBBED) SR_AFFINITY"); 161 LOG_WARNING(Shader, "(STUBBED) SR_AFFINITY");
162 return ir.Imm32(0); // This is the default value hardware returns. 162 return ir.Imm32(0); // This is the default value hardware returns.
163 default: 163 default:
164 throw NotImplementedException("S2R special register {}", special_register); 164 LOG_CRITICAL(Shader, "(STUBBED) Special register {}", special_register);
165 return ir.Imm32(0); // This is the default value hardware returns.
165 } 166 }
166} 167}
167} // Anonymous namespace 168} // Anonymous namespace
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index c1314ca99..b1730a170 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -664,6 +664,19 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
664 std::move(modules), infos); 664 std::move(modules), infos);
665 665
666} catch (const Shader::Exception& exception) { 666} catch (const Shader::Exception& exception) {
667 auto hash = key.Hash();
668 size_t env_index{0};
669 for (size_t index = 0; index < Maxwell::MaxShaderProgram; ++index) {
670 if (key.unique_hashes[index] == 0) {
671 continue;
672 }
673 Shader::Environment& env{*envs[env_index]};
674 ++env_index;
675
676 const u32 cfg_offset{static_cast<u32>(env.StartAddress() + sizeof(Shader::ProgramHeader))};
677 Shader::Maxwell::Flow::CFG cfg(env, pools.flow_block, cfg_offset, index == 0);
678 env.Dump(hash, key.unique_hashes[index]);
679 }
667 LOG_ERROR(Render_Vulkan, "{}", exception.what()); 680 LOG_ERROR(Render_Vulkan, "{}", exception.what());
668 return nullptr; 681 return nullptr;
669} 682}