diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2013-01-18 17:25:57 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2013-01-22 03:26:24 -0500 |
commit | d7475c79665370de82e65cbf6e5d6f9b6ad4ce81 (patch) | |
tree | 3429fc605dcd2f3debda084fd9c79501b5c2468c /src | |
parent | 9cb64a4cb61ce6cef28ea8ecfedb89f756713e95 (diff) |
mesa/es3: Disallow FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE query of DEPTH_STENCIL_ATTACHMENT
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@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/fbobject.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 23d6495c9d1..4b80f8bacef 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -2555,6 +2555,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; |