diff options
author | Oliver McFadden <[email protected]> | 2007-05-27 23:19:30 +0000 |
---|---|---|
committer | Oliver McFadden <[email protected]> | 2007-05-30 03:19:26 +0000 |
commit | 7c893e98a30114059cd69873413a136ba2be768b (patch) | |
tree | fb48d237d27bdf18f9034f18020287ad90e6d446 /src | |
parent | b8813572ae8dc4ec75122945088e40382e2826bf (diff) |
r300: Cleaned up the AOS code in r300_render.c.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_render.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 143fe9fd35d..1a7ebc91a5f 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -221,12 +221,9 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr, 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); + e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); } else { - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | - (vertex_count << 16) | type); + e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (vertex_count << 16) | type); } start_packet3(RADEON_CP_PACKET3_INDX_BUFFER, 2); @@ -268,24 +265,21 @@ static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset) start_packet3(RADEON_CP_PACKET3_3D_LOAD_VBPNTR, sz - 1); e32(nr); + for (i = 0; i + 1 < nr; i += 2) { - e32((rmesa->state.aos[i].aos_size << 0) - | (rmesa->state.aos[i].aos_stride << 8) - | (rmesa->state.aos[i + 1].aos_size << 16) - | (rmesa->state.aos[i + 1].aos_stride << 24) - ); - e32(rmesa->state.aos[i].aos_offset + - offset * 4 * rmesa->state.aos[i].aos_stride); - e32(rmesa->state.aos[i + 1].aos_offset + - offset * 4 * rmesa->state.aos[i + 1].aos_stride); + e32((rmesa->state.aos[i].aos_size << 0) | + (rmesa->state.aos[i].aos_stride << 8) | + (rmesa->state.aos[i + 1].aos_size << 16) | + (rmesa->state.aos[i + 1].aos_stride << 24)); + + e32(rmesa->state.aos[i].aos_offset + offset * 4 * rmesa->state.aos[i].aos_stride); + e32(rmesa->state.aos[i + 1].aos_offset + offset * 4 * rmesa->state.aos[i + 1].aos_stride); } if (nr & 1) { - e32((rmesa->state.aos[nr - 1].aos_size << 0) - | (rmesa->state.aos[nr - 1].aos_stride << 8) - ); - e32(rmesa->state.aos[nr - 1].aos_offset + - offset * 4 * rmesa->state.aos[nr - 1].aos_stride); + e32((rmesa->state.aos[nr - 1].aos_size << 0) | + (rmesa->state.aos[nr - 1].aos_stride << 8)); + e32(rmesa->state.aos[nr - 1].aos_offset + offset * 4 * rmesa->state.aos[nr - 1].aos_stride); } } @@ -296,8 +290,7 @@ static void r300FireAOS(r300ContextPtr rmesa, int vertex_count, int type) drm_radeon_cmd_header_t *cmd = NULL; start_packet3(RADEON_CP_PACKET3_3D_DRAW_VBUF_2, 0); - e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count << 16) - | type); + e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count << 16) | type); } static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx, |