diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-23 09:28:34 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:30 +0200 |
commit | d621e96d0de212cc16897eadf71e8a1b2e1eb5dc (patch) | |
tree | 8695f2f4dddf2564b63e4574d6616ccb0e79568c /src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |
parent | spirv: Be aware of NAN unaware drivers (diff) | |
download | yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.gz yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.bz2 yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.lz yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.xz yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.tar.zst yuzu-d621e96d0de212cc16897eadf71e8a1b2e1eb5dc.zip |
Diffstat (limited to 'src/video_core/renderer_vulkan/vk_pipeline_cache.cpp')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 1334882b5..30b71bdbc 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp @@ -342,28 +342,15 @@ std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline( } std::unique_ptr<GraphicsPipeline> PipelineCache::CreateGraphicsPipeline() { - main_pools.ReleaseContents(); - - std::array<GraphicsEnvironment, Maxwell::MaxShaderProgram> graphics_envs; - boost::container::static_vector<Shader::Environment*, Maxwell::MaxShaderProgram> envs; + GraphicsEnvironments environments; + GetGraphicsEnvironments(environments, graphics_key.unique_hashes); - const GPUVAddr base_addr{maxwell3d.regs.code_address.CodeAddress()}; - for (size_t index = 0; index < Maxwell::MaxShaderProgram; ++index) { - if (graphics_key.unique_hashes[index] == 0) { - continue; - } - const auto program{static_cast<Maxwell::ShaderProgram>(index)}; - auto& env{graphics_envs[index]}; - const u32 start_address{maxwell3d.regs.shader_config[index].offset}; - env = GraphicsEnvironment{maxwell3d, gpu_memory, program, base_addr, start_address}; - env.SetCachedSize(shader_infos[index]->size_bytes); - envs.push_back(&env); - } - auto pipeline{CreateGraphicsPipeline(main_pools, graphics_key, MakeSpan(envs), true)}; + main_pools.ReleaseContents(); + auto pipeline{CreateGraphicsPipeline(main_pools, graphics_key, environments.Span(), true)}; if (pipeline_cache_filename.empty()) { return pipeline; } - serialization_thread.QueueWork([this, key = graphics_key, envs = std::move(graphics_envs)] { + serialization_thread.QueueWork([this, key = graphics_key, envs = std::move(environments.envs)] { boost::container::static_vector<const GenericEnvironment*, Maxwell::MaxShaderProgram> env_ptrs; for (size_t index = 0; index < Maxwell::MaxShaderProgram; ++index) { |