Attached is a mini-patch to add the address of early Z to r300_reg.h and
use it.
Jerome Glisse helped me with this patch. Thanks. :-)
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h
index 9f636ec..5dfd1fb 100644
--- a/src/mesa/drivers/dri/r300/r300_reg.h
+++ b/src/mesa/drivers/dri/r300/r300_reg.h
@@ -1378,6 +1378,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 	/* 16 bit format or some aditional bit ? */
 #	define R300_DEPTH_FORMAT_UNK32          (32 << 0)
 
+#define R300_RB3D_EARLY_Z                           0x4F14
+#	define R300_EARLY_Z_DISABLE              0
+#	define R300_EARLY_Z_ENABLE               1
+
 /* gap */
 
 #define R300_RB3D_DEPTHOFFSET               0x4F20
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index b30ece1..0e33e51 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -328,24 +328,24 @@ static void r300UpdateCulling(GLcontext* ctx)
 
 static void update_early_z(GLcontext *ctx)
 {
-	/* updates register 0x4f14 
-	   if depth test is not enabled it should be 0x00000000
-	   if depth is enabled and alpha not it should be 0x00000001
-	   if depth and alpha is enabled it should be 0x00000000
+	/* updates register R300_RB3D_EARLY_Z (0x4F14)
+	   if depth test is not enabled it should be R300_EARLY_Z_DISABLE
+	   if depth is enabled and alpha not it should be R300_EARLY_Z_ENABLE
+	   if depth and alpha is enabled it should be R300_EARLY_Z_DISABLE
 	*/
 	r300ContextPtr r300 = R300_CONTEXT(ctx);
 
 	R300_STATECHANGE(r300, unk4F10);
 	if (ctx->Color.AlphaEnabled && ctx->Color.AlphaFunc != GL_ALWAYS)
 		/* disable early Z */
-		r300->hw.unk4F10.cmd[2] = 0x00000000;
+		r300->hw.unk4F10.cmd[2] = R300_EARLY_Z_DISABLE;
 	else {
 		if (ctx->Depth.Test && ctx->Depth.Func != GL_NEVER)
 			/* enable early Z */
-			r300->hw.unk4F10.cmd[2] = 0x00000001;
+			r300->hw.unk4F10.cmd[2] = R300_EARLY_Z_ENABLE;
 		else
 			/* disable early Z */
-			r300->hw.unk4F10.cmd[2] = 0x00000000;
+			r300->hw.unk4F10.cmd[2] = R300_EARLY_Z_DISABLE;
 	}
 }
 
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to