diff options
| author | 2021-06-12 23:24:49 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:35 -0400 | |
| commit | 41cca8b8ad6f7ea33e74210aee4e3867ffa0622e (patch) | |
| tree | 2b6935b99d9495d4ac50131057b47ea803ebf082 | |
| parent | main: Fix Open Transferable Shader Cache context item (diff) | |
| download | yuzu-41cca8b8ad6f7ea33e74210aee4e3867ffa0622e.tar.gz yuzu-41cca8b8ad6f7ea33e74210aee4e3867ffa0622e.tar.xz yuzu-41cca8b8ad6f7ea33e74210aee4e3867ffa0622e.zip | |
vk_pipeline_cache: Skip cached pipelines with different dynamic state
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | 6 |
1 files changed, 6 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 db7da5555..b17f34cdd 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -391,10 +391,16 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading | |||
| 391 | }); | 391 | }); |
| 392 | ++state.total; | 392 | ++state.total; |
| 393 | }}; | 393 | }}; |
| 394 | const bool extended_dynamic_state = device.IsExtExtendedDynamicStateSupported(); | ||
| 395 | const bool dynamic_vertex_input = device.IsExtVertexInputDynamicStateSupported(); | ||
| 394 | const auto load_graphics{[&](std::ifstream& file, std::vector<FileEnvironment> envs) { | 396 | const auto load_graphics{[&](std::ifstream& file, std::vector<FileEnvironment> envs) { |
| 395 | GraphicsPipelineCacheKey key; | 397 | GraphicsPipelineCacheKey key; |
| 396 | file.read(reinterpret_cast<char*>(&key), sizeof(key)); | 398 | file.read(reinterpret_cast<char*>(&key), sizeof(key)); |
| 397 | 399 | ||
| 400 | if ((key.state.extended_dynamic_state != 0) != extended_dynamic_state || | ||
| 401 | (key.state.dynamic_vertex_input != 0) != dynamic_vertex_input) { | ||
| 402 | return; | ||
| 403 | } | ||
| 398 | workers.QueueWork([this, key, envs = std::move(envs), &state, &callback]() mutable { | 404 | workers.QueueWork([this, key, envs = std::move(envs), &state, &callback]() mutable { |
| 399 | ShaderPools pools; | 405 | ShaderPools pools; |
| 400 | boost::container::static_vector<Shader::Environment*, 5> env_ptrs; | 406 | boost::container::static_vector<Shader::Environment*, 5> env_ptrs; |