i915: emit passthrough for empty TGSI fragment shaders

The TGSI compiler rejected empty fragment shaders (num_instructions
== 1, just TGSI_END) as errors. Instead, emit a passthrough program.

Assisted-by: Claude
This commit is contained in:
Adam Jackson 2026-05-07 15:45:38 -04:00
parent 5e1ada315c
commit b1e709384b

View file

@ -1006,12 +1006,11 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
p->nr_decl_insn, I915_MAX_DECL_INSN);
}
/* 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 (ifs->info.num_instructions == 1) {
i915_use_passthrough_shader(ifs);
ifs->nr_alu_insn = 1;
goto done;
}
if (strlen(p->error) != 0) {
i915_use_passthrough_shader(ifs);
@ -1042,6 +1041,7 @@ i915_fini_compile(struct i915_context *i915, struct i915_fp_compile *p)
}
}
done:
if (strlen(p->error) != 0)
ifs->error = p->error;
else