mesa: fix broken pack_histogram() case for GLhalf
authorBrian Paul <brianp@vmware.com>
Thu, 5 Nov 2009 00:42:30 +0000 (17:42 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 5 Nov 2009 00:42:30 +0000 (17:42 -0700)
src/mesa/main/histogram.c

index ceb0d5a6a86c1970b95a70add996f4e66dd220f1..4c46f9278712c9bd8cf367d6ae5d8c800172f8bb 100644 (file)
@@ -186,16 +186,17 @@ pack_histogram( GLcontext *ctx,
          {
             /* temporarily store as GLuints */
             GLuint temp[4*HISTOGRAM_TABLE_SIZE];
-            GLhalfARB *dst = (GLhalfARB *) destination;
+            GLuint *dst = temp;
+            GLhalfARB *half = destination;
             GLuint i;
             /* get GLuint values */
             PACK_MACRO(GLuint);
             /* convert to GLhalf */
             for (i = 0; i < n * comps; i++) {
-               dst[i] = _mesa_float_to_half((GLfloat) temp[i]);
+               half[i] = _mesa_float_to_half((GLfloat) temp[i]);
             }
             if (packing->SwapBytes) {
-               _mesa_swap2((GLushort *) dst, n * comps);
+               _mesa_swap2((GLushort *) half, n * comps);
             }
          }
          break;