diff options
author | Timothy Arceri <[email protected]> | 2017-03-15 13:07:40 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-03-17 16:17:10 +1100 |
commit | 72ab7bb76552c27266bc8615b692969bb6277644 (patch) | |
tree | d1762bb76de680009fd3601f8a04626bfae8384a /src/amd/vulkan/radv_pipeline.c | |
parent | 2845a108a9a8bd4b0e6e9b590c976452fb99eb10 (diff) |
radv: make sure gs copy shader is retrieved from the cache with the variant
Apps can limit the size of the cache via VkAllocationCallbacks so we
can't be sure that both are always in the cache.
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_pipeline.c')
-rw-r--r-- | src/amd/vulkan/radv_pipeline.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 73a377657ba..0eeb53592cf 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -539,7 +539,9 @@ radv_pipeline_compile(struct radv_pipeline *pipeline, cache, gs_copy_sha1); } - if (variant) + + if (variant && + (stage != MESA_SHADER_GEOMETRY || pipeline->gs_copy_shader)) return variant; nir = radv_shader_compile_to_nir(pipeline->device, @@ -548,10 +550,13 @@ radv_pipeline_compile(struct radv_pipeline *pipeline, if (nir == NULL) return NULL; - variant = radv_shader_variant_create(pipeline->device, nir, layout, key, - &code, &code_size, dump); + if (!variant) { + variant = radv_shader_variant_create(pipeline->device, nir, + layout, key, &code, + &code_size, dump); + } - if (stage == MESA_SHADER_GEOMETRY) { + if (stage == MESA_SHADER_GEOMETRY && !pipeline->gs_copy_shader) { void *gs_copy_code = NULL; unsigned gs_copy_code_size = 0; pipeline->gs_copy_shader = radv_pipeline_create_gs_copy_shader( |