fix some FBO/texture queries (bug 15296)
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 14:39:54 +0000 (08:39 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 14:42:09 +0000 (08:42 -0600)
src/mesa/main/fbobject.c

index 0ae69bdce7aa7569845e670c5c7327bf5fe02df9..960cc6da229cfee79b589592712cde164402074f 100644 (file)
@@ -1525,7 +1525,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,
@@ -1534,7 +1539,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,