mesa/st: flag ST_NEW_CONSTANTS upon running nir_lower_point_size_mov
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 30 Jul 2020 15:05:06 +0000 (11:05 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 18 Dec 2020 16:06:05 +0000 (16:06 +0000)
this reduces to a load_ubo after optimization, so we need to ensure that
the constant data is put in a buffer instead of relying on it happening
coincidentally

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5885>

src/mesa/state_tracker/st_program.c

index 1a0756192974835cf61ca90d9730a7941682abe6..5424fc204fd621b7dd23a408759ef42f078a7670 100644 (file)
@@ -699,6 +699,7 @@ st_create_vp_variant(struct st_context *st,
          _mesa_add_state_reference(params, point_size_state);
          NIR_PASS_V(state.ir.nir, nir_lower_point_size_mov,
                     point_size_state);
+         stvp->affected_states |= ST_NEW_VS_CONSTANTS;
          finalize = true;
       }
 
@@ -1713,6 +1714,10 @@ st_get_common_variant(struct st_context *st,
                _mesa_add_state_reference(params, point_size_state);
                NIR_PASS_V(state.ir.nir, nir_lower_point_size_mov,
                           point_size_state);
+               if (prog->Base.info.stage == MESA_SHADER_TESS_EVAL)
+                  prog->affected_states |= ST_NEW_TES_CONSTANTS;
+               else if (prog->Base.info.stage == MESA_SHADER_GEOMETRY)
+                  prog->affected_states |= ST_NEW_GS_CONSTANTS;
                finalize = true;
             }
             state.stream_output = prog->state.stream_output;