[Mesa-dev] [PATCH] st/glsl_to_nir: don't generate nir twice for gs

Timothy Arceri tarceri at itsqueeze.com
Thu Nov 16 00:16:10 UTC 2017


This was left out of c980a3aa3133
---
 src/mesa/state_tracker/st_program.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 97b2e1234b..dc81a17289 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -1424,29 +1424,23 @@ st_translate_program_common(struct st_context *st,
 
 /**
  * Translate a geometry program to create a new variant.
  */
 bool
 st_translate_geometry_program(struct st_context *st,
                               struct st_common_program *stgp)
 {
    struct ureg_program *ureg;
 
-   if (stgp->shader_program) {
-      nir_shader *nir = st_glsl_to_nir(st, &stgp->Base, stgp->shader_program,
-                                       MESA_SHADER_GEOMETRY);
-
-      stgp->tgsi.type = PIPE_SHADER_IR_NIR;
-      stgp->tgsi.ir.nir = nir;
-
+   /* We have already compiler to NIR so just return */
+   if (stgp->shader_program)
       return true;
-   }
 
    ureg = ureg_create_with_screen(PIPE_SHADER_GEOMETRY, st->pipe->screen);
    if (ureg == NULL)
       return false;
 
    ureg_property(ureg, TGSI_PROPERTY_GS_INPUT_PRIM,
                  stgp->Base.info.gs.input_primitive);
    ureg_property(ureg, TGSI_PROPERTY_GS_OUTPUT_PRIM,
                  stgp->Base.info.gs.output_primitive);
    ureg_property(ureg, TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES,
-- 
2.14.3



More information about the mesa-dev mailing list