radv/rt: cleanup radv_parse_rt_stage()

To avoid calling radv_pipeline_stage_init() twice.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27036>
This commit is contained in:
Samuel Pitoiset 2024-01-12 12:26:10 +01:00 committed by Marge Bot
parent ffe997d71d
commit 853298edb1
3 changed files with 4 additions and 12 deletions

View file

@ -808,15 +808,9 @@ insert_rt_case(nir_builder *b, nir_shader *shader, struct rt_variables *vars, ni
}
nir_shader *
radv_parse_rt_stage(struct radv_device *device, const VkPipelineShaderStageCreateInfo *sinfo,
const struct radv_pipeline_key *key, const struct radv_pipeline_layout *pipeline_layout)
radv_parse_rt_stage(struct radv_device *device, const struct radv_shader_stage *rt_stage)
{
gl_shader_stage s = vk_to_mesa_shader_stage(sinfo->stage);
struct radv_shader_stage rt_stage;
radv_pipeline_stage_init(sinfo, pipeline_layout, &key->stage_info[s], &rt_stage);
nir_shader *shader = radv_shader_spirv_to_nir(device, &rt_stage, NULL, false);
nir_shader *shader = radv_shader_spirv_to_nir(device, rt_stage, NULL, false);
NIR_PASS(_, shader, nir_lower_vars_to_explicit_types, nir_var_function_temp | nir_var_shader_call_data,
glsl_get_natural_size_align_bytes);

View file

@ -518,7 +518,7 @@ radv_rt_compile_shaders(struct radv_device *device, struct vk_pipeline_cache *ca
radv_pipeline_stage_init(&pCreateInfo->pStages[i], pipeline_layout, &key->stage_info[s], stage);
/* precompile the shader */
stage->nir = radv_parse_rt_stage(device, &pCreateInfo->pStages[i], key, pipeline_layout);
stage->nir = radv_parse_rt_stage(device, stage);
rt_stages[i].can_inline = radv_rt_can_inline_shader(stage->nir);

View file

@ -725,9 +725,7 @@ void radv_postprocess_nir(struct radv_device *device, const struct radv_graphics
bool radv_shader_should_clear_lds(const struct radv_device *device, const nir_shader *shader);
nir_shader *radv_parse_rt_stage(struct radv_device *device, const VkPipelineShaderStageCreateInfo *sinfo,
const struct radv_pipeline_key *key,
const struct radv_pipeline_layout *pipeline_layout);
nir_shader *radv_parse_rt_stage(struct radv_device *device, const struct radv_shader_stage *rt_stage);
void radv_nir_lower_rt_abi(nir_shader *shader, const VkRayTracingPipelineCreateInfoKHR *pCreateInfo,
const struct radv_shader_args *args, const struct radv_shader_info *info,