[Mesa-dev] [PATCH 1/2] mesa/es3: Disallow FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE query of DEPTH_STENCIL_ATTACHMENT

Ian Romanick idr at freedesktop.org
Fri Jan 18 17:30:42 PST 2013


From: Ian Romanick <ian.d.romanick at intel.com>

This error was added in the 3.0.1 update to the OpenGL ES 3.0 spec.
Fixes the updated gles3conform packed_depth_stencil_parameters test.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/mesa/main/fbobject.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 58e5261..63f6eae 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2576,6 +2576,22 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
       }
       else {
          gl_format format = att->Renderbuffer->Format;
+
+         /* Page 235 (page 247 of the PDF) in section 6.1.13 of the OpenGL ES
+          * 3.0.1 spec says:
+          *
+          *     "If pname is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.... If
+          *     attachment is DEPTH_STENCIL_ATTACHMENT the query will fail and
+          *     generate an INVALID_OPERATION error.
+          */
+         if (_mesa_is_gles3(ctx) && attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+            _mesa_error(ctx, GL_INVALID_OPERATION,
+                        "glGetFramebufferAttachmentParameteriv(cannot query "
+                        "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE of "
+                        "GL_DEPTH_STENCIL_ATTACHMENT");
+            return;
+         }
+
          if (format == MESA_FORMAT_S8) {
             /* special cases */
             *params = GL_INDEX;
-- 
1.7.11.7



More information about the mesa-dev mailing list