summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-05-11 09:39:52 -0600
committerBrian Paul <brianp@vmware.com>2009-05-11 09:47:32 -0600
commit6697311b21a65dbea9236413a3afc759a592afd7 (patch)
tree77b5ca7d6be9a96af0f8f85bc108666e14049f80
parent7c2fe42dedcd9f437f2b3fae92963d4c4c56fe03 (diff)
i965: handle extended swizzle terms (0,1) in get_src_reg()
Fixes failed assertion in progs/glsl/twoside.c (but still wrong rendering).
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_glsl.c8
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 efe8b5126c..2b2df7329c 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 ||