i915g: Fix writing of undefined depth value if not writing any outputs.

This was showing up as flakes in CI on tests that didn't write any outputs
but did check the depth result.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10874>
This commit is contained in:
Emma Anholt 2021-05-18 12:19:45 -07:00 committed by Marge Bot
parent 8b0901c707
commit fc3d5bebf2
2 changed files with 1 additions and 2 deletions

View file

@ -1,2 +1 @@
spec@glsl-1.10@execution@discard@glsl-fs-discard-03
spec@glsl-1.10@glsl-fs-discard-only

View file

@ -1187,7 +1187,7 @@ static void
i915_fixup_depth_write(struct i915_fp_compile *p)
{
/* XXX assuming pos/depth is always in output[0] */
if (p->shader->info.output_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
if (p->shader->info.num_outputs != 0 && p->shader->info.output_semantic_name[0] == TGSI_SEMANTIC_POSITION) {
const uint depth = UREG(REG_TYPE_OD, 0);
i915_emit_arith(p,