diff options
author | Charmaine Lee <[email protected]> | 2016-10-24 10:50:29 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-11-03 14:29:22 -0600 |
commit | 0d221fcd40e2f942b855915bedcf1a6e60001856 (patch) | |
tree | d7a42d8fdb36a3a05212592be8fed9bbebe7290f | |
parent | d451421bcaf31f935c66b6830000fa0873fce192 (diff) |
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 <[email protected]>
-rw-r--r-- | src/gallium/drivers/svga/svga_format.c | 31 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_format.h | 3 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_format.c b/src/gallium/drivers/svga/svga_format.c index e307674750b..948b27611e6 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 70807c5245a..e8af40afb71 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_ */ |