From 0d221fcd40e2f942b855915bedcf1a6e60001856 Mon Sep 17 00:00:00 2001 From: Charmaine Lee Date: Mon, 24 Oct 2016 10:50:29 -0700 Subject: [PATCH] svga: add a helper function to check for typeless format This patch adds a helper function svga_format_is_typeless() which returns TRUE if the specified format is typeless. Reviewed-by: Brian Paul --- src/gallium/drivers/svga/svga_format.c | 31 +++++++++++++++++++++++++++++++ src/gallium/drivers/svga/svga_format.h | 3 +++ 2 files changed, 34 insertions(+) diff --git a/src/gallium/drivers/svga/svga_format.c b/src/gallium/drivers/svga/svga_format.c index e307674..948b276 100644 --- a/src/gallium/drivers/svga/svga_format.c +++ b/src/gallium/drivers/svga/svga_format.c @@ -2209,3 +2209,34 @@ svga_format_is_uncompressed_snorm(SVGA3dSurfaceFormat format) return false; } } + + +bool +svga_format_is_typeless(SVGA3dSurfaceFormat format) +{ + switch (format) { + case SVGA3D_R32G32B32A32_TYPELESS: + case SVGA3D_R32G32B32_TYPELESS: + case SVGA3D_R16G16B16A16_TYPELESS: + case SVGA3D_R32G32_TYPELESS: + case SVGA3D_R32G8X24_TYPELESS: + case SVGA3D_R10G10B10A2_TYPELESS: + case SVGA3D_R8G8B8A8_TYPELESS: + case SVGA3D_R16G16_TYPELESS: + case SVGA3D_R32_TYPELESS: + case SVGA3D_R24G8_TYPELESS: + case SVGA3D_R8G8_TYPELESS: + case SVGA3D_R16_TYPELESS: + case SVGA3D_R8_TYPELESS: + case SVGA3D_BC1_TYPELESS: + case SVGA3D_BC2_TYPELESS: + case SVGA3D_BC3_TYPELESS: + case SVGA3D_BC4_TYPELESS: + case SVGA3D_BC5_TYPELESS: + case SVGA3D_B8G8R8A8_TYPELESS: + case SVGA3D_B8G8R8X8_TYPELESS: + return true; + default: + return false; + } +} diff --git a/src/gallium/drivers/svga/svga_format.h b/src/gallium/drivers/svga/svga_format.h index 70807c524..e8af40a 100644 --- a/src/gallium/drivers/svga/svga_format.h +++ b/src/gallium/drivers/svga/svga_format.h @@ -108,4 +108,7 @@ bool svga_format_is_uncompressed_snorm(SVGA3dSurfaceFormat format); +bool +svga_format_is_typeless(SVGA3dSurfaceFormat format); + #endif /* SVGA_FORMAT_H_ */ -- 2.7.4