svga: add new svga_format_is_uncompressed_snorm() helper
authorBrian Paul <brianp@vmware.com>
Mon, 27 Jun 2016 17:17:45 +0000 (11:17 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 30 Jun 2016 20:32:07 +0000 (14:32 -0600)
Acked-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_format.c
src/gallium/drivers/svga/svga_format.h

index 17c3bf97def61fe228914e36f33c1da196347572..1b3cebe5bc96be32a082c8c018c2d2b01c5a2090 100644 (file)
@@ -2193,3 +2193,23 @@ svga_sampler_format(SVGA3dSurfaceFormat format)
       return format;
    }
 }
+
+
+/**
+ * Is the given format an uncompressed snorm format?
+ */
+bool
+svga_format_is_uncompressed_snorm(SVGA3dSurfaceFormat format)
+{
+   switch (format) {
+   case SVGA3D_R8G8B8A8_SNORM:
+   case SVGA3D_R8G8_SNORM:
+   case SVGA3D_R8_SNORM:
+   case SVGA3D_R16G16B16A16_SNORM:
+   case SVGA3D_R16G16_SNORM:
+   case SVGA3D_R16_SNORM:
+      return true;
+   default:
+      return false;
+   }
+}
index 630a86a49b6e2e02548c7542f1e86dcda21c8c5a..e6258179745de6c7a408765e8ef04622001687c6 100644 (file)
@@ -104,4 +104,8 @@ SVGA3dSurfaceFormat
 svga_sampler_format(SVGA3dSurfaceFormat format);
 
 
+bool
+svga_format_is_uncompressed_snorm(SVGA3dSurfaceFormat format);
+
+
 #endif /* SVGA_FORMAT_H_ */