From a5b0b150df5eea17f912bd97be006689e306c370 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Sch=C3=BCrmann?= Date: Wed, 8 Mar 2023 04:25:05 +0100 Subject: [PATCH] radv/rt: expose radv_parse_rt_stage() Part-of: --- src/amd/vulkan/radv_rt_shader.c | 14 +++++++------- src/amd/vulkan/radv_shader.h | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/amd/vulkan/radv_rt_shader.c b/src/amd/vulkan/radv_rt_shader.c index 40b3339..52dfd24 100644 --- a/src/amd/vulkan/radv_rt_shader.c +++ b/src/amd/vulkan/radv_rt_shader.c @@ -864,9 +864,9 @@ insert_rt_case(nir_builder *b, nir_shader *shader, struct rt_variables *vars, ni } } -static nir_shader * -parse_rt_stage(struct radv_device *device, const VkPipelineShaderStageCreateInfo *sinfo, - const struct radv_pipeline_key *key) +nir_shader * +radv_parse_rt_stage(struct radv_device *device, const VkPipelineShaderStageCreateInfo *sinfo, + const struct radv_pipeline_key *key) { struct radv_pipeline_stage rt_stage; @@ -1227,7 +1227,7 @@ visit_any_hit_shaders(struct radv_device *device, continue; const VkPipelineShaderStageCreateInfo *stage = &pCreateInfo->pStages[shader_id]; - nir_shader *nir_stage = parse_rt_stage(device, stage, data->key); + nir_shader *nir_stage = radv_parse_rt_stage(device, stage, data->key); insert_rt_case(b, nir_stage, vars, sbt_idx, 0, data->groups[i].handle.any_hit_index, shader_id, data->groups); @@ -1364,12 +1364,12 @@ handle_candidate_aabb(nir_builder *b, struct radv_leaf_intersection *intersectio continue; const VkPipelineShaderStageCreateInfo *stage = &data->createInfo->pStages[shader_id]; - nir_shader *nir_stage = parse_rt_stage(data->device, stage, data->key); + nir_shader *nir_stage = radv_parse_rt_stage(data->device, stage, data->key); nir_shader *any_hit_stage = NULL; if (any_hit_shader_id != VK_SHADER_UNUSED_KHR) { stage = &data->createInfo->pStages[any_hit_shader_id]; - any_hit_stage = parse_rt_stage(data->device, stage, data->key); + any_hit_stage = radv_parse_rt_stage(data->device, stage, data->key); nir_lower_intersection_shader(nir_stage, any_hit_stage); ralloc_free(any_hit_stage); @@ -1662,7 +1662,7 @@ create_rt_shader(struct radv_device *device, const VkRayTracingPipelineCreateInf assert(type == MESA_SHADER_RAYGEN || type == MESA_SHADER_CALLABLE || type == MESA_SHADER_CLOSEST_HIT || type == MESA_SHADER_MISS); - nir_shader *nir_stage = parse_rt_stage(device, stage, key); + nir_shader *nir_stage = radv_parse_rt_stage(device, stage, key); /* Move ray tracing system values to the top that are set by rt_trace_ray * to prevent them from being overwritten by other rt_trace_ray calls. diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 4941d43..4559c74 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -559,6 +559,10 @@ void radv_postprocess_nir(struct radv_device *device, const struct radv_pipeline_key *pipeline_key, unsigned last_vgt_api_stage, struct radv_pipeline_stage *stage); +nir_shader *radv_parse_rt_stage(struct radv_device *device, + const VkPipelineShaderStageCreateInfo *sinfo, + const struct radv_pipeline_key *key); + struct radv_pipeline_stage; nir_shader *radv_shader_spirv_to_nir(struct radv_device *device, -- 2.7.4