Mesa (master): mesa: Fix a couple of missed conversion to arrays in format_unpack.
Eric Anholt
anholt at kemper.freedesktop.org
Wed Nov 16 01:39:07 UTC 2011
Module: Mesa
Branch: master
Commit: d4df6318a1014ad99149fd13d0d90ef6c0c0fb31
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d4df6318a1014ad99149fd13d0d90ef6c0c0fb31
Author: Eric Anholt <eric at anholt.net>
Date: Tue Nov 15 12:22:15 2011 -0800
mesa: Fix a couple of missed conversion to arrays in format_unpack.
Fixes regression in piglit:
ARB_color_buffer_float/GL_RGBA16F-getteximage
ARB_color_buffer_float/GL_RGBA16F-readpixels
ARB_color_buffer_float/GL_RGBA32F-getteximage
ARB_color_buffer_float/GL_RGBA32F-readpixels
Reviewed-by: Brian Paul <brianp at vmware.com>
---
src/mesa/main/format_unpack.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index af89be9..6e2ce7a 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -790,10 +790,10 @@ unpack_RGBA_FLOAT32(const void *src, GLfloat dst[][4], GLuint n)
const GLfloat *s = (const GLfloat *) src;
GLuint i;
for (i = 0; i < n; i++) {
- dst[i][RCOMP] = s[0];
- dst[i][GCOMP] = s[1];
- dst[i][BCOMP] = s[2];
- dst[i][ACOMP] = s[3];
+ dst[i][RCOMP] = s[i*4+0];
+ dst[i][GCOMP] = s[i*4+1];
+ dst[i][BCOMP] = s[i*4+2];
+ dst[i][ACOMP] = s[i*4+3];
}
}
@@ -803,10 +803,10 @@ unpack_RGBA_FLOAT16(const void *src, GLfloat dst[][4], GLuint n)
const GLhalfARB *s = (const GLhalfARB *) src;
GLuint i;
for (i = 0; i < n; i++) {
- dst[i][RCOMP] = _mesa_half_to_float(s[0]);
- dst[i][GCOMP] = _mesa_half_to_float(s[1]);
- dst[i][BCOMP] = _mesa_half_to_float(s[2]);
- dst[i][ACOMP] = _mesa_half_to_float(s[3]);
+ dst[i][RCOMP] = _mesa_half_to_float(s[i*4+0]);
+ dst[i][GCOMP] = _mesa_half_to_float(s[i*4+1]);
+ dst[i][BCOMP] = _mesa_half_to_float(s[i*4+2]);
+ dst[i][ACOMP] = _mesa_half_to_float(s[i*4+3]);
}
}
@@ -816,9 +816,9 @@ unpack_RGB_FLOAT32(const void *src, GLfloat dst[][4], GLuint n)
const GLfloat *s = (const GLfloat *) src;
GLuint i;
for (i = 0; i < n; i++) {
- dst[i][RCOMP] = s[0];
- dst[i][GCOMP] = s[1];
- dst[i][BCOMP] = s[2];
+ dst[i][RCOMP] = s[i*3+0];
+ dst[i][GCOMP] = s[i*3+1];
+ dst[i][BCOMP] = s[i*3+2];
dst[i][ACOMP] = 1.0F;
}
}
More information about the mesa-commit
mailing list