summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniform_query.cpp
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2014-10-20 16:50:53 -0700
committerIan Romanick <ian.d.romanick@intel.com>2014-11-10 04:25:40 -0800
commit378d92c74e2b07a630919a2b178a471d4f7407ba (patch)
tree76b9a5e77f3611795d26c540ab4de3f1327a00bf /src/mesa/main/uniform_query.cpp
parent91a2fa1490b86b11430db6a604dc28bac1871695 (diff)
downloadexternal_mesa3d-378d92c74e2b07a630919a2b178a471d4f7407ba.zip
external_mesa3d-378d92c74e2b07a630919a2b178a471d4f7407ba.tar.gz
external_mesa3d-378d92c74e2b07a630919a2b178a471d4f7407ba.tar.bz2
mesa: Don't check for API_OPENGLES in _mesa_uniform_matrix
There are no uniforms in OpenGL ES 1.x, so we can't even get to this code in that API. Also, reorder the checks. First check that transpose is true, then check whether or not that is legal in the current API. transpose should never be true in an ES2 context, so this gets one check (the more expensive one) out of the main path. Valgrind callgrind results for a trace of Tesseract: _mesa_UniformMatrix4fv _mesa_UniformMatrix3fv Before (64-bit): 96,119,025 24,240,510 After (64-bit): 90,726,569 22,926,662 _mesa_UniformMatrix4fv _mesa_UniformMatrix3fv Before (32-bit): 132,434,452 29,051,808 After (32-bit): 126,658,112 27,989,316 Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'src/mesa/main/uniform_query.cpp')
-rw-r--r--src/mesa/main/uniform_query.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index b87dbdf..f971ba1 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -836,10 +836,10 @@ _mesa_uniform_matrix(struct gl_context *ctx, struct gl_shader_program *shProg,
}
/* GL_INVALID_VALUE is generated if `transpose' is not GL_FALSE.
- * http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml */
- if (ctx->API == API_OPENGLES
- || (ctx->API == API_OPENGLES2 && ctx->Version < 30)) {
- if (transpose) {
+ * http://www.khronos.org/opengles/sdk/docs/man/xhtml/glUniform.xml
+ */
+ if (transpose) {
+ if (ctx->API == API_OPENGLES2 && ctx->Version < 30) {
_mesa_error(ctx, GL_INVALID_VALUE,
"glUniformMatrix(matrix transpose is not GL_FALSE)");
return;