On czwartek, 19 lutego 2009 03:00:52 Markus Amsler wrote:
> Maciej Cencora wrote:
> > I'm sending updated patches. Updates:
> > - trailing whitespaces are cleaned up,
> > - multiply cmdpackets per state atom are correctly handled,
> > - W pos and fogcoord attributes are pushed in correct order in hw tcl
> > path (testing needed),
> > - added Nicolai's regression fix (combined with fix for non tcl hw),
> > - added few comments in commit log,
> > - out of texcoord case is handled now in hw tcl path.
> >
> > Nicolai Haehnle wrote:
> >> By the way, have you considered stuffing wpos and fogcoord in the same
> >> register if both are needed? I'm just curious - if this is impossible
> >> for some reason or requires significantly more changes to the code, just
> >> forget about it. It's an optimization anyway, and it's more important to
> >> get things to work correctly in the first place.
> >
> > I don't know if it's worth the effort. I'll certainly look into it when
> > someone finds an app which uses all free texcoords.
> >
> > Markus Amsler wrote:
> >> I tested it on r300/r500 with WoW:
> >> after 0004 i get gpu lockups but 0005 fixes the lockups. After 0006 part
> >> of the ingame screen is black. That's a regression from
> >> newest_fog_w5.patch, with w5 the game looks fine.
> >
> > patches 7 and 8 should fix the regression
> >
> > Thank you both for testing.
> >
> > Maciej
>
> retested on r500:
> patch 7 fixes the regression introduced in patch 6. With patch 8
> demos/arbfplight looks wrong, and I also get lockups in Wow.
>
> Markus

Could you try updated patch?

Maciej
From b201bde0ddde1021a1caf73c68558f7137fbf391 Mon Sep 17 00:00:00 2001
From: Maciej Cencora <[email protected]>
Date: Wed, 18 Feb 2009 12:16:01 +0100
Subject: [PATCH] r300: route W pos and fogcoord attributes in correct order for hw tcl path

Currently RS setup requires attributes in following order:
- colors
- texcoords
- fogcoord
- W pos

Software TCL path is correct.
---
 src/mesa/drivers/dri/r300/r300_vertprog.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c
index b6a4d30..17c7995 100644
--- a/src/mesa/drivers/dri/r300/r300_vertprog.c
+++ b/src/mesa/drivers/dri/r300/r300_vertprog.c
@@ -999,10 +999,6 @@ static void t_inputs_outputs(struct r300_vertex_program *vp)
 			vp->outputs[i] = cur_reg++;
 		}
 	}
-
-	if (vp->key.OutputsWritten & (1 << VERT_RESULT_FOGC)) {
-		vp->outputs[VERT_RESULT_FOGC] = cur_reg++;
-	}
 }
 
 static void r300TranslateVertexShader(struct r300_vertex_program *vp,
@@ -1430,13 +1426,27 @@ void r300SelectVertexShader(r300ContextPtr r300)
 	InputsRead = ctx->FragmentProgram._Current->Base.InputsRead;
 
 	wpos_idx = -1;
+
+	if ((InputsRead & FRAG_BIT_FOGC) || (wanted_key.OutputsWritten & VERT_RESULT_FOGC)) {
+		for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+			if (!(InputsRead & (FRAG_BIT_TEX0 << i)))
+				break;
+
+		if (i == ctx->Const.MaxTextureUnits) {
+			fprintf(stderr, "\tno free texcoord found for fogcoord attribute\n");
+			_mesa_exit(-1);
+		}
+
+		wanted_key.OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i);
+	}
+
 	if (InputsRead & FRAG_BIT_WPOS) {
 		for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
 			if (!(InputsRead & (FRAG_BIT_TEX0 << i)))
 				break;
 
 		if (i == ctx->Const.MaxTextureUnits) {
-			fprintf(stderr, "\tno free texcoord found\n");
+			fprintf(stderr, "\tno free texcoord found for W pos attribute\n");
 			_mesa_exit(-1);
 		}
 
-- 
1.5.6.3

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to