diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2021-03-01 11:55:42 -0800 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-03-01 21:11:47 +0000 |
commit | cb3dad8ca4d10d397466c0387bce97bc23cfaa26 (patch) | |
tree | 9e14523fd73179812c99137f7db650f7585c6319 /src/mesa/tnl | |
parent | 1cd3b57db87f86ddcb9d71afe51777226c34df79 (diff) |
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: 10371c520c1 ("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>
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r-- | src/mesa/tnl/t_vb_program.c | 3 | ||||
-rw-r--r-- | src/mesa/tnl/t_vb_vertex.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index f240e98387f..44fc63ad3ef 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -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. diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 1309b465b78..60c624d77a7 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -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] ); |