mesa/st: rework atom flagging when pointsize changes
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 28 Mar 2022 21:08:30 +0000 (17:08 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 30 Mar 2022 03:49:36 +0000 (03:49 +0000)
if the driver requires pointsize uploads, only flag the last vertex
stage for updates, not all vertex stages

this should be functionally equivalent but without the unnecessary overhead
of also scanning the other stages

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

src/mesa/state_tracker/st_context.c

index 94f4f360c43c0352026f1b4db880db9904cf70ee..8d180228704cd19fb6a08673cf92ced8ec7ea410 100644 (file)
@@ -176,8 +176,14 @@ st_invalidate_state(struct gl_context *ctx)
    }
 
    /* Update the vertex shader if ctx->Point was changed. */
-   if (st->lower_point_size && new_state & _NEW_POINT)
-      st->dirty |= ST_NEW_VS_STATE | ST_NEW_TES_STATE | ST_NEW_GS_STATE;
+   if (st->lower_point_size && new_state & _NEW_POINT) {
+      if (ctx->GeometryProgram._Current)
+         st->dirty |= ST_NEW_GS_STATE;
+      else if (ctx->TessEvalProgram._Current)
+         st->dirty |= ST_NEW_TES_STATE;
+      else
+         st->dirty |= ST_NEW_VS_STATE;
+   }
 
    /* Which shaders are dirty will be determined manually. */
    if (new_state & _NEW_PROGRAM) {