summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-08-06 08:39:54 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-08-06 08:40:25 -0600
commitf1e4ca776f1c1f86beb8872d32009d902cf64e88 (patch)
treefa2f6fc0b48af8a3eb4e574e1733a2f2e4a870c5 /src/mesa
parentc20a1736566d301f38cc1271284b1fde9adb2741 (diff)
fix some FBO/texture queries (bug 15296)
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/fbobject.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 4190a95e41..680dc8eed0 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1513,7 +1513,12 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
return;
case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT:
if (att->Type == GL_TEXTURE) {
- *params = GL_TEXTURE_CUBE_MAP_POSITIVE_X + att->CubeMapFace;
+ if (att->Texture && att->Texture->Target == GL_TEXTURE_CUBE_MAP) {
+ *params = GL_TEXTURE_CUBE_MAP_POSITIVE_X + att->CubeMapFace;
+ }
+ else {
+ *params = 0;
+ }
}
else {
_mesa_error(ctx, GL_INVALID_ENUM,
@@ -1522,7 +1527,12 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
return;
case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT:
if (att->Type == GL_TEXTURE) {
- *params = att->Zoffset;
+ if (att->Texture && att->Texture->Target == GL_TEXTURE_3D) {
+ *params = att->Zoffset;
+ }
+ else {
+ *params = 0;
+ }
}
else {
_mesa_error(ctx, GL_INVALID_ENUM,