Mesa (master): st/mesa: do not require all texture formats to be renderable

Marek Olšák mareko at kemper.freedesktop.org
Thu Dec 23 15:58:48 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Wed Dec 22 01:58:52 2010 +0100

st/mesa: do not require all texture formats to be renderable

This is a bandaid on the problem that if some formats were not renderable
(like luminance_alpha), st/mesa fell back to some RGBA format, so basically
some non-renderable formats were actually not used at all. This is only
a problem with hardware drivers, softpipe can render to anything.

Instead, require only RGB8/RGBA8 to be renderable.

---

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

diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 1ae6013..f6a44a8 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -1028,8 +1028,13 @@ gl_format
 st_ChooseTextureFormat(struct gl_context *ctx, GLint internalFormat,
                        GLenum format, GLenum type)
 {
+   boolean want_renderable =
+      internalFormat == 3 || internalFormat == 4 ||
+      internalFormat == GL_RGB || internalFormat == GL_RGBA ||
+      internalFormat == GL_RGB8 || internalFormat == GL_RGBA8;
+
    return st_ChooseTextureFormat_renderable(ctx, internalFormat,
-					    format, type, GL_TRUE);
+					    format, type, want_renderable);
 }
 
 /**




More information about the mesa-commit mailing list