summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/util/u_vbuf_mgr.c6
-rw-r--r--src/gallium/auxiliary/util/u_vbuf_mgr.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.c b/src/gallium/auxiliary/util/u_vbuf_mgr.c
index 521ac07747c..b2eaff851ac 100644
--- a/src/gallium/auxiliary/util/u_vbuf_mgr.c
+++ b/src/gallium/auxiliary/util/u_vbuf_mgr.c
@@ -572,7 +572,11 @@ void u_vbuf_mgr_draw_begin(struct u_vbuf_mgr *mgrb,
int min_index, max_index;
min_index = info->min_index - info->index_bias;
- max_index = info->max_index - info->index_bias;
+ if (info->max_index == ~0) {
+ max_index = mgr->b.max_index;
+ } else {
+ max_index = MIN2(info->max_index - info->index_bias, mgr->b.max_index);
+ }
/* Translate vertices with non-native layouts or formats. */
if (mgr->incompatible_vb_layout || mgr->ve->incompatible_layout) {
diff --git a/src/gallium/auxiliary/util/u_vbuf_mgr.h b/src/gallium/auxiliary/util/u_vbuf_mgr.h
index 8b241854c83..9380dce4f72 100644
--- a/src/gallium/auxiliary/util/u_vbuf_mgr.h
+++ b/src/gallium/auxiliary/util/u_vbuf_mgr.h
@@ -53,7 +53,7 @@ struct u_vbuf_mgr {
int nr_real_vertex_buffers;
/* Precomputed max_index for hardware vertex buffers. */
- int max_index;
+ unsigned max_index;
/* This uploader can optionally be used by the driver.
*