Mesa (master): svga: add a helper function to check for typeless format

Brian Paul brianp at kemper.freedesktop.org
Thu Nov 3 20:31:02 UTC 2016


Module: Mesa
Branch: master
Commit: 0d221fcd40e2f942b855915bedcf1a6e60001856
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0d221fcd40e2f942b855915bedcf1a6e60001856

Author: Charmaine Lee <charmainel at vmware.com>
Date:   Mon Oct 24 10:50:29 2016 -0700

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 <brianp at vmware.com>

---

 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 70807c5..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_ */




More information about the mesa-commit mailing list