summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/fbobject.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 6b6ebb78f75..fe6bdc2b4d1 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -3611,7 +3611,16 @@ _mesa_get_framebuffer_attachment_parameter(struct gl_context *ctx,
switch (pname) {
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT:
- *params = _mesa_is_winsys_fbo(buffer)
+ /* From the OpenGL spec, 9.2. Binding and Managing Framebuffer Objects:
+ *
+ * "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then
+ * either no framebuffer is bound to target; or the default framebuffer
+ * is bound, attachment is DEPTH or STENCIL, and the number of depth or
+ * stencil bits, respectively, is zero."
+ */
+ *params = (_mesa_is_winsys_fbo(buffer) &&
+ ((attachment != GL_DEPTH && attachment != GL_STENCIL) ||
+ (att->Type != GL_NONE)))
? GL_FRAMEBUFFER_DEFAULT : att->Type;
return;
case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT: