tnl: Call _mesa_matrix_analyse to make sure the inverse MVP is updated

A recent commit stopped updating the inverse MVP matrix, because usually
only GLSL built-ins need it.  However, TNL also needs it.  So make sure
it's correct when needed.

Fixes: 10371c520c ("mesa: don't compute the ModelView * Projection matrix if not used")
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9346>
This commit is contained in:
Kenneth Graunke
2021-03-01 11:55:42 -08:00
committed by Marge Bot
parent 1cd3b57db8
commit cb3dad8ca4
2 changed files with 6 additions and 0 deletions

View File

@@ -402,6 +402,9 @@ run_vp( struct gl_context *ctx, struct tnl_pipeline_stage *stage )
unmap_textures(ctx, program);
if (program->arb.IsPositionInvariant) {
/* make sure the inverse is up to date */
_math_matrix_analyse(&ctx->_ModelProjectMatrix);
/* We need the exact same transform as in the fixed function path here
* to guarantee invariance, depending on compiler optimization flags
* results could be different otherwise.

View File

@@ -158,6 +158,9 @@ static GLboolean run_vertex_stage( struct gl_context *ctx,
VB->AttribPtr[_TNL_ATTRIB_POS]);
}
/* make sure the inverse is up to date */
_math_matrix_analyse(&ctx->_ModelProjectMatrix);
VB->ClipPtr = TransformRaw( &store->clip,
&ctx->_ModelProjectMatrix,
VB->AttribPtr[_TNL_ATTRIB_POS] );