Mesa (10.6): st/mesa: try PIPE_BIND_RENDER_TARGET when choosing float texture formats

Emil Velikov evelikov at kemper.freedesktop.org
Thu Oct 1 09:28:57 UTC 2015


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

Author: Brian Paul <brianp at vmware.com>
Date:   Thu Sep 24 09:36:44 2015 -0600

st/mesa: try PIPE_BIND_RENDER_TARGET when choosing float texture formats

For 8-bit RGB(A) texture formats we set the PIPE_BIND_RENDER_TARGET flag
to try to get a hardware format which also supports rendering (for FBO
textures).  Do the same thing for floating point formats.

This allows the Redway3D Flat demo to run.

Cc: 10.6 11.0 <mesa-stable at lists.freedesktop.org>

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
(cherry picked from commit cb758b892a7e62ff1f6187f2ca9ac543ff70a096)

---

 src/mesa/state_tracker/st_format.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index f582166..2b88c30 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -1960,7 +1960,11 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
    else if (internalFormat == 3 || internalFormat == 4 ||
             internalFormat == GL_RGB || internalFormat == GL_RGBA ||
             internalFormat == GL_RGB8 || internalFormat == GL_RGBA8 ||
-            internalFormat == GL_BGRA)
+            internalFormat == GL_BGRA ||
+            internalFormat == GL_RGB16F ||
+            internalFormat == GL_RGBA16F ||
+            internalFormat == GL_RGB32F ||
+            internalFormat == GL_RGBA32F)
 	 bindings |= PIPE_BIND_RENDER_TARGET;
 
    /* GLES allows the driver to choose any format which matches




More information about the mesa-commit mailing list