From: Maciej Cencora Date: Sun, 25 Oct 2009 12:51:45 +0000 (+0100) Subject: r300g: don't hang GPU on misbehaving apps X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ef0341ea7ee08284ebafe4f347643e1190d5777;p=mesa.git r300g: don't hang GPU on misbehaving apps --- diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 86aaf841dd6..cbda30227da 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -112,6 +112,9 @@ boolean r300_draw_range_elements(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); + if (!u_trim_pipe_prim(mode, &count)) + return false; + r300_update_derived_state(r300); setup_vertex_buffers(r300); @@ -147,6 +150,9 @@ boolean r300_draw_arrays(struct pipe_context* pipe, unsigned mode, { struct r300_context* r300 = r300_context(pipe); + if (!u_trim_pipe_prim(mode, &count)) + return false; + r300_update_derived_state(r300); setup_vertex_buffers(r300);