aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-06-27 11:17:45 -0600
committerBrian Paul <[email protected]>2016-06-30 14:32:07 -0600
commit46e7355a13927b4a2f082358c417881d66c97982 (patch)
tree9c0d734fdc09b844af390c488c8e9af55bab2aa5 /src/gallium/drivers/svga
parent68388043f3280bbac9383721e37f8ca7685b7f01 (diff)
svga: add new svga_format_is_uncompressed_snorm() helper
Acked-by: Roland Scheidegger <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_format.c20
-rw-r--r--src/gallium/drivers/svga/svga_format.h4
2 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_format.c b/src/gallium/drivers/svga/svga_format.c
index 17c3bf97def..1b3cebe5bc9 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 630a86a49b6..e6258179745 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_ */