r300_update_derived_state(r300);
- return &r300->vertex_info;
+ return &r300->vertex_info.vinfo;
}
static boolean r300_swtcl_render_allocate_vertices(struct vbuf_render* render,
static void prepare_render(struct r300_swtcl_render* render, unsigned count)
{
struct r300_context* r300 = render->r300;
- int i;
CS_LOCALS(r300);
{
struct r300_swtcl_render* r300render = r300_swtcl_render(render);
struct r300_context* r300 = r300render->r300;
- struct pipe_screen* screen = r300->context.screen;
CS_LOCALS(r300);
CS_LOCALS(r300);
- count /= 4;
-
prepare_render(r300render, count);
/* Send our indices into an index buffer. */
index_buffer = pipe_buffer_create(screen, 64, PIPE_BUFFER_USAGE_VERTEX,
- count * 4);
+ count);
if (!index_buffer) {
return;
}
index_map = pipe_buffer_map(screen, index_buffer,
PIPE_BUFFER_USAGE_CPU_WRITE);
- memcpy(index_map, indices, count * 4);
+ memcpy(index_map, indices, count);
pipe_buffer_unmap(screen, index_buffer);
debug_printf("r300: Doing indexbuf render, count %d\n", count);
-#if 0
+
BEGIN_CS(5);
OUT_CS(CP_PACKET3(R300_PACKET3_3D_DRAW_INDX_2, 0));
OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) |
OUT_CS(R300_INDX_BUFFER_ONE_REG_WR | (R300_VAP_PORT_IDX0 >> 2));
OUT_CS_RELOC(index_buffer, 0, RADEON_GEM_DOMAIN_GTT, 0, 0);
END_CS;
-#endif
}
static void r300_swtcl_render_destroy(struct vbuf_render* render)
static struct vbuf_render* r300_swtcl_render_create(struct r300_context* r300)
{
struct r300_swtcl_render* r300render = CALLOC_STRUCT(r300_swtcl_render);
- struct pipe_screen* screen = r300->context.screen;
r300render->r300 = r300;
r300render->base.release_vertices = r300_swtcl_render_release_vertices;
r300render->base.destroy = r300_swtcl_render_destroy;
- /* XXX bonghits ahead
- r300render->vbo_alloc_size = 128 * 4096;
- r300render->vbo_size = r300render->vbo_alloc_size;
- r300render->vbo_offset = 0;
- r300render->vbo = pipe_buffer_create(screen,
- 64,
- PIPE_BUFFER_USAGE_VERTEX,
- r300render->vbo_size);
- r300render->vbo_map = pipe_buffer_map(screen,
- r300render->vbo,
- PIPE_BUFFER_USAGE_CPU_WRITE);
- pipe_buffer_unmap(screen, r300render->vbo); */
-
return &r300render->base;
}