diff options
author | Alex Deucher <[email protected]> | 2010-12-12 22:44:53 -0500 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2010-12-12 23:35:37 -0500 |
commit | 4523285e518702ac9be839851765d8d0d2461eca (patch) | |
tree | aa7387cde755957fe43f524a6d258c76e325da21 /src/gallium/drivers | |
parent | d19b5cbd317620f3977e68fffb7a74793436b7e2 (diff) |
r600g: fix rendering with a vertex attrib having a zero stride
The hardware supports zero stride just fine. This is a port
of 2af8a1983180fc0168c1e0e53bcc69ee3d684ea4 from r300g.
NOTE: This is a candidate for both the 7.9 and 7.10 branches.
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/r600/r600_state_common.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index c647e77b373..1333808c66f 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -187,11 +187,13 @@ void r600_set_vertex_buffers(struct pipe_context *ctx, unsigned count, rctx->any_user_vbs = TRUE; pipe_resource_reference(&rctx->vertex_buffer[i].buffer, buffers[i].buffer); + /* The stride of zero means we will be fetching only the first + * vertex, so don't care about max_index. */ + if (!vbo->stride) + continue; + if (vbo->max_index == ~0) { - if (!vbo->stride) - vbo->max_index = 1; - else - vbo->max_index = (vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride; + vbo->max_index = (vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride; } max_index = MIN2(vbo->max_index, max_index); } |