st/glsl_to_nir: don't generate nir twice for gs
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 16 Nov 2017 00:16:10 +0000 (11:16 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 21 Nov 2017 04:57:39 +0000 (15:57 +1100)
This was left out of c980a3aa3133

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_program.c

index 97b2e1234b1cccb4b40a245fa1a3db68148114c1..5c0a58104fc0a66aa98808839acf5a054f5397d5 100644 (file)
@@ -1431,15 +1431,9 @@ st_translate_geometry_program(struct st_context *st,
 {
    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 compiled 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)