summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver McFadden <z3ro.geek@gmail.com>2007-05-10 17:45:27 +0000
committerOliver McFadden <z3ro.geek@gmail.com>2007-05-10 19:24:16 +0000
commite856edb2794cba9d321486f602a9e07b917ce949 (patch)
tree16fb04bf8a02df2cd8c5b78de909f731cbd3aaf0
parent58239d2ae31b12c11055ca3cd0799803670b0b88 (diff)
r300: Moved some more of the emit code into r300_render.c.
-rw-r--r--src/mesa/drivers/dri/r300/r300_cmdbuf.c35
-rw-r--r--src/mesa/drivers/dri/r300/r300_cmdbuf.h2
-rw-r--r--src/mesa/drivers/dri/r300/r300_emit.h14
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c51
4 files changed, 48 insertions, 54 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
index 48f5ea4c56..1aacf69a0a 100644
--- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c
+++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
@@ -659,38 +659,3 @@ void r300EmitWait(r300ContextPtr rmesa, GLuint flags)
cmd[0].wait.cmd_type = R300_CMD_WAIT;
cmd[0].wait.flags = flags;
}
-
-void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset)
-{
- int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2;
- int i;
- int cmd_reserved = 0;
- int cmd_written = 0;
- drm_radeon_cmd_header_t *cmd = NULL;
-
- if (RADEON_DEBUG & DEBUG_VERTS)
- fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __func__, nr,
- 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);
- }
-
- 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);
- }
-}
diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h
index 3c336e1589..bfb2eda26f 100644
--- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h
+++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h
@@ -46,8 +46,6 @@ extern void r300EmitState(r300ContextPtr r300);
extern void r300InitCmdBuf(r300ContextPtr r300);
extern void r300DestroyCmdBuf(r300ContextPtr r300);
-extern void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset);
-
/**
* Make sure that enough space is available in the command buffer
* by flushing if necessary.
diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h
index bccb84933a..b8242ad41e 100644
--- a/src/mesa/drivers/dri/r300/r300_emit.h
+++ b/src/mesa/drivers/dri/r300/r300_emit.h
@@ -228,20 +228,6 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags)
}
/**
- * fire vertex buffer
- */
-static void inline fire_AOS(r300ContextPtr rmesa, int vertex_count, int type)
-{
- int cmd_reserved = 0;
- int cmd_written = 0;
- 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);
-}
-
-/**
* These are followed by the corresponding data
*/
#define start_index32_packet(vertex_count, type) \
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index a118dab740..a5d8afd94c 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -190,8 +190,8 @@ static int r300NumVerts(r300ContextPtr rmesa, int num_verts, int prim)
return num_verts - verts_off;
}
-static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr,
- int vertex_count, int type, int elt_size)
+static void r300FireEB(r300ContextPtr rmesa, unsigned long addr,
+ int vertex_count, int type, int elt_size)
{
int cmd_reserved = 0;
int cmd_written = 0;
@@ -245,6 +245,52 @@ static void inline r300FireEB(r300ContextPtr rmesa, unsigned long addr,
}
}
+static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset)
+{
+ int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2;
+ int i;
+ int cmd_reserved = 0;
+ int cmd_written = 0;
+ drm_radeon_cmd_header_t *cmd = NULL;
+
+ if (RADEON_DEBUG & DEBUG_VERTS)
+ fprintf(stderr, "%s: nr=%d, ofs=0x%08x\n", __func__, nr,
+ 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);
+ }
+
+ 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);
+ }
+}
+
+static void fire_AOS(r300ContextPtr rmesa, int vertex_count, int type)
+{
+ int cmd_reserved = 0;
+ int cmd_written = 0;
+ 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);
+}
+
static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx,
int start, int end, int prim)
{
@@ -355,7 +401,6 @@ static GLboolean r300RunRender(GLcontext * ctx,
for (i = 0; i < VB->PrimitiveCount; i++) {
GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
GLuint start = VB->Primitive[i].start;
- GLuint length = VB->Primitive[i].count;
GLuint end = VB->Primitive[i].start + VB->Primitive[i].count;
r300RunRenderPrimitive(rmesa, ctx, start, end, prim);
}