Mesa (master): st/mesa: don't do (generic) compression of 1D or 1D_ARRAY textures

Brian Paul brianp at kemper.freedesktop.org
Fri Aug 24 20:19:09 UTC 2012


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Aug 24 08:44:47 2012 -0600

st/mesa: don't do (generic) compression of 1D or 1D_ARRAY textures

As with the previous commit for core Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>

---

 src/mesa/state_tracker/st_format.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 404b041..302b58c 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -1632,7 +1632,8 @@ st_ChooseTextureFormat_renderable(struct gl_context *ctx, GLint internalFormat,
  */
 gl_format
 st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
-                       GLint internalFormat, GLenum format, GLenum type)
+                       GLint internalFormat,
+                       GLenum format, GLenum type)
 {
    boolean want_renderable =
       internalFormat == 3 || internalFormat == 4 ||
@@ -1640,6 +1641,15 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
       internalFormat == GL_RGB8 || internalFormat == GL_RGBA8 ||
       internalFormat == GL_BGRA;
 
+   if (target == GL_TEXTURE_1D || target == GL_TEXTURE_1D_ARRAY) {
+      /* We don't do compression for these texture targets because of
+       * difficulty with sub-texture updates on non-block boundaries, etc.
+       * So change the internal format request to an uncompressed format.
+       */
+      internalFormat =
+        _mesa_generic_compressed_format_to_uncompressed_format(internalFormat);
+   }
+
    return st_ChooseTextureFormat_renderable(ctx, internalFormat,
 					    format, type, want_renderable);
 }




More information about the mesa-commit mailing list