diff options
author | Zack Rusin <zackr@vmware.com> | 2013-05-13 23:07:14 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2013-05-14 03:10:56 -0400 |
commit | 5104ed3dbf18d47736fc67a8e3e317ea18360fa8 (patch) | |
tree | d161f1e6f09b3ab6846b064105b8cfc014b203cc /src/mesa/state_tracker | |
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 <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_draw_feedback.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index ecd4661a284..fe66b99d562 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -233,7 +233,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, draw_set_indexes(draw, (ubyte *) mapped_indices + ibuffer.offset, - ibuffer.index_size); + ibuffer.index_size, ~0); } /* set the constant buffer */ @@ -252,7 +252,7 @@ st_feedback_draw_vbo(struct gl_context *ctx, * unmap vertex/index buffers */ if (ib) { - draw_set_indexes(draw, NULL, 0); + draw_set_indexes(draw, NULL, 0, 0); if (ib_transfer) pipe_buffer_unmap(pipe, ib_transfer); pipe_resource_reference(&ibuffer.buffer, NULL); |