pan/bi: Check return addresses in blend shaders

Required on Valhall, where jumping to 0x0 doesn't automatically terminate the
program. Luckily the check is free there too.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15223>
This commit is contained in:
Alyssa Rosenzweig
2022-03-17 12:31:28 -04:00
committed by Marge Bot
parent 1b7d7ebbab
commit c7f6b973b2
+8 -2
View File
@@ -674,9 +674,15 @@ bi_emit_fragment_out(bi_builder *b, nir_intrinsic_instr *instr)
if (b->shader->inputs->is_blend) {
/* Jump back to the fragment shader, return address is stored
* in r48 (see above).
* in r48 (see above). On Valhall, only jump if the address is
* nonzero. The check is free there and it implements the "jump
* to 0 terminates the blend shader" that's automatic on
* Bifrost.
*/
bi_jump(b, bi_register(48));
if (b->shader->arch >= 8)
bi_branchzi(b, bi_register(48), bi_register(48), BI_CMPF_NE);
else
bi_jump(b, bi_register(48));
}
}