summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borca <dborca@users.sourceforge.net>2005-01-17 08:04:39 +0000
committerDaniel Borca <dborca@users.sourceforge.net>2005-01-17 08:04:39 +0000
commit714c36c1202cd49c58cf6462afd391fd059b96c2 (patch)
treedd7fe08843881dcb88d6faa636deed481c0888d6
parentd98c47300ad0640f8456caced6f03675de06d3a9 (diff)
allow more internalFormat/format combinations (i hope i got it right)
-rw-r--r--src/mesa/main/teximage.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 55d7511679..b9625dc247 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -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)