r300: Moved some more of the emit code into r300_render.c.
authorOliver McFadden <z3ro.geek@gmail.com>
Thu, 10 May 2007 17:45:27 +0000 (17:45 +0000)
committerOliver McFadden <z3ro.geek@gmail.com>
Thu, 10 May 2007 19:24:16 +0000 (19:24 +0000)
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_cmdbuf.h
src/mesa/drivers/dri/r300/r300_emit.h
src/mesa/drivers/dri/r300/r300_render.c

index 48f5ea4c562246452fb87e89aeef39e7ec384c82..1aacf69a0aa1b12de1e33dd903da3cd8bbba2f1a 100644 (file)
@@ -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);
-       }
-}
index 3c336e1589b15981ef6771d47ffb3fd94485b266..bfb2eda26feb21891c4683bb8084afd40e664c0b 100644 (file)
@@ -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.
index bccb84933ad5d373009e54886acbecc0ed5c420b..b8242ad41e26fb5efb7129130769f4e90cf017d4 100644 (file)
@@ -227,20 +227,6 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags)
        cmd[0].i = cmdwait(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
  */
index a118dab7401ef65e45a6d74947eb35dd3408d2f0..a5d8afd94cf9428083323141d8b52f70233519cc 100644 (file)
@@ -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);
        }