Mesa (master): mesa: fix texstore with GL_COLOR_INDEX data

Roland Scheidegger sroland at kemper.freedesktop.org
Thu Aug 14 00:17:34 UTC 2014


Module: Mesa
Branch: master
Commit: b6d29de2c443df2aa670a70545d2e1e68ef57f45
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b6d29de2c443df2aa670a70545d2e1e68ef57f45

Author: Roland Scheidegger <sroland at vmware.com>
Date:   Wed Aug 13 19:30:48 2014 +0200

mesa: fix texstore with GL_COLOR_INDEX data

This got broken by 3dbf5bf6571e0c9d3e4febce01dea82be190d9d2.
GL_COLOR_INDEX data is still supported (in legacy contexts), but the new
texstore_swizzle path cannot handle it (and didn't detect this).
Unfortunately there's no piglit test trying to specify textures with a
GL_COLOR_INDEX source format, and I don't really understand how all the color
map stuff which is used by this works, but this caused conform failures
(with a reported mesa implementation error when trying to figure out the color
mapping).

Reviewed-by: Jason Ekstrand <jason.ekstrand at intel.com>

---

 src/mesa/main/texstore.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 50306d8..4ea5bd8 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1495,6 +1495,9 @@ texstore_swizzle(TEXSTORE_PARAMS)
    if (!is_array)
       return GL_FALSE;
 
+   if (srcFormat == GL_COLOR_INDEX)
+      return GL_FALSE;
+
    switch (srcType) {
    case GL_FLOAT:
    case GL_UNSIGNED_BYTE:




More information about the mesa-commit mailing list