summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnuj Phogat <anuj.phogat@gmail.com>2014-03-11 17:04:11 -0700
committerAnuj Phogat <anuj.phogat@gmail.com>2014-04-21 11:20:50 -0700
commitbd1880dfe8fe1eea12eeb573df34ef328b96013e (patch)
treeabb5f7b0712b54cad1a22ec48646d3cdf3843895
parent7cb3bbf2cd64b8e8d7eb49cdc1238808f140f66b (diff)
mesa: Add an error condition in glGetFramebufferAttachmentParameteriv()
From the OpenGL 4.4 spec page 275: "If pname is FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, param will contain the format of components of the specified attachment, one of FLOAT, INT, UNSIGNED_INT, SIGNED_NORMALIZED, or UNSIGNED_NORMALIZED for floating-point, signed integer, unsigned integer, signed normalized fixedpoint, or unsigned normalized fixed-point components respectively. If no data storage or texture image has been specified for the attachment, param will contain NONE. This query cannot be performed for a combined depth+stencil attachment, since it does not have a single format." Fixes Khronos CTS test: packed_depth_stencil_parameters.test Khronos Bug# 9170 Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
-rw-r--r--src/mesa/main/fbobject.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 7669a0c5df..cd04fbe111 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2770,6 +2770,19 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
}
if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+ if (pname == GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE) {
+ /* This behavior is first specified in OpenGL 4.4 specification.
+ *
+ * From the OpenGL 4.4 spec page 275:
+ * "This query cannot be performed for a combined depth+stencil
+ * attachment, since it does not have a single format."
+ */
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetFramebufferAttachmentParameteriv("
+ "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE"
+ " is invalid for depth+stencil attachment)");
+ return;
+ }
/* the depth and stencil attachments must point to the same buffer */
const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt;
depthAtt = get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT);