From 9b727e117e26ef6e5a410bc1e2ad9d33e54603eb Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 23:02:57 +0000 Subject: r300: Cleaned up t_vir0 and t_vir1 slightly. --- src/mesa/drivers/dri/r300/r300_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/r300/r300_context.h') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 01caa61766..4bc73dc862 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -785,7 +785,7 @@ struct r300_fragment_program { #define AOS_FORMAT_USHORT 0 #define AOS_FORMAT_FLOAT 1 -#define AOS_FORMAT_UBYTE 2 +#define AOS_FORMAT_UNSIGNED_BYTE 2 #define AOS_FORMAT_FLOAT_COLOR 3 #define REG_COORDS 0 -- cgit v1.2.3 From e96d10a86179242c349138224e61e2ac2e8eac9a Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 19:39:35 +0000 Subject: r300: Removed unused aos_reg variable. --- src/mesa/drivers/dri/r300/r300_context.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa/drivers/dri/r300/r300_context.h') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 4bc73dc862..781277dfda 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -149,7 +149,6 @@ struct r300_dma_region { int aos_offset; /* address in GART memory */ int aos_stride; /* distance between elements, in dwords */ int aos_size; /* number of components (1-4) */ - int aos_reg; /* VAP register assignment */ }; struct r300_dma { -- cgit v1.2.3 From 3b8fc727e611143e35725d987efd1d342893c8a1 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 26 May 2007 20:59:16 +0000 Subject: r300: Removed duplicate AOS format defines; already defined in r300_reg.h. --- src/mesa/drivers/dri/r300/r300_context.h | 5 ----- src/mesa/drivers/dri/r300/r300_emit.c | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_context.h') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 781277dfda..9aa61a466a 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -782,11 +782,6 @@ struct r300_fragment_program { #define R300_MAX_AOS_ARRAYS 16 -#define AOS_FORMAT_USHORT 0 -#define AOS_FORMAT_FLOAT 1 -#define AOS_FORMAT_UNSIGNED_BYTE 2 -#define AOS_FORMAT_FLOAT_COLOR 3 - #define REG_COORDS 0 #define REG_COLOR0 1 #define REG_TEX0 2 diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index a59b7ac5ad..f42bcd9e45 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -214,8 +214,8 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, /* dw: size, inputs, stop bit, type */ for (i = 0; i + 1 < nr; i += 2) { - dw = (attribptr[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | (AOS_FORMAT_FLOAT << 14); - dw |= ((attribptr[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | (AOS_FORMAT_FLOAT << 14)) << 16; + dw = (attribptr[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | R300_INPUT_ROUTE_FLOAT; + dw |= ((attribptr[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | R300_INPUT_ROUTE_FLOAT) << 16; if (i + 2 == nr) { dw |= (1 << (13 + 16)); } @@ -223,7 +223,7 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr, } if (nr & 1) { - dw = (attribptr[tab[nr - 1]]->size - 1) | (inputs[tab[nr - 1]] << 8) | (AOS_FORMAT_FLOAT << 14); + dw = (attribptr[tab[nr - 1]]->size - 1) | (inputs[tab[nr - 1]] << 8) | R300_INPUT_ROUTE_FLOAT; dw |= 1 << 13; dst[nr >> 1] = dw; } -- cgit v1.2.3 From 3e5f8a6c894b7e818443ac08dada65e57610fa69 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sun, 27 May 2007 23:35:12 +0000 Subject: r300: Removed the (completely broken since new VBO branch) OPTIMIZE_ELTS path. The VTXFMT code was broken by the new VBO branch and the OPTIMIZE_ELTS path relied on the VTXFMT code... I'm not even sure if the OPTIMIZE_ELTS path ever worked; the testing that I did after minimizing the code duplication would have taken the same path as the non-OPTIMIZE_ELTS code. --- src/mesa/drivers/dri/r300/r300_context.h | 2 -- src/mesa/drivers/dri/r300/r300_render.c | 20 -------------------- 2 files changed, 22 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_context.h') diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 9aa61a466a..6bd74fe9cd 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -49,8 +49,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define USER_BUFFERS -//#define OPTIMIZE_ELTS - struct r300_context; typedef struct r300_context r300ContextRec; typedef struct r300_context *r300ContextPtr; diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 1a7ebc91a5..0c5750de87 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -205,8 +205,6 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, int cmd_reserved = 0; int cmd_written = 0; drm_radeon_cmd_header_t *cmd = NULL; - unsigned long t_addr; - unsigned long magic_1, magic_2; assert(elt_size == 2 || elt_size == 4); @@ -215,10 +213,6 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, return; } - magic_1 = (addr % 32) / 4; - t_addr = addr & ~0x1d; - magic_2 = (vertex_count + 1 + (t_addr & 0x2)) / 2 + magic_1; - start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, 0); if (elt_size == 4) { e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); @@ -227,27 +221,13 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, } start_packet3(RADEON_CP_PACKET3_INDX_BUFFER, 2); -#ifdef OPTIMIZE_ELTS - if (elt_size == 4) { - e32(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2); - e32(addr); - } else { - e32(R300_EB_UNK1 | (magic_1 << 16) | R300_EB_UNK2); - e32(t_addr); - } -#else e32(R300_EB_UNK1 | (0 << 16) | R300_EB_UNK2); e32(addr); -#endif if (elt_size == 4) { e32(vertex_count); } else { -#ifdef OPTIMIZE_ELTS - e32(magic_2); -#else e32((vertex_count + 1) / 2); -#endif } } -- cgit v1.2.3 From 97a89227b0edd3ef51d3ef9fd015bff12dc9b97b Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Mon, 28 May 2007 01:11:54 +0000 Subject: r300: Document registers 0x2220 to 0x2230. These registers are per-pixel and per-vertex X and Y clipping planes. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 4 ++-- src/mesa/drivers/dri/r300/r300_context.h | 2 +- src/mesa/drivers/dri/r300/r300_reg.h | 10 ++++++++++ src/mesa/drivers/dri/r300/r300_state.c | 8 ++++---- 4 files changed, 17 insertions(+), 7 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_context.h') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 0351989b2e..0bc3be8880 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -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); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 6bd74fe9cd..076bb49a00 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -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) */ diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 3f14dafc70..6f0ed4d74e 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -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 diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index a9b20622e4..38cf9d29a7 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -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) { -- cgit v1.2.3