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>
unsigned force_level);
/* si_state_shader.c */
unsigned force_level);
/* si_state_shader.c */
-void si_update_shaders(struct si_context *sctx);
+bool si_update_shaders(struct si_context *sctx);
void si_init_shader_functions(struct si_context *sctx);
/* si_state_draw.c */
void si_init_shader_functions(struct si_context *sctx);
/* si_state_draw.c */
else
sctx->current_rast_prim = info->mode;
else
sctx->current_rast_prim = info->mode;
- si_update_shaders(sctx);
- if (!si_upload_shader_descriptors(sctx))
+ if (!si_update_shaders(sctx) ||
+ !si_upload_shader_descriptors(sctx))
return;
if (info->indexed) {
return;
if (info->indexed) {
sctx->tf_ring = pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
PIPE_USAGE_DEFAULT,
32768 * sctx->screen->b.info.max_se);
sctx->tf_ring = pipe_buffer_create(sctx->b.b.screen, PIPE_BIND_CUSTOM,
PIPE_USAGE_DEFAULT,
32768 * sctx->screen->b.info.max_se);
+ if (!sctx->tf_ring)
+ return;
+
assert(((sctx->tf_ring->width0 / 4) & C_030938_SIZE) == 0);
/* Append these registers to the init config state. */
assert(((sctx->tf_ring->width0 / 4) & C_030938_SIZE) == 0);
/* Append these registers to the init config state. */
sctx->b.streamout.stride_in_dw = shader->so.stride;
}
sctx->b.streamout.stride_in_dw = shader->so.stride;
}
-void si_update_shaders(struct si_context *sctx)
+bool si_update_shaders(struct si_context *sctx)
{
struct pipe_context *ctx = (struct pipe_context*)sctx;
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
/* Update stages before GS. */
if (sctx->tes_shader) {
{
struct pipe_context *ctx = (struct pipe_context*)sctx;
struct si_state_rasterizer *rs = sctx->queued.named.rasterizer;
/* Update stages before GS. */
if (sctx->tes_shader) {
si_init_tess_factor_ring(sctx);
si_init_tess_factor_ring(sctx);
+ if (!sctx->tf_ring)
+ return false;
+ }
/* VS as LS */
si_shader_select(ctx, sctx->vs_shader);
/* VS as LS */
si_shader_select(ctx, sctx->vs_shader);
if (sctx->b.chip_class == SI)
si_mark_atom_dirty(sctx, &sctx->db_render_state);
}
if (sctx->b.chip_class == SI)
si_mark_atom_dirty(sctx, &sctx->db_render_state);
}
}
void si_init_shader_functions(struct si_context *sctx)
}
void si_init_shader_functions(struct si_context *sctx)