[r300] Add RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD and some HyperZ defintions
authorChristoph Brill <egore911@egore911.de>
Mon, 25 Feb 2008 19:15:20 +0000 (20:15 +0100)
committerChristoph Brill <egore911@egore911.de>
Mon, 25 Feb 2008 19:15:20 +0000 (20:15 +0100)
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_reg.h

index ea199115d5110d2c3677a1fa61a3e4f25d3a5dd0..657a00b064008199dea66f0956a5a0563de53a2f 100644 (file)
@@ -423,7 +423,7 @@ void r300InitCmdBuf(r300ContextPtr r300)
        ALLOC_STATE(unk4E88, always, 2, 0);
        r300->hw.unk4E88.cmd[0] = cmdpacket0(R300_RB3D_AARESOLVE_CTL, R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_RESOLVE);
        ALLOC_STATE(unk4EA0, always, 3, 0);
-       r300->hw.unk4EA0.cmd[0] = cmdpacket0(0x4EA0, 2);
+       r300->hw.unk4EA0.cmd[0] = cmdpacket0(RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 2);
        ALLOC_STATE(zs, always, R300_ZS_CMDSIZE, 0);
        r300->hw.zs.cmd[R300_ZS_CMD_0] =
            cmdpacket0(R300_RB3D_ZSTENCIL_CNTL_0, 3);
@@ -433,13 +433,13 @@ void r300InitCmdBuf(r300ContextPtr r300)
        ALLOC_STATE(zb, always, R300_ZB_CMDSIZE, 0);
        r300->hw.zb.cmd[R300_ZB_CMD_0] = cmdpacket0(R300_RB3D_DEPTHOFFSET, 2);
        ALLOC_STATE(unk4F28, always, 2, 0);
-       r300->hw.unk4F28.cmd[0] = cmdpacket0(0x4F28, 1);
+       r300->hw.unk4F28.cmd[0] = cmdpacket0(ZB_DEPTHCLEARVALUE, 1);
        ALLOC_STATE(unk4F30, always, 3, 0);
        r300->hw.unk4F30.cmd[0] = cmdpacket0(0x4F30, 2);
        ALLOC_STATE(unk4F44, always, 2, 0);
-       r300->hw.unk4F44.cmd[0] = cmdpacket0(0x4F44, 1);
+       r300->hw.unk4F44.cmd[0] = cmdpacket0(ZB_HIZ_OFFSET, 1);
        ALLOC_STATE(unk4F54, always, 2, 0);
-       r300->hw.unk4F54.cmd[0] = cmdpacket0(0x4F54, 1);
+       r300->hw.unk4F54.cmd[0] = cmdpacket0(ZB_HIZ_PITCH, 1);
 
        /* VPU only on TCL */
        if (has_tcl) {
index 45bd709deb6e0fcb1d7721456ef4c9cde5658d30..80c2816d83dd7435c6f9c82401e4f36e8af7d8f8 100644 (file)
@@ -1621,6 +1621,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #      define R300_RB3D_DITHER_CTL_ALPHA_DITHER_MODE_LUT        (2 << 2)
 /* reserved */
 
+/* Resolve Buffer Control. Unpipelined */
 #define R300_RB3D_AARESOLVE_CTL           0x4e88
 #      define R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_NORMAL   (0 << 0)
 #      define R300_RB3D_AARESOLVE_CTL_AARESOLVE_MODE_RESOLVE  (1 << 0)
@@ -1629,6 +1630,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #      define R300_RB3D_AARESOLVE_CTL_AARESOLVE_ALPHA_SAMPLE0 (0 << 2)
 #      define R300_RB3D_AARESOLVE_CTL_AARESOLVE_ALPHA_AVERAGE (1 << 2)
 
+/* Discard src pixels less than or equal to threshold. */
+#define RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD 0x4ea0
+/* TODO: add shift and mask for this one */
+
+
 /* gap */
 /* There seems to be no "write only" setting, so use Z-test = ALWAYS
  * for this.
@@ -1755,6 +1761,21 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #       define R300_DEPTH_ENDIAN_WORD_SWAP       (1 << 18) /* GUESS */
 #       define R300_DEPTH_ENDIAN_DWORD_SWAP      (2 << 18) /* GUESS */
 
+/* Z Buffer Clear Value */
+#define ZB_DEPTHCLEARVALUE                  0x4f28
+
+/* Hierarchical Z Memory Offset */
+#define ZB_HIZ_OFFSET                       0x4f44
+
+/* Hierarchical Z Read Index */
+#define ZB_HIZ_RDINDEX                      0x4f48
+
+/* Hierarchical Z Write Index */
+#define ZB_HIZ_WRINDEX                      0x4f50
+
+/* Hierarchical Z Pitch */
+#define ZB_HIZ_PITCH                        0x4f54
+
 /* BEGIN: Vertex program instruction set */
 
 /* Every instruction is four dwords long: