mesa: set correct error for non-renderable multisample textures
authorTapani Pälli <tapani.palli@intel.com>
Thu, 13 Aug 2015 06:30:35 +0000 (09:30 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Fri, 14 Aug 2015 09:21:01 +0000 (12:21 +0300)
v2: same common error on gles31 and desktop OpenGL
    (spotted by Erik Faye-Lund)

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
src/mesa/main/teximage.c

index a144f950d449e06c66ef19475f7ae4aaa5c56767..3a556a6ad6e9b17028e2a0b066d9208882aa800b 100644 (file)
@@ -5639,9 +5639,16 @@ _mesa_texture_image_multisample(struct gl_context *ctx, GLuint dims,
    }
 
    if (!is_renderable_texture_format(ctx, internalformat)) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-            "%s(internalformat=%s)",
-            func, _mesa_enum_to_string(internalformat));
+      /* Page 172 of OpenGL ES 3.1 spec says:
+       *   "An INVALID_ENUM error is generated if sizedinternalformat is not
+       *   color-renderable, depth-renderable, or stencil-renderable (as
+       *   defined in section 9.4).
+       *
+       *  (Same error is also defined for desktop OpenGL for multisample
+       *  teximage/texstorage functions.)
+       */
+      _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalformat=%s)", func,
+                  _mesa_enum_to_string(internalformat));
       return;
    }