allow GetTexImage with RGBA format and COLOR_INDEX internalformat
authorDaniel Borca <dborca@users.sourceforge.net>
Fri, 10 Dec 2004 07:36:35 +0000 (07:36 +0000)
committerDaniel Borca <dborca@users.sourceforge.net>
Fri, 10 Dec 2004 07:36:35 +0000 (07:36 +0000)
src/mesa/main/teximage.c

index 4dff27567e0462a6674506d7e842ccda3c882249..127e9bf56933c8a87c719741677ee4d9ab0c0283 100644 (file)
@@ -1954,10 +1954,12 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format,
    }
 
    /* Make sure the requested image format is compatible with the
-    * texture's format.
+    * texture's format. We let the colorformat-indexformat go through,
+    * because the texelfetcher will dequantize to full rgba.
     */
    if (is_color_format(format)
-       && !is_color_format(texImage->TexFormat->BaseFormat)) {
+       && !is_color_format(texImage->TexFormat->BaseFormat)
+       && !is_index_format(texImage->TexFormat->BaseFormat)) {
       _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)");
       return;
    }