diff options
| author | 2021-03-27 03:08:31 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:24 -0400 | |
| commit | 675a82416d7775dc7a252a5d8f5b704e6b8f2326 (patch) | |
| tree | 4964c92716029716255d75e26dcc033487df6b1e /src/video_core/renderer_vulkan | |
| parent | vk_pipeline_cache: Fix pipeline and shader caches (diff) | |
| download | yuzu-675a82416d7775dc7a252a5d8f5b704e6b8f2326.tar.gz yuzu-675a82416d7775dc7a252a5d8f5b704e6b8f2326.tar.xz yuzu-675a82416d7775dc7a252a5d8f5b704e6b8f2326.zip | |
spirv: Remove dependencies on Environment when generating SPIR-V
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 51c155077..251559b16 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -680,7 +680,6 @@ GraphicsPipeline PipelineCache::CreateGraphicsPipeline(ShaderPools& pools, | |||
| 680 | std::array<vk::ShaderModule, Maxwell::MaxShaderStage> modules; | 680 | std::array<vk::ShaderModule, Maxwell::MaxShaderStage> modules; |
| 681 | 681 | ||
| 682 | u32 binding{0}; | 682 | u32 binding{0}; |
| 683 | env_index = 0; | ||
| 684 | for (size_t index = 0; index < Maxwell::MaxShaderProgram; ++index) { | 683 | for (size_t index = 0; index < Maxwell::MaxShaderProgram; ++index) { |
| 685 | if (key.unique_hashes[index] == u128{}) { | 684 | if (key.unique_hashes[index] == u128{}) { |
| 686 | continue; | 685 | continue; |
| @@ -691,11 +690,8 @@ GraphicsPipeline PipelineCache::CreateGraphicsPipeline(ShaderPools& pools, | |||
| 691 | const size_t stage_index{index - 1}; | 690 | const size_t stage_index{index - 1}; |
| 692 | infos[stage_index] = &program.info; | 691 | infos[stage_index] = &program.info; |
| 693 | 692 | ||
| 694 | Shader::Environment& env{*envs[env_index]}; | 693 | const Shader::Profile profile{MakeProfile(key, program.stage)}; |
| 695 | ++env_index; | 694 | const std::vector<u32> code{EmitSPIRV(profile, program, binding)}; |
| 696 | |||
| 697 | const Shader::Profile profile{MakeProfile(key, env.ShaderStage())}; | ||
| 698 | const std::vector<u32> code{EmitSPIRV(profile, env, program, binding)}; | ||
| 699 | modules[stage_index] = BuildShader(device, code); | 695 | modules[stage_index] = BuildShader(device, code); |
| 700 | } | 696 | } |
| 701 | return GraphicsPipeline(maxwell3d, gpu_memory, scheduler, buffer_cache, texture_cache, device, | 697 | return GraphicsPipeline(maxwell3d, gpu_memory, scheduler, buffer_cache, texture_cache, device, |
| @@ -753,7 +749,7 @@ ComputePipeline PipelineCache::CreateComputePipeline(ShaderPools& pools, | |||
| 753 | Shader::Maxwell::Flow::CFG cfg{env, pools.flow_block, env.StartAddress()}; | 749 | Shader::Maxwell::Flow::CFG cfg{env, pools.flow_block, env.StartAddress()}; |
| 754 | Shader::IR::Program program{TranslateProgram(pools.inst, pools.block, env, cfg)}; | 750 | Shader::IR::Program program{TranslateProgram(pools.inst, pools.block, env, cfg)}; |
| 755 | u32 binding{0}; | 751 | u32 binding{0}; |
| 756 | std::vector<u32> code{EmitSPIRV(base_profile, env, program, binding)}; | 752 | std::vector<u32> code{EmitSPIRV(base_profile, program, binding)}; |
| 757 | return ComputePipeline{device, descriptor_pool, update_descriptor_queue, program.info, | 753 | return ComputePipeline{device, descriptor_pool, update_descriptor_queue, program.info, |
| 758 | BuildShader(device, code)}; | 754 | BuildShader(device, code)}; |
| 759 | } | 755 | } |