mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
r300g: Really destroy translated buffer at the end.
Note that indexSize is changed by r300_translate_elts(). Also make sure it's destroyed on errors.
This commit is contained in:
parent
7fcfb71931
commit
60628c65c9
1 changed files with 5 additions and 3 deletions
|
|
@ -316,6 +316,7 @@ void r300_draw_range_elements(struct pipe_context* pipe,
|
|||
return;
|
||||
}
|
||||
|
||||
struct pipe_buffer* orgIndexBuffer = indexBuffer;
|
||||
if (indexSize == 1) {
|
||||
indexBuffer = r300_translate_elts(r300, indexBuffer,
|
||||
&indexSize, &mode, &count);
|
||||
|
|
@ -323,11 +324,11 @@ void r300_draw_range_elements(struct pipe_context* pipe,
|
|||
|
||||
if (!r300->winsys->add_buffer(r300->winsys, indexBuffer,
|
||||
RADEON_GEM_DOMAIN_GTT, 0)) {
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (!r300->winsys->validate(r300->winsys)) {
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
r300_emit_dirty_state(r300);
|
||||
|
|
@ -337,7 +338,8 @@ void r300_draw_range_elements(struct pipe_context* pipe,
|
|||
r300_emit_draw_elements(r300, indexBuffer, indexSize, minIndex, maxIndex,
|
||||
mode, start, count);
|
||||
|
||||
if (indexSize == 1) {
|
||||
cleanup:
|
||||
if (indexBuffer != orgIndexBuffer) {
|
||||
pipe->screen->buffer_destroy(indexBuffer);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue