Mesa (master): mesa: Add warning to _REV pack/ unpack functions with incorrect behavior

Marek Olšák mareko at kemper.freedesktop.org
Thu Jan 30 23:56:54 UTC 2014


Module: Mesa
Branch: master
Commit: 34a8a0820fa08037acd0e4fbc368d72c1a6209f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=34a8a0820fa08037acd0e4fbc368d72c1a6209f1

Author: Mark Mueller <markkmueller at gmail.com>
Date:   Sun Jan 26 10:43:23 2014 -0800

mesa: Add warning to _REV pack/unpack functions with incorrect behavior

Signed-off-by: Mark Mueller <MarkKMueller at gmail.com>
Signed-off-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/main/format_pack.c   |    7 ++++++-
 src/mesa/main/format_unpack.c |   12 ++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
index b6344fd..dee253c 100644
--- a/src/mesa/main/format_pack.c
+++ b/src/mesa/main/format_pack.c
@@ -492,6 +492,8 @@ pack_row_float_RGB565(GLuint n, const GLfloat src[][4], void *dst)
 
 /*
  * MESA_FORMAT_R5G6B5_UNORM
+ * Warning: these functions do not match the current Mesa definition
+ * of MESA_FORMAT_R5G6B5_UNORM.
  */
 
 static void
@@ -621,7 +623,10 @@ pack_float_ARGB1555(const GLfloat src[4], void *dst)
 }
 
 
-/* MESA_FORMAT_A1R5G5B5_UNORM */
+/* MESA_FORMAT_A1R5G5B5_UNORM
+ * Warning: these functions do not match the current Mesa definition
+ * of MESA_FORMAT_A1R5G5B5_UNORM.
+ */
 
 static void
 pack_ubyte_ARGB1555_REV(const GLubyte src[4], void *dst)
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index a2e3445..02ad00a 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -234,6 +234,9 @@ unpack_RGB565(const void *src, GLfloat dst[][4], GLuint n)
 static void
 unpack_RGB565_REV(const void *src, GLfloat dst[][4], GLuint n)
 {
+   /* Warning: this function does not match the current Mesa definition
+    * of MESA_FORMAT_R5G6B5_UNORM.
+    */
    const GLushort *s = ((const GLushort *) src);
    GLuint i;
    for (i = 0; i < n; i++) {
@@ -300,6 +303,9 @@ unpack_ARGB1555(const void *src, GLfloat dst[][4], GLuint n)
 static void
 unpack_ARGB1555_REV(const void *src, GLfloat dst[][4], GLuint n)
 {
+   /* Warning: this function does not match the current Mesa definition
+    * of MESA_FORMAT_A1R5G5B5_UNORM.
+    */
    const GLushort *s = ((const GLushort *) src);
    GLuint i;
    for (i = 0; i < n; i++) {
@@ -2699,6 +2705,9 @@ unpack_ubyte_RGB565(const void *src, GLubyte dst[][4], GLuint n)
 static void
 unpack_ubyte_RGB565_REV(const void *src, GLubyte dst[][4], GLuint n)
 {
+   /* Warning: this function does not match the current Mesa definition
+    * of MESA_FORMAT_R5G6B5_UNORM.
+    */
    const GLushort *s = ((const GLushort *) src);
    GLuint i;
    for (i = 0; i < n; i++) {
@@ -2765,6 +2774,9 @@ unpack_ubyte_ARGB1555(const void *src, GLubyte dst[][4], GLuint n)
 static void
 unpack_ubyte_ARGB1555_REV(const void *src, GLubyte dst[][4], GLuint n)
 {
+   /* Warning: this function does not match the current Mesa definition
+    * of MESA_FORMAT_A1R5G5B5_UNORM.
+    */
    const GLushort *s = ((const GLushort *) src);
    GLuint i;
    for (i = 0; i < n; i++) {




More information about the mesa-commit mailing list