mesa: fix _mesa_update_texture_matrices()
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

_math_matrix_is_dirty() should only be used to decide if we need to
run _math_matrix_analyse(). We already decided that we had a new
texture matrix when we called _mesa_update_texture_matrices() so
we need to set _TexMatEnabled correctly otherwise we might
incorrectly return _NEW_FF_VERT_PROGRAM | _NEW_FF_FRAG_PROGRAM in
the following if-statement.

Fixes: ec978e002f ("mesa: only update fixed-func programs on texture matrix enablement changes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14286
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38473>
This commit is contained in:
Timothy Arceri 2025-11-17 15:13:14 +11:00 committed by Marge Bot
parent ad25196d35
commit b0047be0c2

View file

@ -401,12 +401,12 @@ _mesa_update_texture_matrices(struct gl_context *ctx)
for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) {
assert(u < ARRAY_SIZE(ctx->TextureMatrixStack));
if (_math_matrix_is_dirty(ctx->TextureMatrixStack[u].Top)) {
_math_matrix_analyse( ctx->TextureMatrixStack[u].Top );
if (ctx->Texture.Unit[u]._Current &&
ctx->TextureMatrixStack[u].Top->type != MATRIX_IDENTITY)
ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u);
_math_matrix_analyse(ctx->TextureMatrixStack[u].Top);
}
if (ctx->Texture.Unit[u]._Current &&
ctx->TextureMatrixStack[u].Top->type != MATRIX_IDENTITY)
ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u);
}
if (old_texmat_enabled != ctx->Texture._TexMatEnabled)