From 452d4d00df56d36f931bb52f85650a66f9a31445 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 28 Mar 2022 17:08:30 -0400 Subject: [PATCH] mesa/st: rework atom flagging when pointsize changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Part-of: --- src/mesa/state_tracker/st_context.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 94f4f360c43..8d180228704 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -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) { -- 2.34.1