[Mesa-dev] [PATCH] mesa/texstore: Don't try swizzle_and_convert on color-index formats

Jason Ekstrand jason at jlekstrand.net
Wed Aug 13 10:34:57 PDT 2014


The _mesa_swizzle_and_convert function can't handle them.  Now we fall back
to the more generic path which can handle it instead of failing an assert.

Signed-off-by: Jason Ekstrand <jason.ekstrand at intel.com>
---
 src/mesa/main/texstore.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 50306d8..42cebbd 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1526,6 +1526,10 @@ texstore_swizzle(TEXSTORE_PARAMS)
    }
    swap = need_swap ? map_3210 : map_identity;
 
+   /* _mesa_swizzle_and_convert can't handle color-index formats */
+   if (srcFormat == GL_COLOR_INDEX)
+      return GL_FALSE;
+
    compute_component_mapping(srcFormat, baseInternalFormat, base2src);
    compute_component_mapping(baseInternalFormat, GL_RGBA, rgba2base);
    invert_swizzle(dst2rgba, rgba2dst);
-- 
2.0.4



More information about the mesa-dev mailing list