[Mesa-dev] [PATCH 1/2] mesa: Return INVALID_OPERATION when type is known but not allowed

Matt Turner mattst88 at gmail.com
Fri Nov 30 15:13:54 PST 2012


INVALID_ENUM is for when the type is simply not known.

Fixes part of es3conform's packed_depth_stencil_error test.
---
 src/mesa/main/glformats.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index cf8879b..158b686 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -1270,8 +1270,18 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx,
          else if (ctx->Extensions.ARB_depth_buffer_float &&
              type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV)
             return GL_NO_ERROR;
-         else
+         switch (type) {
+         case GL_BYTE:
+         case GL_UNSIGNED_BYTE:
+         case GL_SHORT:
+         case GL_UNSIGNED_SHORT:
+         case GL_INT:
+         case GL_UNSIGNED_INT:
+         case GL_FLOAT:
+            return GL_INVALID_OPERATION;
+         default:
             return GL_INVALID_ENUM;
+         }
 
       case GL_DUDV_ATI:
       case GL_DU8DV8_ATI:
-- 
1.7.8.6



More information about the mesa-dev mailing list