[Mesa-dev] [PATCH] ac: do not crash when the buffer data format is invalid
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Mon Jul 29 10:16:05 UTC 2019
r-b
On Mon, Jul 29, 2019 at 12:00 PM Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
>
> This might happen when a pipeline doesn't define the vertex input
> state, so the buffer data format is 0 (aka INVALID).
>
> This fixes crashes when compiling some shaders on GFX10.
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/amd/common/ac_llvm_build.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
> index 250bfc5229e..278f8893432 100644
> --- a/src/amd/common/ac_llvm_build.c
> +++ b/src/amd/common/ac_llvm_build.c
> @@ -1508,6 +1508,7 @@ ac_get_tbuffer_format(struct ac_llvm_context *ctx,
> unsigned format;
> switch (dfmt) {
> default: unreachable("bad dfmt");
> + case V_008F0C_BUF_DATA_FORMAT_INVALID: format = V_008F0C_IMG_FORMAT_INVALID; break;
> case V_008F0C_BUF_DATA_FORMAT_8: format = V_008F0C_IMG_FORMAT_8_UINT; break;
> case V_008F0C_BUF_DATA_FORMAT_8_8: format = V_008F0C_IMG_FORMAT_8_8_UINT; break;
> case V_008F0C_BUF_DATA_FORMAT_8_8_8_8: format = V_008F0C_IMG_FORMAT_8_8_8_8_UINT; break;
> --
> 2.22.0
>
> _______________________________________________
> 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