st/mesa: don't generate NIR for ARB_vp/fp if NIR is not preferred
authorMarek Olšák <marek.olsak@amd.com>
Wed, 12 Aug 2020 15:09:43 +0000 (11:09 -0400)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 Aug 2020 19:07:18 +0000 (19:07 +0000)
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 <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6442>

src/mesa/state_tracker/st_program.c

index f968073cc595ae835b820de030afdf05945cb518..eda6c9598ddd2f0669a17021e14bdb4f82b2c91d 100644 (file)
@@ -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)) {