From 7b861b9b9efdb3ac0dfc3806afcd494cd0ea006c Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Tue, 7 Jul 2009 12:48:50 -0700 Subject: gallium: fixup register indexes for fog/frontface/point coord --- src/mesa/state_tracker/st_atom_shader.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index 299aa762c2..5219119c81 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -142,9 +142,18 @@ find_translated_vp(struct st_context *st, if ((fragInputsRead & FRAG_BIT_FOGC)) { /* leave placeholders for the * extra registers we extract from fog */ - if (stfp->Base.UsesFrontFacing || - stfp->Base.UsesPointCoord) { - numIn += 2; + if (stfp->Base.UsesFrontFacing) { + if (!stfp->Base.UsesFogFragCoord) + --stfp->input_to_slot[inAttr]; + else + ++numIn; + } + if (stfp->Base.UsesPointCoord) { + if (!stfp->Base.UsesFrontFacing && + !stfp->Base.UsesFogFragCoord) + stfp->input_to_slot[inAttr] -= 2; + else + ++numIn; } } } -- cgit v1.2.3