[Mesa-dev] [PATCH] radeonsi: workaround for tesselation on SI
Marek Olšák
maraeo at gmail.com
Sun May 8 09:55:15 UTC 2016
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
BTW, Matt suggested that instead of declaring a local LDS array, the
shader should receive an LDS pointer via function parameters of "main"
(or something along those lines). This would avoid the need to specify
the array size at compile time.
Marek
On Sun, May 8, 2016 at 7:46 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> We request more than 32KB of LDS here, which SI doesn't have. Since LLVM
> recently started checking the size of declared LDS allocations, all shaders
> involved in tesselation fail to compile on SI.
>
> Note that the entire calculation here seems wrong, given how we calculate
> indices for generic attributes, so the number ends up wrong on CI+ as well.
> A proper solution is clearly needed, but this patch should serve as a band-aid
> for SI in the meantime.
>
> Also note that the real size of the LDS allocation in hardware is independent
> from what we tell LLVM, so this is really more of a "cosmetic" change.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95198
> Cc: "11.2" <mesa-stable at lists.freedesktop.org>
> ---
> src/gallium/drivers/radeonsi/si_shader.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
> index 211db9f..12ccbab 100644
> --- a/src/gallium/drivers/radeonsi/si_shader.c
> +++ b/src/gallium/drivers/radeonsi/si_shader.c
> @@ -4952,6 +4952,14 @@ static void declare_tess_lds(struct si_shader_context *ctx)
> unsigned patch_dw_size = vertex_data_dw_size*2 + patch_data_dw_size;
> unsigned lds_dwords = patch_dw_size;
>
> + if (ctx->screen->b.chip_class <= SI) {
> + /* This is a horrible temporary workaround to make tesselation
> + * not be completely broken on SI now that LLVM checks that
> + * the declared LDS size fits into the device maximum of 32KB.
> + */
> + lds_dwords = 8 * 1024;
> + }
> +
> /* The actual size is computed outside of the shader to reduce
> * the number of shader variants. */
> ctx->lds =
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list