mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
r300g: Use u_trim_pipe_prim to prevent lockups from incorrect vert counts.
Adapted from osiris' version on his tree.
This commit is contained in:
parent
23d8d15bed
commit
f3d8d534e6
1 changed files with 9 additions and 0 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include "pipe/p_inlines.h"
|
||||
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_prim.h"
|
||||
|
||||
#include "r300_cs.h"
|
||||
#include "r300_context.h"
|
||||
|
|
@ -86,6 +87,10 @@ boolean r300_draw_range_elements(struct pipe_context* pipe,
|
|||
|
||||
CS_LOCALS(r300);
|
||||
|
||||
if (!u_trim_pipe_prim(mode, &count)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
validate:
|
||||
for (i = 0; i < aos_count; i++) {
|
||||
if (!r300->winsys->add_buffer(r300->winsys, aos[i].buffer,
|
||||
|
|
@ -191,6 +196,10 @@ boolean r300_swtcl_draw_range_elements(struct pipe_context* pipe,
|
|||
struct r300_context* r300 = r300_context(pipe);
|
||||
int i;
|
||||
|
||||
if (!u_trim_pipe_prim(mode, &count)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (i = 0; i < r300->vertex_buffer_count; i++) {
|
||||
void* buf = pipe_buffer_map(pipe->screen,
|
||||
r300->vertex_buffers[i].buffer,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue