summaryrefslogtreecommitdiff
path: root/src/video_core/renderer_vulkan
diff options
context:
space:
mode:
authorGravatar Kelebek12023-08-03 12:18:35 +0100
committerGravatar Kelebek12023-08-03 15:30:27 +0100
commitdfb7fc8293a528d6c8cc2abef7fac5a6a7bf2883 (patch)
treefaf1c9bce2d7159b0f9b7bb3cdd08be7f47f7847 /src/video_core/renderer_vulkan
parentMerge pull request #11202 from abouvier/vulkan-config (diff)
downloadyuzu-dfb7fc8293a528d6c8cc2abef7fac5a6a7bf2883.tar.gz
yuzu-dfb7fc8293a528d6c8cc2abef7fac5a6a7bf2883.tar.xz
yuzu-dfb7fc8293a528d6c8cc2abef7fac5a6a7bf2883.zip
Fix shader dumps with nvdisasm
skip fragment shaders when rasterizer is disabled initialize env_ptrs
Diffstat (limited to 'src/video_core/renderer_vulkan')
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index 4f84d8497..c1314ca99 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -584,7 +584,8 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
584 ShaderPools& pools, const GraphicsPipelineCacheKey& key, 584 ShaderPools& pools, const GraphicsPipelineCacheKey& key,
585 std::span<Shader::Environment* const> envs, PipelineStatistics* statistics, 585 std::span<Shader::Environment* const> envs, PipelineStatistics* statistics,
586 bool build_in_parallel) try { 586 bool build_in_parallel) try {
587 LOG_INFO(Render_Vulkan, "0x{:016x}", key.Hash()); 587 auto hash = key.Hash();
588 LOG_INFO(Render_Vulkan, "0x{:016x}", hash);
588 size_t env_index{0}; 589 size_t env_index{0};
589 std::array<Shader::IR::Program, Maxwell::MaxShaderProgram> programs; 590 std::array<Shader::IR::Program, Maxwell::MaxShaderProgram> programs;
590 const bool uses_vertex_a{key.unique_hashes[0] != 0}; 591 const bool uses_vertex_a{key.unique_hashes[0] != 0};
@@ -611,7 +612,7 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline(
611 const u32 cfg_offset{static_cast<u32>(env.StartAddress() + sizeof(Shader::ProgramHeader))}; 612 const u32 cfg_offset{static_cast<u32>(env.StartAddress() + sizeof(Shader::ProgramHeader))};
612 Shader::Maxwell::Flow::CFG cfg(env, pools.flow_block, cfg_offset, index == 0); 613 Shader::Maxwell::Flow::CFG cfg(env, pools.flow_block, cfg_offset, index == 0);
613 if (Settings::values.dump_shaders) { 614 if (Settings::values.dump_shaders) {
614 env.Dump(key.unique_hashes[index]); 615 env.Dump(hash, key.unique_hashes[index]);
615 } 616 }
616 if (!uses_vertex_a || index != 1) { 617 if (!uses_vertex_a || index != 1) {
617 // Normal path 618 // Normal path
@@ -712,18 +713,19 @@ std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
712std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline( 713std::unique_ptr<ComputePipeline> PipelineCache::CreateComputePipeline(
713 ShaderPools& pools, const ComputePipelineCacheKey& key, Shader::Environment& env, 714 ShaderPools& pools, const ComputePipelineCacheKey& key, Shader::Environment& env,
714 PipelineStatistics* statistics, bool build_in_parallel) try { 715 PipelineStatistics* statistics, bool build_in_parallel) try {
716 auto hash = key.Hash();
715 if (device.HasBrokenCompute()) { 717 if (device.HasBrokenCompute()) {
716 LOG_ERROR(Render_Vulkan, "Skipping 0x{:016x}", key.Hash()); 718 LOG_ERROR(Render_Vulkan, "Skipping 0x{:016x}", hash);
717 return nullptr; 719 return nullptr;
718 } 720 }
719 721
720 LOG_INFO(Render_Vulkan, "0x{:016x}", key.Hash()); 722 LOG_INFO(Render_Vulkan, "0x{:016x}", hash);
721 723
722 Shader::Maxwell::Flow::CFG cfg{env, pools.flow_block, env.StartAddress()}; 724 Shader::Maxwell::Flow::CFG cfg{env, pools.flow_block, env.StartAddress()};
723 725
724 // Dump it before error. 726 // Dump it before error.
725 if (Settings::values.dump_shaders) { 727 if (Settings::values.dump_shaders) {
726 env.Dump(key.Hash()); 728 env.Dump(hash, key.unique_hash);
727 } 729 }
728 730
729 auto program{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)}; 731 auto program{TranslateProgram(pools.inst, pools.block, env, cfg, host_info)};