aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-07-01 11:33:28 +0200
committermarha <marha@users.sourceforge.net>2013-07-01 11:55:53 +0200
commit28d1f604563d9c738a4c5630364d0e6b4e9b13ff (patch)
tree1fbc6bd5cc5a1c950c6dfdf64c348f81604e9e9e /mesalib/src/gallium/auxiliary
parentced1a6b8f5a750fcd3b8d3d0d9bbdee830064e6c (diff)
downloadvcxsrv-28d1f604563d9c738a4c5630364d0e6b4e9b13ff.tar.gz
vcxsrv-28d1f604563d9c738a4c5630364d0e6b4e9b13ff.tar.bz2
vcxsrv-28d1f604563d9c738a4c5630364d0e6b4e9b13ff.zip
mesa git update 1 Jul 2013
mesa commit bf95ca7de0c02a00a75d1d5e2693a33b68ff784d
Diffstat (limited to 'mesalib/src/gallium/auxiliary')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_format.c20
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_format.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_format.c b/mesalib/src/gallium/auxiliary/util/u_format.c
index 9bdc2eabf..686ca8a89 100644
--- a/mesalib/src/gallium/auxiliary/util/u_format.c
+++ b/mesalib/src/gallium/auxiliary/util/u_format.c
@@ -131,6 +131,26 @@ util_format_is_pure_uint(enum pipe_format format)
return (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED && desc->channel[i].pure_integer) ? TRUE : FALSE;
}
+/**
+ * Returns true if all non-void channels are normalized signed.
+ */
+boolean
+util_format_is_snorm(enum pipe_format format)
+{
+ const struct util_format_description *desc = util_format_description(format);
+ int i;
+
+ if (desc->is_mixed)
+ return FALSE;
+
+ i = util_format_get_first_non_void_channel(format);
+ if (i == -1)
+ return FALSE;
+
+ return desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED &&
+ !desc->channel[i].pure_integer &&
+ desc->channel[i].normalized;
+}
boolean
util_format_is_luminance_alpha(enum pipe_format format)
diff --git a/mesalib/src/gallium/auxiliary/util/u_format.h b/mesalib/src/gallium/auxiliary/util/u_format.h
index 9774a2b4c..bb729c095 100644
--- a/mesalib/src/gallium/auxiliary/util/u_format.h
+++ b/mesalib/src/gallium/auxiliary/util/u_format.h
@@ -645,6 +645,9 @@ util_format_is_pure_sint(enum pipe_format format);
boolean
util_format_is_pure_uint(enum pipe_format format);
+boolean
+util_format_is_snorm(enum pipe_format format);
+
/**
* Check if the src format can be blitted to the destination format with
* a simple memcpy. For example, blitting from RGBA to RGBx is OK, but not