summaryrefslogtreecommitdiff
path: root/src/mesa/main/ffvertex_prog.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-04-12 15:40:29 +1000
committerDave Airlie <airlied@redhat.com>2010-04-13 09:19:39 +1000
commit911fa4a4a16e7cb099107ecf79d9ed8f63139236 (patch)
tree7b4dd698720f703bf97574cf02ef576807c6b611 /src/mesa/main/ffvertex_prog.c
parent745c4b568573fd5353e0f790251af64098742b1a (diff)
ffvertex: don't touch tex coords if coord replace is enabled.
The fixed function vertex program shouldn't need to deal or touch tex coords if stuffing is enabled. Though I'm not 100% this won't break assumption made elsewhere it seems like the correct thing to do, and makes r300g point sprites a lot easier to implement. draw: fix point-sprite when vertex program is used. This commit regressed draw, so fix it as well to help bisection. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/mesa/main/ffvertex_prog.c')
-rw-r--r--src/mesa/main/ffvertex_prog.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index ba94a38770..70ac47f36d 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -75,6 +75,7 @@ struct state_key {
unsigned light_attenuated:1;
unsigned texunit_really_enabled:1;
unsigned texmat_enabled:1;
+ unsigned coord_replace:1;
unsigned texgen_enabled:4;
unsigned texgen_mode0:4;
unsigned texgen_mode1:4;
@@ -225,6 +226,10 @@ static void make_state_key( GLcontext *ctx, struct state_key *key )
if (texUnit->_ReallyEnabled)
key->unit[i].texunit_really_enabled = 1;
+ if (ctx->Point.PointSprite)
+ if (ctx->Point.CoordReplace[i])
+ key->unit[i].coord_replace = 1;
+
if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i))
key->unit[i].texmat_enabled = 1;
@@ -1385,6 +1390,9 @@ static void build_texture_transform( struct tnl_program *p )
if (!(p->state->fragprog_inputs_read & FRAG_BIT_TEX(i)))
continue;
+ if (p->state->unit[i].coord_replace)
+ continue;
+
if (p->state->unit[i].texgen_enabled ||
p->state->unit[i].texmat_enabled) {