From: Marek Olšák Date: Wed, 12 Aug 2020 15:09:43 +0000 (-0400) Subject: st/mesa: don't generate NIR for ARB_vp/fp if NIR is not preferred X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2424485fb436b2abeca2dc801ffda156e3d1fe78;p=mesa.git st/mesa: don't generate NIR for ARB_vp/fp if NIR is not preferred Fixes: 5d0630e5043fc2 "st/mesa: call prog_to_nir sooner for ARB_fp" Fixes: a3de63fbb3d63e "st/mesa: don't generate VS TGSI if NIR is enabled" Reviewed-by: Eric Anholt Part-of: --- diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index f968073cc59..eda6c9598dd 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -511,7 +511,8 @@ st_translate_vertex_program(struct st_context *st, stp->affected_states |= ST_NEW_VS_CONSTANTS; /* Translate to NIR if preferred. */ - if (st->pipe->screen->get_shader_param(st->pipe->screen, + if (PIPE_SHADER_IR_NIR == + st->pipe->screen->get_shader_param(st->pipe->screen, PIPE_SHADER_VERTEX, PIPE_SHADER_CAP_PREFERRED_IR)) { assert(!stp->glsl_to_tgsi); @@ -906,6 +907,7 @@ st_translate_fragment_program(struct st_context *st, /* Translate to NIR. */ if (!stfp->ati_fs && + PIPE_SHADER_IR_NIR == st->pipe->screen->get_shader_param(st->pipe->screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_PREFERRED_IR)) {