summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_state_draw.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2014-10-06 17:05:38 +0900
committerMichel Dänzer <[email protected]>2014-10-07 12:07:13 +0900
commitbe0a994fb8689131bf6a717c1e6fa5a42c3d4657 (patch)
tree0fc9e4341edd3a3508644bf4f3284a9346f2fa8a /src/gallium/drivers/radeonsi/si_state_draw.c
parentf358462640beb7660b9ce2a31d5367fc33421ee1 (diff)
radeonsi: Use dummy pixel shader if compilation of the real shader failed
Instead of crashing. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79155#c5 Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state_draw.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index e8d84a90d57..c9e4353c3a4 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -662,6 +662,16 @@ static void si_update_derived_state(struct si_context *sctx)
si_shader_select(ctx, sctx->ps_shader);
+ if (!sctx->ps_shader->current) {
+ struct si_shader_selector *sel;
+
+ /* use a dummy shader if compiling the shader (variant) failed */
+ si_make_dummy_ps(sctx);
+ sel = sctx->dummy_pixel_shader;
+ si_shader_select(ctx, sel);
+ sctx->ps_shader->current = sel->current;
+ }
+
if (!sctx->ps_shader->current->pm4)
si_shader_ps(ctx, sctx->ps_shader->current);