summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-05-31 20:36:07 +0200
committerMarek Olšák <[email protected]>2011-06-01 16:10:56 +0200
commitf8b4ca7e47989c38c164a2f4a992bede77e3d281 (patch)
tree1d403385dffd5449eec84cccd4d873ba9b5e08a5 /src
parent9e1f40c1826af6d7f38db7c2061fbe9f956c28be (diff)
mesa: queries of non-existent FBO attachments should return INVALID_OPERATION
OpenGL 4.0 Compatibility, page 449: If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no framebuffer is bound to target. In this case querying pname FRAMEBUFFER_- ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate an INVALID_OPERATION error. Reviewed-by: Chad Versace <[email protected]> (cherry picked from commit b9e9df78a03edb35472c2e231aef4747e09db792)
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/fbobject.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index a98200e3183..0c5f6af3ed1 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -2039,6 +2039,10 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
if (att->Type == GL_TEXTURE) {
*params = att->TextureLevel;
}
+ else if (att->Type == GL_NONE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
else {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetFramebufferAttachmentParameterivEXT(pname)");
@@ -2053,6 +2057,10 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
*params = 0;
}
}
+ else if (att->Type == GL_NONE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
else {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetFramebufferAttachmentParameterivEXT(pname)");
@@ -2067,6 +2075,10 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
*params = 0;
}
}
+ else if (att->Type == GL_NONE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
else {
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetFramebufferAttachmentParameterivEXT(pname)");
@@ -2077,6 +2089,10 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetFramebufferAttachmentParameterivEXT(pname)");
}
+ else if (att->Type == GL_NONE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
else {
*params = _mesa_get_format_color_encoding(att->Renderbuffer->Format);
}
@@ -2087,6 +2103,10 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
"glGetFramebufferAttachmentParameterivEXT(pname)");
return;
}
+ else if (att->Type == GL_NONE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
else {
gl_format format = att->Renderbuffer->Format;
if (format == MESA_FORMAT_CI8 || format == MESA_FORMAT_S8) {
@@ -2108,6 +2128,10 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
_mesa_error(ctx, GL_INVALID_ENUM,
"glGetFramebufferAttachmentParameterivEXT(pname)");
}
+ else if (att->Type == GL_NONE) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetFramebufferAttachmentParameterivEXT(pname)");
+ }
else if (att->Texture) {
const struct gl_texture_image *texImage =
_mesa_select_tex_image(ctx, att->Texture, att->Texture->Target,
@@ -2125,7 +2149,8 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
att->Renderbuffer->Format);
}
else {
- *params = 0;
+ _mesa_problem(ctx, "glGetFramebufferAttachmentParameterivEXT:"
+ " invalid FBO attachment structure");
}
return;
default: