svga: add a helper function to check for typeless format
authorCharmaine Lee <charmainel@vmware.com>
Mon, 24 Oct 2016 17:50:29 +0000 (10:50 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 3 Nov 2016 20:29:22 +0000 (14:29 -0600)
This patch adds a helper function svga_format_is_typeless() which
returns TRUE if the specified format is typeless.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/drivers/svga/svga_format.c
src/gallium/drivers/svga/svga_format.h

index e307674..948b276 100644 (file)
@@ -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;
+   }
+}
index 70807c5..e8af40a 100644 (file)
@@ -108,4 +108,7 @@ bool
 svga_format_is_uncompressed_snorm(SVGA3dSurfaceFormat format);
 
 
+bool
+svga_format_is_typeless(SVGA3dSurfaceFormat format);
+
 #endif /* SVGA_FORMAT_H_ */