diff options
author | Zack Rusin <[email protected]> | 2013-05-13 23:07:14 -0400 |
---|---|---|
committer | Zack Rusin <[email protected]> | 2013-05-14 03:10:56 -0400 |
commit | 5104ed3dbf18d47736fc67a8e3e317ea18360fa8 (patch) | |
tree | d161f1e6f09b3ab6846b064105b8cfc014b203cc /src/gallium/drivers/i915/i915_context.c | |
parent | d5250da8189d0fb9741049cdbfc50e84aab44ecb (diff) |
draw: try to prevent overflows on index buffers
Pass in the size of the index buffer, when available, and use it
to handle out of bounds conditions. The behavior in the case of
an overflow needs to be the same as with other overflows in the
vertex processing pipeline meaning that a vertex should still
be generated but all attributes in it set to zero.
Signed-off-by: Zack Rusin <[email protected]>
Reviewed-by: José Fonseca <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers/i915/i915_context.c')
-rw-r--r-- | src/gallium/drivers/i915/i915_context.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c index 90427dca963..93599def2a5 100644 --- a/src/gallium/drivers/i915/i915_context.c +++ b/src/gallium/drivers/i915/i915_context.c @@ -83,7 +83,7 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) mapped_indices = i915_buffer(i915->index_buffer.buffer)->data; draw_set_indexes(draw, (ubyte *) mapped_indices + i915->index_buffer.offset, - i915->index_buffer.index_size); + i915->index_buffer.index_size, ~0); } if (i915->constants[PIPE_SHADER_VERTEX]) @@ -109,7 +109,7 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) draw_set_mapped_vertex_buffer(i915->draw, i, NULL, 0); } if (mapped_indices) - draw_set_indexes(draw, NULL, 0); + draw_set_indexes(draw, NULL, 0, 0); if (i915->num_vertex_sampler_views > 0) i915_cleanup_vertex_sampling(i915); |