diff options
author | Luca Barbieri <[email protected]> | 2010-02-22 13:15:24 +0100 |
---|---|---|
committer | Younes Manton <[email protected]> | 2010-03-15 00:03:04 -0400 |
commit | ac7ae8bc6ae0d364103d655482a522c12504816b (patch) | |
tree | c4e6ac6053c35b184484608038a6314173a384d1 /src/gallium | |
parent | ad2d0c26393760ebc7af52de9f693654381431f3 (diff) |
nvfx: draw: make perspective corrective texturing work
We must divide everything in the position by w, and emit position as
a 4-component vector.
Not sure why we must divide, but it works (see progs/redbook/checker).
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/nvfx/nvfx_draw.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_draw.c b/src/gallium/drivers/nvfx/nvfx_draw.c index 494d5435d63..4e0575885d5 100644 --- a/src/gallium/drivers/nvfx/nvfx_draw.c +++ b/src/gallium/drivers/nvfx/nvfx_draw.c @@ -67,6 +67,13 @@ nvfx_render_vertex(struct nvfx_context *nvfx, const struct vertex_header *v) OUT_RING (chan, fui(v->data[idx][2])); OUT_RING (chan, fui(v->data[idx][3])); break; + case 0xff: + BEGIN_RING(chan, eng3d, NV34TCL_VTX_ATTR_4F_X(hw), 4); + OUT_RING (chan, fui(v->data[idx][0] / v->data[idx][3])); + OUT_RING (chan, fui(v->data[idx][1] / v->data[idx][3])); + OUT_RING (chan, fui(v->data[idx][2] / v->data[idx][3])); + OUT_RING (chan, fui(1.0f / v->data[idx][3])); + break; case EMIT_4UB: BEGIN_RING(chan, eng3d, NV34TCL_VTX_ATTR_4UB(hw), 1); OUT_RING (chan, pack_ub4(float_to_ubyte(v->data[idx][0]), @@ -330,7 +337,7 @@ nvfx_state_vtxfmt_validate(struct nvfx_context *nvfx) emit_attrib(nvfx, 5, EMIT_1F, TGSI_SEMANTIC_FOG, 0); } - emit_attrib(nvfx, 0, EMIT_3F, TGSI_SEMANTIC_POSITION, 0); + emit_attrib(nvfx, 0, 0xff, TGSI_SEMANTIC_POSITION, 0); return FALSE; } |