The Draw flush inside r300_flush was the culprit.
Also, no need to flush Draw when changing a state since the flush is
already inside swtcl_draw_vbo.
u_upload_flush(r300->upload_vb);
u_upload_flush(r300->upload_ib);
- /* We probably need to flush Draw, but we may have been called from
- * within Draw. This feels kludgy, but it might be the best thing.
- *
- * Of course, the best thing is to kill Draw with fire. :3 */
- if (r300->draw && !r300->draw->flushing) {
- draw_flush(r300->draw);
- }
-
if (r300->dirty_hw) {
r300_emit_hyperz_end(r300);
r300_emit_query_end(r300);
r300_update_derived_state(r300);
for (i = 0; i < r300->vertex_buffer_count; i++) {
- void* buf = pipe_buffer_map(pipe,
- r300->vertex_buffer[i].buffer,
- PIPE_TRANSFER_READ,
- &vb_transfer[i]);
- draw_set_mapped_vertex_buffer(r300->draw, i, buf);
+ if (r300->vertex_buffer[i].buffer) {
+ void *buf = pipe_buffer_map(pipe,
+ r300->vertex_buffer[i].buffer,
+ PIPE_TRANSFER_READ,
+ &vb_transfer[i]);
+ draw_set_mapped_vertex_buffer(r300->draw, i, buf);
+ }
}
if (info->indexed && r300->index_buffer.buffer) {
draw_flush(r300->draw);
for (i = 0; i < r300->vertex_buffer_count; i++) {
- pipe_buffer_unmap(pipe, r300->vertex_buffer[i].buffer,
- vb_transfer[i]);
- draw_set_mapped_vertex_buffer(r300->draw, i, NULL);
+ if (r300->vertex_buffer[i].buffer) {
+ pipe_buffer_unmap(pipe, r300->vertex_buffer[i].buffer,
+ vb_transfer[i]);
+ draw_set_mapped_vertex_buffer(r300->draw, i, NULL);
+ }
}
if (ib_transfer) {
PIPE_TRANSFER_WRITE,
&r300render->vbo_transfer);
+ assert(r300render->vbo_ptr);
+
return ((uint8_t*)r300render->vbo_ptr + r300render->vbo_offset);
}
r300->clip_state.dirty = TRUE;
} else {
- draw_flush(r300->draw);
draw_set_clip_state(r300->draw, state);
}
}
return;
}
- if (r300->draw) {
- draw_flush(r300->draw);
- }
-
/* If nr_cbufs is changed from zero to non-zero or vice versa... */
if (!!old_state->nr_cbufs != !!state->nr_cbufs) {
r300->blend_state.dirty = TRUE;
boolean last_two_sided_color = r300->two_sided_color;
if (r300->draw && rs) {
- draw_flush(r300->draw);
draw_set_rasterizer_state(r300->draw, &rs->rs_draw, state);
}
r300->viewport = *state;
if (r300->draw) {
- draw_flush(r300->draw);
draw_set_viewport_state(r300->draw, state);
viewport->vte_control = R300_VTX_XY_FMT | R300_VTX_Z_FMT;
return;
} else {
/* SW TCL. */
- draw_flush(r300->draw);
draw_set_vertex_buffers(r300->draw, count, buffers);
}
r300->velems = velems;
if (r300->draw) {
- draw_flush(r300->draw);
draw_set_vertex_elements(r300->draw, velems->count, velems->velem);
return;
}
r300->pvs_flush.dirty = TRUE;
} else {
- draw_flush(r300->draw);
draw_bind_vertex_shader(r300->draw,
(struct draw_vertex_shader*)vs->draw_vs);
}