From e5ff2c224266e9dd26db45bef1905b4e41c0a3a7 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 27 May 2022 11:53:43 -0500 Subject: [PATCH] anv: Use nir_shader_gather_xfb_info Now that the resulting xfb_info is stashed on the shader, we can put this with all the other NIR stuff and only fetch it out at the last minute when we upload the kernel. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/intel/vulkan/anv_pipeline.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index 6675deb73b3..cd59946a1ba 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -850,6 +850,11 @@ anv_pipeline_lower_nir(struct anv_pipeline *pipeline, gl_shader_stage_is_mesh(nir->info.stage)) NIR_PASS_V(nir, brw_nir_lower_cs_intrinsics); + if (nir->info.stage == MESA_SHADER_VERTEX || + nir->info.stage == MESA_SHADER_TESS_EVAL || + nir->info.stage == MESA_SHADER_GEOMETRY) + NIR_PASS_V(nir, nir_shader_gather_xfb_info); + stage->nir = nir; } @@ -1770,12 +1775,6 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline, void *stage_ctx = ralloc_context(NULL); - nir_xfb_info *xfb_info = NULL; - if (s == MESA_SHADER_VERTEX || - s == MESA_SHADER_TESS_EVAL || - s == MESA_SHADER_GEOMETRY) - xfb_info = nir_shader_get_xfb_info(stages[s].nir, stage_ctx); - switch (s) { case MESA_SHADER_VERTEX: anv_pipeline_compile_vs(compiler, stage_ctx, pipeline, @@ -1826,7 +1825,8 @@ anv_pipeline_compile_graphics(struct anv_graphics_pipeline *pipeline, &stages[s].prog_data.base, brw_prog_data_size(s), stages[s].stats, stages[s].num_stats, - xfb_info, &stages[s].bind_map); + stages[s].nir->xfb_info, + &stages[s].bind_map); if (!bin) { ralloc_free(stage_ctx); result = vk_error(pipeline, VK_ERROR_OUT_OF_HOST_MEMORY);