mesa: Return INVALID_OPERATION when type is known but not allowed
authorMatt Turner <mattst88@gmail.com>
Fri, 30 Nov 2012 23:07:18 +0000 (15:07 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 15 Jan 2013 21:34:00 +0000 (13:34 -0800)
INVALID_ENUM is for when the type is simply not known.

Fixes part of es3conform's packed_depth_stencil_error test.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/glformats.c

index 85fe43d73d389a91995936ffbdfbe5c84b1a4b39..7969f77a4e31730a470f53457513cbffcb3b00f0 100644 (file)
@@ -1486,8 +1486,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: