mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
radeonsi: handle index buffer alloc failures
Cc: 11.0 <mesa-stable@lists.freedesktop.org> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
f3a0819533
commit
29dff6f676
1 changed files with 6 additions and 0 deletions
|
|
@ -782,6 +782,10 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
|
|||
|
||||
u_upload_alloc(sctx->b.uploader, start_offset, count * 2,
|
||||
&out_offset, &out_buffer, &ptr);
|
||||
if (!out_buffer) {
|
||||
pipe_resource_reference(&ib.buffer, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
util_shorten_ubyte_elts_to_userptr(&sctx->b.b, &ib, 0,
|
||||
ib.offset + start_offset,
|
||||
|
|
@ -802,6 +806,8 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
|
|||
u_upload_data(sctx->b.uploader, start_offset, count * ib.index_size,
|
||||
(char*)ib.user_buffer + start_offset,
|
||||
&ib.offset, &ib.buffer);
|
||||
if (!ib.buffer)
|
||||
return;
|
||||
/* info->start will be added by the drawing code */
|
||||
ib.offset -= start_offset;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue