Mesa (master): i965: Force border color A to 1 when it' s not present in the GL format.

Eric Anholt anholt at kemper.freedesktop.org
Sun Nov 4 20:24:33 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Nov  1 10:37:56 2012 -0700

i965: Force border color A to 1 when it's not present in the GL format.

It's usually forced to 1 by the surface format, but sometimes we actually have
alpha present because it's the only format available.

Fixes piglit texwrap bordercolor tests for OpenGL 1.1, GL_EXT_texture_sRGB and
GL_ARB_texture_float.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_wm_sampler_state.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index e51381b..fb9cb83 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -105,6 +105,13 @@ upload_default_color(struct brw_context *brw, struct gl_sampler_object *sampler,
       color[3] = sampler->BorderColor.f[3];
    }
 
+   /* In some cases we use an RGBA surface format for GL RGB textures,
+    * where we've initialized the A channel to 1.0.  We also have to set
+    * the border color alpha to 1.0 in that case.
+    */
+   if (firstImage->_BaseFormat == GL_RGB)
+      color[3] = 1.0;
+
    if (intel->gen == 5 || intel->gen == 6) {
       struct gen5_sampler_default_color *sdc;
 




More information about the mesa-commit mailing list