Mesa (master): i965: handle extended swizzle terms (0, 1) in get_src_reg()

Brian Paul brianp at kemper.freedesktop.org
Mon May 11 15:51:32 UTC 2009


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

Author: Brian Paul <brianp at vmware.com>
Date:   Mon May 11 09:39:52 2009 -0600

i965: handle extended swizzle terms (0,1) in get_src_reg()

Fixes failed assertion in progs/glsl/twoside.c (but still wrong rendering).

---

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

diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
index efe8b51..2b2df73 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
@@ -509,6 +509,14 @@ static struct brw_reg get_src_reg(struct brw_wm_compile *c,
     const GLuint nr = 1;
     const GLuint component = GET_SWZ(src->Swizzle, channel);
 
+    /* Extended swizzle terms */
+    if (component == SWIZZLE_ZERO) {
+       return brw_imm_f(0.0F);
+    }
+    else if (component == SWIZZLE_ONE) {
+       return brw_imm_f(1.0F);
+    }
+
     if (c->fp->use_const_buffer &&
         (src->File == PROGRAM_STATE_VAR ||
          src->File == PROGRAM_CONSTANT ||




More information about the mesa-commit mailing list