From: Daniel Borca Date: Mon, 17 Jan 2005 08:04:39 +0000 (+0000) Subject: allow more internalFormat/format combinations (i hope i got it right) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=714c36c1202cd49c58cf6462afd391fd059b96c2;p=mesa.git allow more internalFormat/format combinations (i hope i got it right) --- diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 55d75116792..b9625dc247b 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)