Commit 21ba2cd6 authored by Dave Airlie's avatar Dave Airlie

r300g: hack around issue with doom3 and 0 stride

This is most likely a bug in the mesa state tracker, but do the quick hack
for now to avoid the divide by 0.

reported and hack generated by almos on #radeon
Signed-off-by: default avatarDave Airlie <>
parent 9b3df661
......@@ -1146,6 +1146,11 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
if (vbo->max_index == ~0) {
/* Bogus value from broken state tracker; hax it. */
/* TODO - more hax - fixes doom3 from almos on irc */
if (!vbo->stride) {
fprintf(stderr, "r300: got a VBO with stride 0 fixing up to stide 4\n");
vbo->stride = 4;
vbo->max_index =
(vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment