[Mesa-dev] [PATCH] radv/formats: add fast clear for 8-bit signed ints.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Mon Feb 27 07:43:53 UTC 2017


Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Mon, Feb 27, 2017 at 3:15 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> These formats are used by some CTS tests, may as well fill them in.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/amd/vulkan/radv_formats.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
> index 30a20db..7483b8d 100644
> --- a/src/amd/vulkan/radv_formats.c
> +++ b/src/amd/vulkan/radv_formats.c
> @@ -864,6 +864,10 @@ bool radv_format_pack_clear_color(VkFormat format,
>                 clear_vals[0] = value->uint32[0] & 0xff;
>                 clear_vals[1] = 0;
>                 break;
> +       case VK_FORMAT_R8_SINT:
> +               clear_vals[0] = value->int32[0] & 0xff;
> +               clear_vals[1] = 0;
> +               break;
>         case VK_FORMAT_R16_UINT:
>                 clear_vals[0] = value->uint32[0] & 0xffff;
>                 clear_vals[1] = 0;
> @@ -873,6 +877,11 @@ bool radv_format_pack_clear_color(VkFormat format,
>                 clear_vals[0] |= (value->uint32[1] & 0xff) << 8;
>                 clear_vals[1] = 0;
>                 break;
> +       case VK_FORMAT_R8G8_SINT:
> +               clear_vals[0] = value->int32[0] & 0xff;
> +               clear_vals[0] |= (value->int32[1] & 0xff) << 8;
> +               clear_vals[1] = 0;
> +               break;
>         case VK_FORMAT_R8G8B8A8_UINT:
>                 clear_vals[0] = value->uint32[0] & 0xff;
>                 clear_vals[0] |= (value->uint32[1] & 0xff) << 8;
> @@ -880,6 +889,13 @@ bool radv_format_pack_clear_color(VkFormat format,
>                 clear_vals[0] |= (value->uint32[3] & 0xff) << 24;
>                 clear_vals[1] = 0;
>                 break;
> +       case VK_FORMAT_R8G8B8A8_SINT:
> +               clear_vals[0] = value->int32[0] & 0xff;
> +               clear_vals[0] |= (value->int32[1] & 0xff) << 8;
> +               clear_vals[0] |= (value->int32[2] & 0xff) << 16;
> +               clear_vals[0] |= (value->int32[3] & 0xff) << 24;
> +               clear_vals[1] = 0;
> +               break;
>         case VK_FORMAT_A8B8G8R8_UINT_PACK32:
>                 clear_vals[0] = value->uint32[0] & 0xff;
>                 clear_vals[0] |= (value->uint32[1] & 0xff) << 8;
> --
> 2.9.3
>
> _______________________________________________
> 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