From 7921648cd6f23c1a5ca8324214f97ef10d2cca47 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Sun, 27 Jun 2021 14:10:47 -0700 Subject: [PATCH] i915g: Use the normal compile error path for empty FSes. This means they'll get dumped and you'll see the passthrough FS. Part-of: --- src/gallium/drivers/i915/i915_fpc_translate.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c b/src/gallium/drivers/i915/i915_fpc_translate.c index 5bfbbc88b26..9f385b70a0d 100644 --- a/src/gallium/drivers/i915/i915_fpc_translate.c +++ b/src/gallium/drivers/i915/i915_fpc_translate.c @@ -985,6 +985,13 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p) if (p->nr_decl_insn > I915_MAX_DECL_INSN) i915_program_error(p, "Exceeded max DECL instructions"); + /* hw doesn't seem to like empty frag programs (num_instructions == 1 is just + * TGSI_END), even when the depth write fixup gets emitted below - maybe that + * one is fishy, too? + */ + if (ifs->info.num_instructions == 1) + i915_program_error(p, "Empty fragment shader"); + if (p->error) { p->NumNativeInstructions = 0; p->NumNativeAluInstructions = 0; @@ -1053,14 +1060,6 @@ i915_translate_fragment_program(struct i915_context *i915, tgsi_dump(tokens, 0); } - /* hw doesn't seem to like empty frag programs, even when the depth write - * fixup gets emitted below - may that one is fishy, too? */ - if (fs->info.num_instructions == 1) { - i915_use_passthrough_shader(fs); - - return; - } - p = i915_init_compile(i915, fs); i_tokens = i915_optimize(tokens);