aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2017-12-14 12:01:53 -0600
committerGeorge Kyriazis <[email protected]>2017-12-18 18:51:25 -0600
commit999f1cd5c6fc59b7e522dd12077ba1b6fe322242 (patch)
tree74439450c137b4c1a6616fe9bc601089dff76094 /src/gallium
parent6ab346c4d9ce3d8f0c4d5ba347752fd1ad9337d9 (diff)
swr: Account for index_bias in offsets
When calculating buffer offsets for client buffers account for info.index_bias. Fixes the follow piglit tests: arb_draw_elements_base_vertex-drawelements-user_varrays arb_draw_elements_base_vertex-negative-index-user_varrays Reviewed-By: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/swr/swr_state.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
index 4530d377ee9..d320c901168 100644
--- a/src/gallium/drivers/swr/swr_state.cpp
+++ b/src/gallium/drivers/swr/swr_state.cpp
@@ -1012,8 +1012,8 @@ swr_user_vbuf_range(const struct pipe_draw_info *info,
*size = elems * vb->stride;
} else if (vb->stride) {
elems = info->max_index - info->min_index + 1;
- *totelems = info->max_index + 1;
- *base = info->min_index * vb->stride;
+ *totelems = (info->max_index + info->index_bias) + 1;
+ *base = (info->min_index + info->index_bias) * vb->stride;
*size = elems * vb->stride;
} else {
*totelems = 1;
@@ -1304,7 +1304,7 @@ swr_update_derived(struct pipe_context *pipe,
uint32_t base;
swr_user_vbuf_range(&info, ctx->velems, vb, i, &elems, &base, &size);
partial_inbounds = 0;
- min_vertex_index = info.min_index;
+ min_vertex_index = info.min_index + info.index_bias;
size = AlignUp(size, 4);
/* If size of client memory copy is too large, don't copy. The