mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 15:48:36 +02:00
r300g: fix rendering with a vertex attrib having a zero stride
The hardware apparently does support a zero stride, so let's use it.
This fixes missing objects in ETQW, but might also fix a ton of other
similar-looking bugs.
NOTE: This is a candidate for both the 7.9 and 7.10 branches.
(cherry picked from commit 2af8a19831)
This commit is contained in:
parent
0a8ad737e7
commit
dcc7a8a80a
1 changed files with 7 additions and 7 deletions
|
|
@ -1510,14 +1510,14 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
|
||||||
any_user_buffer = TRUE;
|
any_user_buffer = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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->max_index == ~0) {
|
||||||
/* if no VBO stride then only one vertex value so max index is 1 */
|
vbo->max_index =
|
||||||
/* should think about converting to VS constants like svga does */
|
(vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
|
||||||
if (!vbo->stride)
|
|
||||||
vbo->max_index = 1;
|
|
||||||
else
|
|
||||||
vbo->max_index =
|
|
||||||
(vbo->buffer->width0 - vbo->buffer_offset) / vbo->stride;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
max_index = MIN2(vbo->max_index, max_index);
|
max_index = MIN2(vbo->max_index, max_index);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue