summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2012-05-10 13:54:27 +0200
committerMichel Dänzer <[email protected]>2012-05-10 13:54:27 +0200
commit36d2914a19e48a702ed2303e272a92e487f00f3e (patch)
tree1cb07bd90ffa52e5c7159098ec0dcb4f34588057 /src
parent788fd04dacb9eb1e32010050c57cd2f49779311b (diff)
radeonsi: Fix vertex buffer resource for stride 0.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/radeonsi/r600_state_common.c6
1 files changed, 5 insertions, 1 deletions
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) |