r300: Document registers 0x2220 to 0x2230.
authorOliver McFadden <z3ro.geek@gmail.com>
Mon, 28 May 2007 01:11:54 +0000 (01:11 +0000)
committerOliver McFadden <z3ro.geek@gmail.com>
Wed, 30 May 2007 03:19:26 +0000 (03:19 +0000)
These registers are per-pixel and per-vertex X and Y clipping planes.

src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_reg.h
src/mesa/drivers/dri/r300/r300_state.c

index 0351989b2e4f5e2253f50986385c605f8c98317e..0bc3be8880c83826d4fcc40878926b5b6d450f08 100644 (file)
@@ -318,8 +318,8 @@ void r300InitCmdBuf(r300ContextPtr r300)
        r300->hw.unk21DC.cmd[0] = cmdpacket0(0x21DC, 1);
        ALLOC_STATE(unk221C, always, 2, 0);
        r300->hw.unk221C.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_221C, 1);
-       ALLOC_STATE(unk2220, always, 5, 0);
-       r300->hw.unk2220.cmd[0] = cmdpacket0(0x2220, 4);
+       ALLOC_STATE(vap_clip, always, 5, 0);
+       r300->hw.vap_clip.cmd[0] = cmdpacket0(R300_VAP_CLIP_X_0, 4);
        ALLOC_STATE(unk2288, always, 2, 0);
        r300->hw.unk2288.cmd[0] = cmdpacket0(R300_VAP_UNKNOWN_2288, 1);
        ALLOC_STATE(vof, always, R300_VOF_CMDSIZE, 0);
index 6bd74fe9cd8701b9e0c363d6f889e37db79d03a1..076bb49a006e194dda3e4eb15c2bd3171ff2eaee 100644 (file)
@@ -452,7 +452,7 @@ struct r300_hw_state {
        struct r300_state_atom vic;     /* vap input control (2180) */
        struct r300_state_atom unk21DC; /* (21DC) */
        struct r300_state_atom unk221C; /* (221C) */
-       struct r300_state_atom unk2220; /* (2220) */
+       struct r300_state_atom vap_clip;
        struct r300_state_atom unk2288; /* (2288) */
        struct r300_state_atom pvs;     /* pvs_cntl (22D0) */
        struct r300_state_atom gb_enable;       /* (4008) */
index 3f14dafc70a68cacdad0ef4861dfb61001eb4b25..6f0ed4d74eeec65a15dc19be9d4dd8baa10109b6 100644 (file)
@@ -299,6 +299,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #       define R300_221C_NORMAL                  0x00000000
 #       define R300_221C_CLEAR                   0x0001C000
 
+/* These seem to be per-pixel and per-vertex X and Y clipping planes. The first
+ * plane is per-pixel and the second plane is per-vertex.
+ *
+ * This was determined by experimentation alone but I believe it is correct.
+ */
+#define R300_VAP_CLIP_X_0                   0x2220
+#define R300_VAP_CLIP_X_1                   0x2224
+#define R300_VAP_CLIP_Y_0                   0x2228
+#define R300_VAP_CLIP_Y_1                   0x2230
+
 /* gap */
 
 /* Sometimes, END_OF_PKT and 0x2284=0 are the only commands sent between
index a9b20622e4c87a958c3434fa3ed88ddfe5cf775a..38cf9d29a73eb377b2c42985dfba65a842562ef9 100644 (file)
@@ -1882,10 +1882,10 @@ static void r300ResetHwState(r300ContextPtr r300)
 
        r300->hw.unk221C.cmd[1] = R300_221C_NORMAL;
 
-       r300->hw.unk2220.cmd[1] = r300PackFloat32(1.0);
-       r300->hw.unk2220.cmd[2] = r300PackFloat32(1.0);
-       r300->hw.unk2220.cmd[3] = r300PackFloat32(1.0);
-       r300->hw.unk2220.cmd[4] = r300PackFloat32(1.0);
+       r300->hw.vap_clip.cmd[1] = r300PackFloat32(1.0); /* X */
+       r300->hw.vap_clip.cmd[2] = r300PackFloat32(1.0); /* X */
+       r300->hw.vap_clip.cmd[3] = r300PackFloat32(1.0); /* Y */
+       r300->hw.vap_clip.cmd[4] = r300PackFloat32(1.0); /* Y */
 
        /* XXX: Other families? */
        switch (r300->radeon.radeonScreen->chip_family) {