diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2008-01-03 17:21:22 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2008-01-04 01:20:41 +0000 |
commit | 65426b144e9c3f6c8c1e6d0c0dce0ae955f7d1c3 (patch) | |
tree | ab8841a6861262bd16257d98f0ea34f152407a2f /src/mesa/pipe/i965simple/brw_sf.c | |
parent | 25c9728644becd6342d025bdf355f311d00d5cb5 (diff) |
965: always perform SF parameter setup for position
Match behaviour of DRI driver. Fix fragment shader to find the other
parameters one slot further on. Will need more work to cope with FP's
that actually reference position.
Diffstat (limited to 'src/mesa/pipe/i965simple/brw_sf.c')
-rw-r--r-- | src/mesa/pipe/i965simple/brw_sf.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/pipe/i965simple/brw_sf.c b/src/mesa/pipe/i965simple/brw_sf.c index c04234ecf4..362196a0d1 100644 --- a/src/mesa/pipe/i965simple/brw_sf.c +++ b/src/mesa/pipe/i965simple/brw_sf.c @@ -58,7 +58,7 @@ static void compile_sf_prog( struct brw_context *brw, c.nr_attrs = c.key.vp_output_count; c.nr_attr_regs = (c.nr_attrs+1)/2; - c.nr_setup_attrs = c.key.fp_input_count; + c.nr_setup_attrs = c.key.fp_input_count + 1; /* +1 for position */ c.nr_setup_regs = (c.nr_setup_attrs+1)/2; c.prog_data.urb_read_length = c.nr_attr_regs; @@ -205,6 +205,14 @@ static void upload_sf_prog( struct brw_context *brw ) } } + /* Hack: Adjust for position. Optimize away when not required (ie + * for perspective interpolation). + */ + key.persp_mask <<= 1; + key.linear_mask <<= 1; + key.linear_mask |= 1; + key.const_mask <<= 1; + _mesa_printf("key.persp_mask: %x\n", key.persp_mask); _mesa_printf("key.linear_mask: %x\n", key.linear_mask); _mesa_printf("key.const_mask: %x\n", key.const_mask); |