Mesa (main): lavapipe: Use nir_shader_gather_xfb_info

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue May 31 23:42:12 UTC 2022


Module: Mesa
Branch: main
Commit: 0eab41559f376da326f90ef7ab2a33ff58529520
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0eab41559f376da326f90ef7ab2a33ff58529520

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Fri May 27 11:57:41 2022 -0500

lavapipe: Use nir_shader_gather_xfb_info

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16750>

---

 src/gallium/frontends/lavapipe/lvp_pipeline.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c
index 8971c5e8955..4645e5f4839 100644
--- a/src/gallium/frontends/lavapipe/lvp_pipeline.c
+++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c
@@ -1022,6 +1022,11 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
 
    nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
 
+   if (nir->info.stage == MESA_SHADER_VERTEX ||
+       nir->info.stage == MESA_SHADER_GEOMETRY ||
+       nir->info.stage == MESA_SHADER_TESS_EVAL)
+      nir_shader_gather_xfb_info(nir);
+
    if (nir->info.stage != MESA_SHADER_VERTEX)
       nir_assign_io_var_locations(nir, nir_var_shader_in, &nir->num_inputs, nir->info.stage);
    else {
@@ -1121,7 +1126,7 @@ lvp_pipeline_compile(struct lvp_pipeline *pipeline,
       if (stage == MESA_SHADER_VERTEX ||
           stage == MESA_SHADER_GEOMETRY ||
           stage == MESA_SHADER_TESS_EVAL) {
-         nir_xfb_info *xfb_info = nir_shader_get_xfb_info(pipeline->pipeline_nir[stage], NULL);
+         nir_xfb_info *xfb_info = pipeline->pipeline_nir[stage]->xfb_info;
          if (xfb_info) {
             uint8_t output_mapping[VARYING_SLOT_TESS_MAX];
             memset(output_mapping, 0, sizeof(output_mapping));
@@ -1147,8 +1152,6 @@ lvp_pipeline_compile(struct lvp_pipeline *pipeline,
                shstate.stream_output.output[i].start_component = ffs(xfb_info->outputs[i].component_mask) - 1;
                shstate.stream_output.output[i].stream = xfb_info->buffer_to_stream[xfb_info->outputs[i].buffer];
             }
-
-            ralloc_free(xfb_info);
          }
       }
 



More information about the mesa-commit mailing list