From 36d2914a19e48a702ed2303e272a92e487f00f3e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Thu, 10 May 2012 13:54:27 +0200 Subject: [PATCH] radeonsi: Fix vertex buffer resource for stride 0. --- src/gallium/drivers/radeonsi/r600_state_common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) | -- 2.30.2