projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
533b353
)
mesa: check for no matrix change in _mesa_LoadMatrixf()
author
Brian Paul
<brianp@vmware.com>
Wed, 14 Sep 2016 18:16:18 +0000
(12:16 -0600)
committer
Brian Paul
<brianp@vmware.com>
Thu, 15 Sep 2016 18:00:12 +0000
(12:00 -0600)
Some apps issue redundant glLoadMatrixf() calls with the same matrix.
Try to avoid setting dirty state in that situation.
This reduces the number of constant buffer updates by about half in
ET Quake Wars.
Tested with Piglit, ETQW, Sauerbraten, Google Earth, etc.
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/matrix.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/matrix.c
b/src/mesa/main/matrix.c
index b30b983f14fd7a3d99972c5fb5d0d1e05f25bbc1..83f081e88e5d37c59c9962e037a2994d7af77121 100644
(file)
--- a/
src/mesa/main/matrix.c
+++ b/
src/mesa/main/matrix.c
@@
-356,9
+356,11
@@
_mesa_LoadMatrixf( const GLfloat *m )
m[2], m[6], m[10], m[14],
m[3], m[7], m[11], m[15]);
- FLUSH_VERTICES(ctx, 0);
- _math_matrix_loadf( ctx->CurrentStack->Top, m );
- ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+ if (memcmp(m, ctx->CurrentStack->Top->m, 16 * sizeof(GLfloat)) != 0) {
+ FLUSH_VERTICES(ctx, 0);
+ _math_matrix_loadf( ctx->CurrentStack->Top, m );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+ }
}