sctx->gs_shader = sel;
}
+void si_make_dummy_ps(struct si_context *sctx)
+{
+ if (!sctx->dummy_pixel_shader) {
+ sctx->dummy_pixel_shader =
+ util_make_fragment_cloneinput_shader(&sctx->b.b, 0,
+ TGSI_SEMANTIC_GENERIC,
+ TGSI_INTERPOLATE_CONSTANT);
+ }
+}
+
static void si_bind_ps_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
/* use a dummy shader if binding a NULL shader */
if (!sel) {
- if (!sctx->dummy_pixel_shader) {
- sctx->dummy_pixel_shader =
- util_make_fragment_cloneinput_shader(&sctx->b.b, 0,
- TGSI_SEMANTIC_GENERIC,
- TGSI_INTERPOLATE_CONSTANT);
- }
-
+ si_make_dummy_ps(sctx);
sel = sctx->dummy_pixel_shader;
}
unsigned usage);
int si_shader_select(struct pipe_context *ctx,
struct si_shader_selector *sel);
+void si_make_dummy_ps(struct si_context *sctx);
void si_init_state_functions(struct si_context *sctx);
void si_init_config(struct si_context *sctx);
unsigned cik_bank_wh(unsigned bankwh);
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);