From 5e62d8d1bd9c8097bbfa90dffc25fb2d89b6302b Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 31 Mar 2023 16:30:09 +0200 Subject: [PATCH] radv: add VkGraphicsPipelineLibraryFlag to the graphics pipeline key This is to generate a different key for a library created with FRAGMENT_SHADER_BIT and no FS (ie. it would generate a noop FS) and a library created with FRAGMENT_OUTPUT_INTERFACE with no CB attachments. Otherwise, the same key would be generated and this would corrupt the cache. Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline.c | 1 + src/amd/vulkan/radv_shader.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 81126c8..f357c64 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2082,6 +2082,7 @@ radv_generate_graphics_pipeline_key(const struct radv_device *device, const struct radv_physical_device *pdevice = device->physical_device; struct radv_pipeline_key key = radv_generate_pipeline_key(device, &pipeline->base, pCreateInfo->flags); + key.lib_flags = lib_flags; key.has_multiview_view_index = state->rp ? !!state->rp->view_mask : 0; if (pipeline->dynamic_states & RADV_DYNAMIC_VERTEX_INPUT) { diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 1f85673..431708c 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -65,6 +65,8 @@ struct radv_ps_epilog_key { }; struct radv_pipeline_key { + uint32_t lib_flags : 4; /* VkGraphicsPipelineLibraryFlagBitsEXT */ + uint32_t has_multiview_view_index : 1; uint32_t optimisations_disabled : 1; uint32_t invariant_geom : 1; -- 2.7.4