From: Michel Dänzer Date: Thu, 10 May 2012 11:54:27 +0000 (+0200) Subject: radeonsi: Fix vertex buffer resource for stride 0. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=36d2914a19e48a702ed2303e272a92e487f00f3e;p=mesa.git radeonsi: Fix vertex buffer resource for stride 0. --- diff --git a/src/gallium/drivers/radeonsi/r600_state_common.c b/src/gallium/drivers/radeonsi/r600_state_common.c index d283e41e681..ebed5b36730 100644 --- a/src/gallium/drivers/radeonsi/r600_state_common.c +++ b/src/gallium/drivers/radeonsi/r600_state_common.c @@ -625,7 +625,11 @@ static void r600_vertex_buffer_update(struct r600_context *rctx) ptr[0] = va & 0xFFFFFFFF; ptr[1] = (S_008F04_BASE_ADDRESS_HI(va >> 32) | S_008F04_STRIDE(vertex_buffer->stride)); - ptr[2] = (vertex_buffer->buffer->width0 - offset) / vertex_buffer->stride; + if (vertex_buffer->stride > 0) + ptr[2] = ((vertex_buffer->buffer->width0 - offset) / + vertex_buffer->stride); + else + ptr[2] = vertex_buffer->buffer->width0 - offset; /* XXX: Hardcoding RGBA */ ptr[3] = (S_008F0C_DST_SEL_X(V_008F0C_SQ_SEL_X) | S_008F0C_DST_SEL_Y(V_008F0C_SQ_SEL_Y) |