From 04a9558497eabe6369b01ef45d1e25015e9286ba Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 16 Nov 2017 11:16:10 +1100 Subject: [PATCH] st/glsl_to_nir: don't generate nir twice for gs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This was left out of c980a3aa3133 Reviewed-by: Marek Olšák --- 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 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) -- 2.30.2