r300g: Properly clamp index limits.
Make the kernel even less likely to barf on us.
This commit is contained in:
parent
915b3529b9
commit
e42b2f7685
|
@ -280,7 +280,7 @@ static void r300_emit_draw_elements(struct r300_context *r300,
|
||||||
DBG(r300, DBG_DRAW, "r300: Indexbuf of %u indices, min %u max %u\n",
|
DBG(r300, DBG_DRAW, "r300: Indexbuf of %u indices, min %u max %u\n",
|
||||||
count, minIndex, maxIndex);
|
count, minIndex, maxIndex);
|
||||||
|
|
||||||
maxIndex = MIN2(maxIndex, r300->vertex_buffer_max_index);
|
maxIndex = MIN3(maxIndex, r300->vertex_buffer_max_index, (1 << 24) - 1);
|
||||||
|
|
||||||
if (alt_num_verts) {
|
if (alt_num_verts) {
|
||||||
BEGIN_CS(15);
|
BEGIN_CS(15);
|
||||||
|
|
|
@ -1031,7 +1031,7 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
|
||||||
const struct pipe_vertex_buffer* buffers)
|
const struct pipe_vertex_buffer* buffers)
|
||||||
{
|
{
|
||||||
struct r300_context* r300 = r300_context(pipe);
|
struct r300_context* r300 = r300_context(pipe);
|
||||||
unsigned i, max_index = ~0;
|
unsigned i, max_index = (1 << 24) - 1;
|
||||||
|
|
||||||
memcpy(r300->vertex_buffer, buffers,
|
memcpy(r300->vertex_buffer, buffers,
|
||||||
sizeof(struct pipe_vertex_buffer) * count);
|
sizeof(struct pipe_vertex_buffer) * count);
|
||||||
|
|
Loading…
Reference in New Issue