[Mesa-stable] [Mesa-dev] [PATCH] radeonsi: fix discard-only fragment shaders (11.1 version)

Marek Olšák maraeo at gmail.com
Wed Jan 20 05:18:02 PST 2016


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Jan 19, 2016 at 9:18 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> When a fragment shader is used that has no outputs but does conditional
> discard (KILL_IF), all fragments are killed without this patch.
>
> By comparing various register settings, my conclusion is that the exec mask
> is either not properly forwarded to the DB by NULL exports or ends up being
> unused, at least when there is _only_ a NULL export (the ISA documentation
> claims that NULL exports can be used to override a previously exported exec
> mask).
>
> Of the various approaches I have tried to work around the problem, this one
> seems to be the least invasive one.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93761
> Cc: "11.0 11.1" <mesa-stable at lists.freedesktop.org>
> ---
>  src/gallium/drivers/radeonsi/si_shader.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index 1baa2eb..1c1aaa0 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -2291,6 +2291,9 @@ static void si_llvm_emit_fs_epilogue(struct lp_build_tgsi_context * bld_base)
>                 last_args[6]= uint->zero;
>                 last_args[7]= uint->zero;
>                 last_args[8]= uint->zero;
> +
> +               if (info->uses_kill)
> +                       si_shader_ctx->shader->spi_shader_z_format = V_028710_SPI_SHADER_32_R;
>         }
>
>         /* Specify whether the EXEC mask represents the valid mask */
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-stable mailing list