From: Marek Olšák Date: Tue, 13 Nov 2012 14:44:46 +0000 (+0100) Subject: r300g: fix crash since the set_vertex_buffers(start_slot) change X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7a8affb6a1c1cc4d6de10717b1c3c8d64a8e41f2;p=mesa.git r300g: fix crash since the set_vertex_buffers(start_slot) change --- diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 85d05bd2ce3..e5e68d22dd0 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -1632,16 +1632,17 @@ static void r300_set_vertex_buffers_hwtcl(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); - /* There must be at least one vertex buffer set, otherwise it locks up. */ - if (!count) { - buffers = &r300->dummy_vb; - count = 1; - } - util_set_vertex_buffers_count(r300->vertex_buffer, &r300->nr_vertex_buffers, buffers, start_slot, count); + /* There must be at least one vertex buffer set, otherwise it locks up. */ + if (!r300->nr_vertex_buffers) { + util_set_vertex_buffers_count(r300->vertex_buffer, + &r300->nr_vertex_buffers, + &r300->dummy_vb, 0, 1); + } + r300->vertex_arrays_dirty = TRUE; }