From: Daniel Schürmann Date: Mon, 8 May 2023 17:41:12 +0000 (+0200) Subject: radv/rt: reference library shaders during radv_rt_fill_stage_info() X-Git-Tag: upstream/23.3.3~7377 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f2a569ec5d78b63dd4b0ff4ec99b848167579f7;p=platform%2Fupstream%2Fmesa.git radv/rt: reference library shaders during radv_rt_fill_stage_info() Part-of: --- diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index 062fd67..25c1c83 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -210,9 +210,10 @@ radv_rt_fill_stage_info(const VkRayTracingPipelineCreateInfoKHR *pCreateInfo, struct radv_ray_tracing_pipeline *library_pipeline = radv_pipeline_to_ray_tracing(pipeline); for (unsigned j = 0; j < library_pipeline->stage_count; ++j) { + stages[idx].shader = vk_pipeline_cache_object_ref(library_pipeline->stages[j].shader); stages[idx].stage = library_pipeline->stages[j].stage; + stages[idx].stack_size = library_pipeline->stages[j].stack_size; memcpy(stages[idx].sha1, library_pipeline->stages[j].sha1, SHA1_DIGEST_LENGTH); - idx++; } } @@ -367,9 +368,7 @@ radv_rt_precompile_shaders(struct radv_device *device, struct vk_pipeline_cache const struct radv_pipeline_key *key, struct radv_ray_tracing_stage *stages) { - uint32_t idx; - - for (idx = 0; idx < pCreateInfo->stageCount; idx++) { + for (uint32_t idx = 0; idx < pCreateInfo->stageCount; idx++) { int64_t stage_start = os_time_get_nano(); struct radv_pipeline_stage stage; radv_pipeline_stage_init(&pCreateInfo->pStages[idx], &stage, stages[idx].stage); @@ -409,17 +408,6 @@ radv_rt_precompile_shaders(struct radv_device *device, struct vk_pipeline_cache } } - /* reference library shaders */ - if (pCreateInfo->pLibraryInfo) { - for (unsigned i = 0; i < pCreateInfo->pLibraryInfo->libraryCount; ++i) { - RADV_FROM_HANDLE(radv_pipeline, pipeline, pCreateInfo->pLibraryInfo->pLibraries[i]); - struct radv_ray_tracing_pipeline *library = radv_pipeline_to_ray_tracing(pipeline); - - for (unsigned j = 0; j < library->stage_count; ++j) - stages[idx++].shader = vk_pipeline_cache_object_ref(library->stages[j].shader); - } - } - return VK_SUCCESS; }