r300: Moved some more emit code into r300_render.c.
authorOliver McFadden <z3ro.geek@gmail.com>
Thu, 10 May 2007 17:50:25 +0000 (17:50 +0000)
committerOliver McFadden <z3ro.geek@gmail.com>
Thu, 10 May 2007 19:24:16 +0000 (19:24 +0000)
src/mesa/drivers/dri/r300/r300_maos.c
src/mesa/drivers/dri/r300/r300_render.c

index ec174441e99e505ace7a32490f7334b024b65eed..9e07445b1d4b67a34d30e35d282119ddd1f24505 100644 (file)
@@ -223,35 +223,6 @@ static void emit_vector(GLcontext * ctx,
 
 }
 
-void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts,
-                 int elt_size)
-{
-       r300ContextPtr rmesa = R300_CONTEXT(ctx);
-       struct r300_dma_region *rvb = &rmesa->state.elt_dma;
-       void *out;
-
-       assert(elt_size == 2 || elt_size == 4);
-
-       if (r300IsGartMemory(rmesa, elts, n_elts * elt_size)) {
-               rvb->address = rmesa->radeon.radeonScreen->gartTextures.map;
-               rvb->start = ((char *)elts) - rvb->address;
-               rvb->aos_offset =
-                   rmesa->radeon.radeonScreen->gart_texture_offset +
-                   rvb->start;
-
-               return;
-       } else if (r300IsGartMemory(rmesa, elts, 1)) {
-               WARN_ONCE("Pointer not within GART memory!\n");
-               _mesa_exit(-1);
-       }
-
-       r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size);
-       rvb->aos_offset = GET_START(rvb);
-
-       out = rvb->address + rvb->start;
-       memcpy(out, elts, n_elts * elt_size);
-}
-
 static GLuint t_type(struct dt *dt)
 {
        switch (dt->type) {
index a5d8afd94cf9428083323141d8b52f70233519cc..5a00ed7f8e86e03a76da858a36f738fb930c8d16 100644 (file)
@@ -245,6 +245,36 @@ static void r300FireEB(r300ContextPtr rmesa, unsigned long addr,
        }
 }
 
+static void r300EmitElts(GLcontext * ctx, void *elts, unsigned long n_elts,
+                 int elt_size)
+{
+       r300ContextPtr rmesa = R300_CONTEXT(ctx);
+       struct r300_dma_region *rvb = &rmesa->state.elt_dma;
+       void *out;
+
+       assert(elt_size == 2 || elt_size == 4);
+
+       if (r300IsGartMemory(rmesa, elts, n_elts * elt_size)) {
+               rvb->address = rmesa->radeon.radeonScreen->gartTextures.map;
+               rvb->start = ((char *)elts) - rvb->address;
+               rvb->aos_offset =
+                   rmesa->radeon.radeonScreen->gart_texture_offset +
+                   rvb->start;
+
+               return;
+       } else if (r300IsGartMemory(rmesa, elts, 1)) {
+               WARN_ONCE("Pointer not within GART memory!\n");
+               _mesa_exit(-1);
+       }
+
+       r300AllocDmaRegion(rmesa, rvb, n_elts * elt_size, elt_size);
+       rvb->aos_offset = GET_START(rvb);
+
+       out = rvb->address + rvb->start;
+       memcpy(out, elts, n_elts * elt_size);
+}
+
+
 static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset)
 {
        int sz = 1 + (nr >> 1) * 3 + (nr & 1) * 2;
@@ -280,7 +310,7 @@ static void r300EmitAOS(r300ContextPtr rmesa, GLuint nr, GLuint offset)
        }
 }
 
-static void fire_AOS(r300ContextPtr rmesa, int vertex_count, int type)
+static void r300FireAOS(r300ContextPtr rmesa, int vertex_count, int type)
 {
        int cmd_reserved = 0;
        int cmd_written = 0;
@@ -315,7 +345,7 @@ static void r300RunRenderPrimitive(r300ContextPtr rmesa, GLcontext * ctx,
                           num_verts, type, rmesa->state.VB.elt_size);
        } else {
                r300EmitAOS(rmesa, rmesa->state.aos_count, start);
-               fire_AOS(rmesa, num_verts, type);
+               r300FireAOS(rmesa, num_verts, type);
        }
 }