radeonsi: preserve derivatives after discards for ARB shaders

Contrary to the GLSL spec, the ARB fp spec doesn't explicitely
states that derivatives are undefined after discards.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5018
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11972>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2021-07-16 11:45:56 +02:00 committed by Marge Bot
parent 8cd2e82c89
commit bdcefb8ec4

View file

@ -837,7 +837,8 @@ static void si_lower_nir(struct si_screen *sscreen, struct nir_shader *nir)
NIR_PASS_V(nir, nir_lower_subgroups, &subgroups_options);
NIR_PASS_V(nir, nir_lower_discard_or_demote,
sscreen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL));
(sscreen->debug_flags & DBG(FS_CORRECT_DERIVS_AFTER_KILL)) ||
nir->info.is_arb_asm);
/* Lower load constants to scalar and then clean up the mess */
NIR_PASS_V(nir, nir_lower_load_const_to_scalar);