radv: add VkGraphicsPipelineLibraryFlag to the graphics pipeline key
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 31 Mar 2023 14:30:09 +0000 (16:30 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 4 Apr 2023 14:47:39 +0000 (14:47 +0000)
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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22264>

src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader.h

index 81126c8..f357c64 100644 (file)
@@ -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) {
index 1f85673..431708c 100644 (file)
@@ -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;