[Mesa-dev] [PATCH 07/10] mesa: Don't check for API_OPENGLES in _mesa_uniform_matrix
Ian Romanick
idr at freedesktop.org
Mon Nov 3 16:22:58 PST 2014
From: Ian Romanick <ian.d.romanick at intel.com>
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.
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/mesa/main/uniform_query.cpp | 8 ++++----
1 file 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;
--
1.8.1.4
More information about the mesa-dev
mailing list