From: Timothy Arceri Date: Thu, 16 Nov 2017 00:16:10 +0000 (+1100) Subject: st/glsl_to_nir: don't generate nir twice for gs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=04a9558497eabe6369b01ef45d1e25015e9286ba;p=mesa.git st/glsl_to_nir: don't generate nir twice for gs This was left out of c980a3aa3133 Reviewed-by: Marek Olšák --- diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 97b2e1234b1..5c0a58104fc 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -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)