aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/r300_render.c
diff options
context:
space:
mode:
authorOliver McFadden <[email protected]>2007-05-27 23:19:30 +0000
committerOliver McFadden <[email protected]>2007-05-30 03:19:26 +0000
commit7c893e98a30114059cd69873413a136ba2be768b (patch)
treefb48d237d27bdf18f9034f18020287ad90e6d446 /src/mesa/drivers/dri/r300/r300_render.c
parentb8813572ae8dc4ec75122945088e40382e2826bf (diff)
r300: Cleaned up the AOS code in r300_render.c.
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_render.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c35
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,