diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index d2bc9fc3708..ba79e87c67b 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3560,6 +3560,7 @@ radv_graphics_pipeline_compile(struct radv_graphics_pipeline *pipeline, VkPipelineCreationFeedback pipeline_feedback = { .flags = VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT, }; + bool skip_shaders_cache = false; bool noop_fs = false; VkResult result = VK_SUCCESS; const bool retain_shaders = @@ -3567,6 +3568,16 @@ radv_graphics_pipeline_compile(struct radv_graphics_pipeline *pipeline, int64_t pipeline_start = os_time_get_nano(); + /* Skip the shaders cache when any of the below are true: + * - fast-linking is enabled because it's useless to cache unoptimized pipelines + * - shaders are captured because it's for debugging purposes + * - RADV_PERFTEST=gpl is enabled because it's unsupported + */ + if (fast_linking_enabled || keep_executable_info || + (device->instance->perftest_flags & RADV_PERFTEST_GPL)) { + skip_shaders_cache = true; + } + for (uint32_t i = 0; i < pCreateInfo->stageCount; i++) { const VkPipelineShaderStageCreateInfo *sinfo = &pCreateInfo->pStages[i]; gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage); @@ -3601,7 +3612,7 @@ radv_graphics_pipeline_compile(struct radv_graphics_pipeline *pipeline, } bool found_in_application_cache = true; - if (!fast_linking_enabled && !keep_executable_info && + if (!skip_shaders_cache && radv_create_shaders_from_pipeline_cache(device, cache, hash, &pipeline->base, NULL, NULL, &found_in_application_cache)) { if (found_in_application_cache) @@ -3728,7 +3739,7 @@ radv_graphics_pipeline_compile(struct radv_graphics_pipeline *pipeline, /* Upload shader binaries. */ radv_upload_shaders(device, &pipeline->base, binaries, gs_copy_binary); - if (!fast_linking_enabled && !keep_executable_info) { + if (!skip_shaders_cache) { if (pipeline->base.gs_copy_shader) { assert(!binaries[MESA_SHADER_COMPUTE] && !pipeline->base.shaders[MESA_SHADER_COMPUTE]); binaries[MESA_SHADER_COMPUTE] = gs_copy_binary; diff --git a/src/amd/vulkan/radv_pipeline_cache.c b/src/amd/vulkan/radv_pipeline_cache.c index ab89e70f9ee..747e03aecd9 100644 --- a/src/amd/vulkan/radv_pipeline_cache.c +++ b/src/amd/vulkan/radv_pipeline_cache.c @@ -69,7 +69,6 @@ radv_is_cache_disabled(struct radv_device *device) * when ACO_DEBUG is used. MESA_GLSL_CACHE_DISABLE is done elsewhere. */ return (device->instance->debug_flags & RADV_DEBUG_NO_CACHE) || - (device->instance->perftest_flags & RADV_PERFTEST_GPL) || (device->physical_device->use_llvm ? 0 : aco_get_codegen_flags()); }