This is common with viewperf and it helps.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18828>
<glx rop="179"/>
</function>
- <function name="MultMatrixf" es1="1.0" deprecated="3.1" exec="dlist">
+ <function name="MultMatrixf" es1="1.0" deprecated="3.1" exec="dlist"
+ marshal_call_before="if (_mesa_matrix_is_identity(m)) return;">
<param name="m" type="const GLfloat *" count="16"/>
<glx rop="180"/>
</function>
return M_DUMMY;
}
+static inline bool
+_mesa_matrix_is_identity(const float *m)
+{
+ static float identity[16] = {
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1
+ };
+
+ return !memcmp(m, identity, sizeof(identity));
+}
+
static inline void
_mesa_glthread_Enable(struct gl_context *ctx, GLenum cap)
{