From 9115b8cae86f7a78e8eb8349b6c558d5a1465795 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 3 Dec 2022 19:54:16 +0000 Subject: [PATCH] Properly hash dynamic states in pipeline cache --- .../cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp | 9 +++++++-- .../main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp index 300222cd..8eed801c 100644 --- a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp +++ b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.cpp @@ -25,6 +25,8 @@ namespace skyline::gpu::cache { multisampleState(state.multisampleState), depthStencilState(state.depthStencilState), colorBlendState(state.colorBlendState), + dynamicStates(VEC_CPY(dynamicState.pDynamicStates, dynamicState.dynamicStateCount)), + dynamicState(state.dynamicState), colorBlendAttachments(VEC_CPY(colorBlendState.pAttachments, colorBlendState.attachmentCount)) { auto &vertexInputState{vertexState.get()}; vertexInputState.pVertexBindingDescriptions = vertexBindings.data(); @@ -36,6 +38,8 @@ namespace skyline::gpu::cache { colorBlendState.pAttachments = colorBlendAttachments.data(); + dynamicState.pDynamicStates = dynamicStates.data(); + for (auto &colorFormat : state.colorFormats) colorFormats.emplace_back(colorFormat); @@ -164,10 +168,11 @@ namespace skyline::gpu::cache { HASH(static_cast(attachment.srcColorBlendFactor)); } + HASH(key.dynamicState.dynamicStateCount); + HASH(key.colorFormats.size()); - for (auto format : key.colorFormats) { + for (auto format : key.colorFormats) HASH(format); - } HASH(key.depthStencilFormat); HASH(key.sampleCount); diff --git a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h index 8607f1c0..9f5590a7 100644 --- a/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h +++ b/app/src/main/cpp/skyline/gpu/cache/graphics_pipeline_cache.h @@ -88,6 +88,7 @@ namespace skyline::gpu::cache { vk::PipelineMultisampleStateCreateInfo multisampleState; vk::PipelineDepthStencilStateCreateInfo depthStencilState; vk::PipelineColorBlendStateCreateInfo colorBlendState; + std::vector dynamicStates; vk::PipelineDynamicStateCreateInfo dynamicState; std::vector colorBlendAttachments;