OSDN Git Service

allow more internalFormat/format combinations (i hope i got it right)
authorDaniel Borca <dborca@users.sourceforge.net>
Mon, 17 Jan 2005 08:04:39 +0000 (08:04 +0000)
committerDaniel Borca <dborca@users.sourceforge.net>
Mon, 17 Jan 2005 08:04:39 +0000 (08:04 +0000)
src/mesa/main/teximage.c

index 55d7511..b9625dc 100644 (file)
@@ -1189,6 +1189,7 @@ texture_error_check( GLcontext *ctx, GLenum target,
 {
    const GLboolean isProxy = is_proxy_target(target);
    GLboolean sizeOK;
+   GLboolean colorFormat, indexFormat;
 
    /* Basic level check (more checking in ctx->Driver.TestProxyTexImage) */
    if (level < 0 || level >= MAX_TEXTURE_LEVELS) {
@@ -1318,8 +1319,10 @@ texture_error_check( GLcontext *ctx, GLenum target,
    }
 
    /* make sure internal format and format basically agree */
-   if ((is_color_format(internalFormat) != is_color_format(format)) ||
-       (is_index_format(internalFormat) != is_index_format(format)) ||
+   colorFormat = is_color_format(format);
+   indexFormat = is_index_format(format);
+   if ((is_color_format(internalFormat) && !colorFormat && !indexFormat) ||
+       (is_index_format(internalFormat) && !indexFormat) ||
        (is_depth_format(internalFormat) != is_depth_format(format)) ||
        (is_ycbcr_format(internalFormat) != is_ycbcr_format(format))) {
       if (!isProxy)