Mesa (master): mesa: set correct error for non-renderable multisample textures

Tapani Pälli tpalli at kemper.freedesktop.org
Fri Aug 14 09:23:19 UTC 2015


Module: Mesa
Branch: master
Commit: 7a144aaf64e5cfff5aa53d7fd340c91762e51aa5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a144aaf64e5cfff5aa53d7fd340c91762e51aa5

Author: Tapani Pälli <tapani.palli at intel.com>
Date:   Thu Aug 13 09:30:35 2015 +0300

mesa: set correct error for non-renderable multisample textures

v2: same common error on gles31 and desktop OpenGL
    (spotted by Erik Faye-Lund)

Signed-off-by: Marta Lofstedt <marta.lofstedt at linux.intel.com>
Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Timothy Arceri <t_arceri at yahoo.com.au>

---

 src/mesa/main/teximage.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index a144f95..3a556a6 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -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;
    }
 




More information about the mesa-commit mailing list