diff options
author | Marek Olšák <maraeo@gmail.com> | 2009-12-24 03:10:33 +0100 |
---|---|---|
committer | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-01-06 12:49:15 -0800 |
commit | bf60eb3fec844a7c3793aba0c70da56b74a17344 (patch) | |
tree | 3fd46844a6fb0ee0d1b7a9bf60e54512929a0382 /src/gallium/drivers/r300/r300_state_derived.c | |
parent | dc7f309f9c4562e367bb18a2eb3d1dcf67003cad (diff) |
r300g: add WPOS
Diffstat (limited to 'src/gallium/drivers/r300/r300_state_derived.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state_derived.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 727ae7ade6..242716fccc 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -410,6 +410,26 @@ static void r300_update_rs_block(struct r300_context* r300, } } + /* Rasterize WPOS. */ + if (vs_outputs->wpos != ATTR_UNUSED) { + /* Always rasterize if it's written by the VS, + * otherwise it locks up. */ + rX00_rs_tex(rs, tex_count, tex_count, FALSE); + + /* Write it to the FS input register if it's used by the FS. */ + if (fs_inputs->wpos != ATTR_UNUSED) { + rX00_rs_tex_write(rs, tex_count, fp_offset); + fp_offset++; + } + tex_count++; + } else { + /* Skip the FS input register, leave it uninitialized. */ + /* If we try to set it to (0,0,0,1), it will lock up. */ + if (fs_inputs->wpos != ATTR_UNUSED) { + fp_offset++; + } + } + /* Rasterize at least one color, or bad things happen. */ if (col_count == 0 && tex_count == 0) { rX00_rs_col(rs, 0, 0, TRUE); |