radeonsi: skip drawing if GS ring allocations fail

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:
Marek Olšák 2015-09-10 18:27:53 +02:00
parent 22d3ccf5a8
commit 263f5a2cf9
1 changed files with 10 additions and 1 deletions

View File

@ -1069,9 +1069,15 @@ static void si_init_gs_rings(struct si_context *sctx)
sctx->esgs_ring = pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
PIPE_USAGE_DEFAULT, esgs_ring_size);
if (!sctx->esgs_ring)
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);
return;
}
/* Append these registers to the init config state. */
if (sctx->b.chip_class >= CIK) {
@ -1443,8 +1449,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->gsvs_ring)
if (!sctx->gsvs_ring) {
si_init_gs_rings(sctx);
if (!sctx->gsvs_ring)
return false;
}
si_update_gs_rings(sctx);
} else {