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;
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);