mesa: Branch 'master' - 2 commits

Brian Paul brianp at kemper.freedesktop.org
Thu Mar 15 15:03:08 UTC 2007


 src/mesa/main/image.c |   37 +++++++++++++++++--------------------
 1 files changed, 17 insertions(+), 20 deletions(-)

New commits:
diff-tree 90563d39cbdae552f498285125381c8c8ccb2f83 (from parents)
Merge: 0cfdf432e4efe6662c6cea013a6870a4f82cb478 4a7fe4fcfa9069043db3ba8e88a6b941788f5f43
Author: Brian <brian at yutani.localnet.net>
Date:   Thu Mar 15 09:03:03 2007 -0600

    Merge branch 'master' of git+ssh://brianp@git.freedesktop.org/git/mesa/mesa

diff-tree 0cfdf432e4efe6662c6cea013a6870a4f82cb478 (from 32d196820f5669a03bfd1adde1352b857ffda3b6)
Author: Brian <brian at yutani.localnet.net>
Date:   Thu Mar 15 09:02:14 2007 -0600

    implement byteswapping for all multi-byte types in _mesa_pack_rgba_span_float(), bug 10298

diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index cdcf498..f53730c 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,8 +1,8 @@
 /*
  * Mesa 3-D graphics library
- * Version:  6.5.2
+ * Version:  6.5.3
  *
- * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -1454,9 +1454,6 @@ _mesa_pack_rgba_span_float(GLcontext *ct
                default:
                   _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
             }
-            if (dstPacking->SwapBytes) {
-               _mesa_swap2( (GLushort *) dst, n * comps);
-            }
          }
          break;
       case GL_SHORT:
@@ -1530,9 +1527,6 @@ _mesa_pack_rgba_span_float(GLcontext *ct
                default:
                   _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
             }
-            if (dstPacking->SwapBytes) {
-               _mesa_swap2( (GLushort *) dst, n * comps );
-            }
          }
          break;
       case GL_UNSIGNED_INT:
@@ -1606,9 +1600,6 @@ _mesa_pack_rgba_span_float(GLcontext *ct
                default:
                   _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
             }
-            if (dstPacking->SwapBytes) {
-               _mesa_swap4( (GLuint *) dst, n * comps );
-            }
          }
          break;
       case GL_INT:
@@ -1682,9 +1673,6 @@ _mesa_pack_rgba_span_float(GLcontext *ct
                default:
                   _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
             }
-            if (dstPacking->SwapBytes) {
-               _mesa_swap4( (GLuint *) dst, n * comps );
-            }
          }
          break;
       case GL_FLOAT:
@@ -1758,9 +1746,6 @@ _mesa_pack_rgba_span_float(GLcontext *ct
                default:
                   _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
             }
-            if (dstPacking->SwapBytes) {
-               _mesa_swap4( (GLuint *) dst, n * comps );
-            }
          }
          break;
       case GL_HALF_FLOAT_ARB:
@@ -1834,9 +1819,6 @@ _mesa_pack_rgba_span_float(GLcontext *ct
                default:
                   _mesa_problem(ctx, "bad format in _mesa_pack_rgba_span\n");
             }
-            if (dstPacking->SwapBytes) {
-               _mesa_swap2( (GLushort *) dst, n * comps );
-            }
          }
          break;
       case GL_UNSIGNED_BYTE_3_3_2:
@@ -2113,6 +2095,21 @@ _mesa_pack_rgba_span_float(GLcontext *ct
          break;
       default:
          _mesa_problem(ctx, "bad type in _mesa_pack_rgba_span_float");
+         return;
+   }
+
+   if (dstPacking->SwapBytes) {
+      GLint swapSize = _mesa_sizeof_packed_type(dstType);
+      if (swapSize == 2) {
+         if (dstPacking->SwapBytes) {
+            _mesa_swap2((GLushort *) dstAddr, n * comps);
+         }
+      }
+      else if (swapSize == 4) {
+         if (dstPacking->SwapBytes) {
+            _mesa_swap4((GLuint *) dstAddr, n * comps);
+         }
+      }
    }
 }
 



More information about the mesa-commit mailing list