mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-17 00:58:13 +02:00
u_vbuf_mgr: fix uploading with a non-zero index bias
Also don't rely on pipe_draw_info being set correctly.
NOTE: This is a candidate for the 7.11 branch.
(cherry picked from commit 60a77cf316)
This commit is contained in:
parent
012b2057e8
commit
37c2c9688c
1 changed files with 11 additions and 4 deletions
|
|
@ -641,11 +641,18 @@ u_vbuf_draw_begin(struct u_vbuf_mgr *mgrb,
|
|||
|
||||
u_vbuf_compute_max_index(mgr);
|
||||
|
||||
min_index = info->min_index - info->index_bias;
|
||||
if (info->max_index == ~0) {
|
||||
max_index = mgr->b.max_index;
|
||||
if (info->indexed) {
|
||||
min_index = info->min_index;
|
||||
if (info->max_index == ~0) {
|
||||
max_index = mgr->b.max_index;
|
||||
} else {
|
||||
max_index = MIN2(info->max_index, mgr->b.max_index);
|
||||
}
|
||||
min_index += info->index_bias;
|
||||
max_index += info->index_bias;
|
||||
} else {
|
||||
max_index = MIN2(info->max_index - info->index_bias, mgr->b.max_index);
|
||||
min_index = info->start;
|
||||
max_index = info->start + info->count - 1;
|
||||
}
|
||||
|
||||
/* Translate vertices with non-native layouts or formats. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue