[Mesa-dev] [PATCH 08/16] svga: add new svga_format_is_uncompressed_snorm() helper

Brian Paul brianp at vmware.com
Tue Jun 28 23:52:12 UTC 2016


---
 src/gallium/drivers/svga/svga_format.c | 20 ++++++++++++++++++++
 src/gallium/drivers/svga/svga_format.h |  4 ++++
 2 files changed, 24 insertions(+)

diff --git a/src/gallium/drivers/svga/svga_format.c b/src/gallium/drivers/svga/svga_format.c
index 17c3bf9..1b3cebe 100644
--- a/src/gallium/drivers/svga/svga_format.c
+++ b/src/gallium/drivers/svga/svga_format.c
@@ -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;
+   }
+}
diff --git a/src/gallium/drivers/svga/svga_format.h b/src/gallium/drivers/svga/svga_format.h
index 630a86a..e6258179 100644
--- a/src/gallium/drivers/svga/svga_format.h
+++ b/src/gallium/drivers/svga/svga_format.h
@@ -104,4 +104,8 @@ SVGA3dSurfaceFormat
 svga_sampler_format(SVGA3dSurfaceFormat format);
 
 
+bool
+svga_format_is_uncompressed_snorm(SVGA3dSurfaceFormat format);
+
+
 #endif /* SVGA_FORMAT_H_ */
-- 
1.9.1



More information about the mesa-dev mailing list