diff options
author | Marek Olšák <[email protected]> | 2015-09-10 18:48:12 +0200 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-10-07 14:41:58 +0100 |
commit | 01e197c21a3adc3934bde7b0248a067602270caa (patch) | |
tree | a6a088622d1ea7d7ec139c05ae07b70f4c533f6c /src/gallium | |
parent | 0c5aacf44669762479ef467c0fb6853f9ff2a807 (diff) |
gallium/u_blitter: handle allocation failures
Cc: 11.0 <[email protected]>
Acked-by: Christian König <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>
(cherry picked from commit 7bbce21e458d912279159aa6ac122768c6c06551)
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/util/u_blitter.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index 9bba07aa18e..2fbf69c67d2 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -1190,6 +1190,8 @@ static void blitter_draw(struct blitter_context_priv *ctx, u_upload_data(ctx->upload, 0, sizeof(ctx->vertices), ctx->vertices, &vb.buffer_offset, &vb.buffer); + if (!vb.buffer) + return; u_upload_unmap(ctx->upload); pipe->set_vertex_buffers(pipe, ctx->base.vb_slot, 1, &vb); @@ -2089,6 +2091,9 @@ void util_blitter_clear_buffer(struct blitter_context *blitter, u_upload_data(ctx->upload, 0, num_channels*4, clear_value, &vb.buffer_offset, &vb.buffer); + if (!vb.buffer) + goto out; + vb.stride = 0; blitter_set_running_flag(ctx); @@ -2112,6 +2117,7 @@ void util_blitter_clear_buffer(struct blitter_context *blitter, util_draw_arrays(pipe, PIPE_PRIM_POINTS, 0, size / 4); +out: blitter_restore_vertex_states(ctx); blitter_restore_render_cond(ctx); blitter_unset_running_flag(ctx); |