radv/rt: expose radv_parse_rt_stage()
authorDaniel Schürmann <daniel@schuermann.dev>
Wed, 8 Mar 2023 03:25:05 +0000 (04:25 +0100)
committerMarge Bot <emma+marge@anholt.net>
Tue, 2 May 2023 19:15:10 +0000 (19:15 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22100>

src/amd/vulkan/radv_rt_shader.c
src/amd/vulkan/radv_shader.h

index 40b3339..52dfd24 100644 (file)
@@ -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.
index 4941d43..4559c74 100644 (file)
@@ -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,