summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2015-09-10 18:27:53 +0200
committerEmil Velikov <[email protected]>2015-10-07 14:36:53 +0100
commit4e0ae01588492775169b73530210cd131ac99978 (patch)
tree8472870b2fde3eb8996a157008edf6b56c2bc72f /src/gallium
parent33ed153214c67e9a00db90c1f37e1d7756916fed (diff)
radeonsi: skip drawing if GS ring allocations fail
Cc: 11.0 <[email protected]> Acked-by: Christian König <[email protected]> Reviewed-by: Michel Dänzer <[email protected]> (cherry picked from commit 263f5a2cf97e455e48dbd7728cb0ac10fd699746) [Emil Velikov: Track gs_rings over gsvs_ring. NULL check/FREE gs_rings.] Signed-off-by: Emil Velikov <[email protected]> Conflicts: src/gallium/drivers/radeonsi/si_state_shaders.c
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index f21d1ef78f4..d6b4fd3915e 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1039,11 +1039,23 @@ static void si_init_gs_rings(struct si_context *sctx)
assert(!sctx->gs_rings);
sctx->gs_rings = CALLOC_STRUCT(si_pm4_state);
+ if (!sctx->gs_rings)
+ return;
+
sctx->esgs_ring = pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
PIPE_USAGE_DEFAULT, esgs_ring_size);
+ if (!sctx->esgs_ring) {
+ FREE(sctx->gs_rings);
+ return;
+ }
sctx->gsvs_ring = pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
PIPE_USAGE_DEFAULT, gsvs_ring_size);
+ if (!sctx->gsvs_ring) {
+ pipe_resource_reference(&sctx->esgs_ring, NULL);
+ FREE(sctx->gs_rings);
+ return;
+ }
if (sctx->b.chip_class >= CIK) {
if (sctx->b.chip_class >= VI) {
@@ -1410,8 +1422,11 @@ bool si_update_shaders(struct si_context *sctx)
si_pm4_bind_state(sctx, vs, sctx->gs_shader->current->gs_copy_shader->pm4);
si_update_so(sctx, sctx->gs_shader);
- if (!sctx->gs_rings)
+ if (!sctx->gs_rings) {
si_init_gs_rings(sctx);
+ if (!sctx->gs_rings)
+ return false;
+ }
if (sctx->emitted.named.gs_rings != sctx->gs_rings)
sctx->b.flags |= SI_CONTEXT_VGT_FLUSH;