Commit 37b8130b authored by Krzysztof Raszkowski's avatar Krzysztof Raszkowski Committed by Marge Bot
Browse files

gallium/swr: Fix array stride problem.


Reviewed-by: Bruce Cherniak's avatarBruce Cherniak <bruce.cherniak@intel.com>
Tested-by: Marge Bot <mesa/mesa!4405>
Part-of: <mesa/mesa!4405>
parent c1e7e83d
Pipeline #127384 passed with stages
in 13 minutes and 18 seconds
...@@ -1106,16 +1106,17 @@ swr_user_vbuf_range(const struct pipe_draw_info *info, ...@@ -1106,16 +1106,17 @@ swr_user_vbuf_range(const struct pipe_draw_info *info,
{ {
/* FIXME: The size is too large - we don't access the full extra stride. */ /* FIXME: The size is too large - we don't access the full extra stride. */
unsigned elems; unsigned elems;
unsigned elem_pitch = vb->stride + velems->stream_pitch[i];
if (velems->instanced_bufs & (1U << i)) { if (velems->instanced_bufs & (1U << i)) {
elems = info->instance_count / velems->min_instance_div[i] + 1; elems = info->instance_count / velems->min_instance_div[i] + 1;
*totelems = info->start_instance + elems; *totelems = info->start_instance + elems;
*base = info->start_instance * vb->stride; *base = info->start_instance * vb->stride;
*size = elems * vb->stride; *size = elems * elem_pitch;
} else if (vb->stride) { } else if (vb->stride) {
elems = info->max_index - info->min_index + 1; elems = info->max_index - info->min_index + 1;
*totelems = (info->max_index + info->index_bias) + 1; *totelems = (info->max_index + info->index_bias) + 1;
*base = (info->min_index + info->index_bias) * vb->stride; *base = (info->min_index + info->index_bias) * vb->stride;
*size = elems * vb->stride; *size = elems * elem_pitch;
} else { } else {
*totelems = 1; *totelems = 1;
*base = 0; *base = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment