<div dir="ltr">You should fix the commit message to be _mesa_is_enum_format_snorm (you forgot the beginning underscore). Other than that, looks good.<br><div><br>Reviewed-by: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com" target="_blank">jason.ekstrand@intel.com</a>><br>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 6, 2014 at 4:57 PM, Anuj Phogat <span dir="ltr"><<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Cc: <<a href="mailto:mesa-stable@lists.freedesktop.org" target="_blank">mesa-stable@lists.freedesktop.org</a>><br>
Signed-off-by: Anuj Phogat <<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>><br>
---<br>
src/mesa/main/glformats.c | 37 +++++++++++++++++++++++++++++++++++++<br>
src/mesa/main/glformats.h | 3 +++<br>
2 files changed, 40 insertions(+)<br>
<br>
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c<br>
index 9bb341c..05a3842 100644<br>
--- a/src/mesa/main/glformats.c<br>
+++ b/src/mesa/main/glformats.c<br>
@@ -355,6 +355,43 @@ _mesa_bytes_per_vertex_attrib(GLint comps, GLenum type)<br>
}<br>
}<br>
<br>
+/**<br>
+ * Test if the given format is a SNORM (signed-normalized) format.<br>
+ */<br>
+GLboolean<br>
+_mesa_is_enum_format_snorm(GLenum format)<br>
+{<br>
+ switch (format) {<br>
+ /* signed, normalized texture formats */<br>
+ case GL_RED_SNORM:<br>
+ case GL_R8_SNORM:<br>
+ case GL_R16_SNORM:<br>
+ case GL_RG_SNORM:<br>
+ case GL_RG8_SNORM:<br>
+ case GL_RG16_SNORM:<br>
+ case GL_RGB_SNORM:<br>
+ case GL_RGB8_SNORM:<br>
+ case GL_RGB16_SNORM:<br>
+ case GL_RGBA_SNORM:<br>
+ case GL_RGBA8_SNORM:<br>
+ case GL_RGBA16_SNORM:<br>
+ case GL_ALPHA_SNORM:<br>
+ case GL_ALPHA8_SNORM:<br>
+ case GL_ALPHA16_SNORM:<br>
+ case GL_LUMINANCE_SNORM:<br>
+ case GL_LUMINANCE8_SNORM:<br>
+ case GL_LUMINANCE16_SNORM:<br>
+ case GL_LUMINANCE_ALPHA_SNORM:<br>
+ case GL_LUMINANCE8_ALPHA8_SNORM:<br>
+ case GL_LUMINANCE16_ALPHA16_SNORM:<br>
+ case GL_INTENSITY_SNORM:<br>
+ case GL_INTENSITY8_SNORM:<br>
+ case GL_INTENSITY16_SNORM:<br>
+ return GL_TRUE;<br>
+ default:<br>
+ return GL_FALSE;<br>
+ }<br>
+}<br>
<br>
/**<br>
* Test if the given format is an integer (non-normalized) format.<br>
diff --git a/src/mesa/main/glformats.h b/src/mesa/main/glformats.h<br>
index 5c3b2e3..d4856e5 100644<br>
--- a/src/mesa/main/glformats.h<br>
+++ b/src/mesa/main/glformats.h<br>
@@ -60,6 +60,9 @@ extern GLboolean<br>
_mesa_is_type_unsigned(GLenum type);<br>
<br>
extern GLboolean<br>
+_mesa_is_enum_format_snorm(GLenum format);<br>
+<br>
+extern GLboolean<br>
_mesa_is_enum_format_integer(GLenum format);<br>
<br>
extern GLboolean<br>
<span><font color="#888888">--<br>
1.8.3.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div></div>