diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 11b42cb8a25..b3613635054 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3382,6 +3382,7 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_pipeline_layout const VkPipelineCreationFeedbackCreateInfo *creation_feedback, struct radv_pipeline_shader_stack_size **stack_sizes, uint32_t *num_stack_sizes, + VkGraphicsPipelineLibraryFlagBitsEXT lib_flags, gl_shader_stage *last_vgt_api_stage) { const char *noop_fs_entrypoint = "noop_fs"; @@ -3409,6 +3410,12 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_pipeline_layout const VkPipelineShaderStageCreateInfo *sinfo = &pStages[i]; gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage); + /* Ignore graphics shader stages that don't need to be imported. */ + if ((pipeline->type == RADV_PIPELINE_GRAPHICS || + pipeline->type == RADV_PIPELINE_GRAPHICS_LIB) && + !(shader_stage_to_pipeline_library_flags(sinfo->stage) & lib_flags)) + continue; + radv_pipeline_stage_init(sinfo, &stages[stage], stage); } @@ -4963,7 +4970,9 @@ radv_graphics_pipeline_init(struct radv_graphics_pipeline *pipeline, struct radv result = radv_create_shaders(&pipeline->base, &pipeline_layout, device, cache, &key, pCreateInfo->pStages, pCreateInfo->stageCount, pCreateInfo->flags, NULL, - creation_feedback, NULL, NULL, &pipeline->last_vgt_api_stage); + creation_feedback, NULL, NULL, + (~imported_flags) & ALL_GRAPHICS_LIB_FLAGS, + &pipeline->last_vgt_api_stage); if (result != VK_SUCCESS) { radv_pipeline_layout_finish(device, &pipeline_layout); return result; @@ -5182,7 +5191,7 @@ radv_graphics_lib_pipeline_init(struct radv_graphics_lib_pipeline *pipeline, result = radv_create_shaders(&pipeline->base.base, pipeline_layout, device, cache, &key, pCreateInfo->pStages, pCreateInfo->stageCount, pCreateInfo->flags, - NULL, creation_feedback, NULL, NULL, + NULL, creation_feedback, NULL, NULL, imported_flags, &pipeline->base.last_vgt_api_stage); if (result != VK_SUCCESS) @@ -5387,7 +5396,7 @@ radv_compute_pipeline_create(VkDevice _device, VkPipelineCache _cache, UNUSED gl_shader_stage last_vgt_api_stage = MESA_SHADER_NONE; result = radv_create_shaders(&pipeline->base, pipeline_layout, device, cache, &key, &pCreateInfo->stage, 1, pCreateInfo->flags, NULL, creation_feedback, - NULL, NULL, &last_vgt_api_stage); + NULL, NULL, 0, &last_vgt_api_stage); if (result != VK_SUCCESS) { radv_pipeline_destroy(device, &pipeline->base, pAllocator); return result; diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index 35c93236309..e48358a2e34 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -307,7 +307,7 @@ radv_rt_pipeline_create(VkDevice _device, VkPipelineCache _cache, * generating the nir. */ result = radv_create_shaders( &rt_pipeline->base.base, pipeline_layout, device, cache, &key, &stage, 1, flags, hash, - creation_feedback, &rt_pipeline->stack_sizes, &rt_pipeline->group_count, &last_vgt_api_stage); + creation_feedback, &rt_pipeline->stack_sizes, &rt_pipeline->group_count, 0, &last_vgt_api_stage); if (result != VK_SUCCESS && result != VK_PIPELINE_COMPILE_REQUIRED) goto pipeline_fail; @@ -327,7 +327,7 @@ radv_rt_pipeline_create(VkDevice _device, VkPipelineCache _cache, module.nir = shader; result = radv_create_shaders(&rt_pipeline->base.base, pipeline_layout, device, cache, &key, &stage, 1, pCreateInfo->flags, hash, creation_feedback, - &rt_pipeline->stack_sizes, &rt_pipeline->group_count, + &rt_pipeline->stack_sizes, &rt_pipeline->group_count, 0, &last_vgt_api_stage); if (result != VK_SUCCESS) goto shader_fail; diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index fec4b8c1774..1112c01d4e3 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -566,6 +566,7 @@ VkResult radv_create_shaders(struct radv_pipeline *pipeline, const VkPipelineCreationFeedbackCreateInfo *creation_feedback, struct radv_pipeline_shader_stack_size **stack_sizes, uint32_t *num_stack_sizes, + VkGraphicsPipelineLibraryFlagBitsEXT lib_flags, gl_shader_stage *last_vgt_api_stage); struct radv_shader_args;