diff options
author | Marek Olšák <[email protected]> | 2010-02-27 00:37:01 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-02-27 18:39:35 +0100 |
commit | 93da1522098145f0e7ff9d4188050728b075b4a1 (patch) | |
tree | a7641f180354d4fe08192daaf81ff5ef857ff67e /src/gallium/drivers/r300/r300_state.c | |
parent | dba7ad895333b9b0988239266a217edeebe6a3b3 (diff) |
r300g: always emit the correct max vertex index to avoid DRM errors
Fixing bizarre reports that a vertex buffer is not large enough.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_state.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 0f14ccc53e5..ee4409c8899 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1026,10 +1026,17 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe, const struct pipe_vertex_buffer* buffers) { struct r300_context* r300 = r300_context(pipe); + unsigned i, max_index = ~0; memcpy(r300->vertex_buffer, buffers, sizeof(struct pipe_vertex_buffer) * count); + + for (i = 0; i < count; i++) { + max_index = MIN2(buffers[i].max_index, max_index); + } + r300->vertex_buffer_count = count; + r300->vertex_buffer_max_index = max_index; if (r300->draw) { draw_flush(r300->draw); |