diff options
author | Dave Airlie <[email protected]> | 2012-01-29 16:25:16 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2012-01-30 13:55:15 +0000 |
commit | fef395c0c3a011cc23cc638358c116accf35b7a2 (patch) | |
tree | 7f5164f24dc1c6164e5197002ecf47ec36d946c8 /src/mesa | |
parent | 29cf90b4148ca8b625215644ef8d65a83815db11 (diff) |
mesa/format_unpack: add LUMINANCE 8/16 UINT/INT
This just copies what the LUMINANCE_ALPHA bits do.
Fixes piglit tests on softpipe complaining about missing unpack.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/format_unpack.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c index a2d88911606..cd16a9ea6d8 100644 --- a/src/mesa/main/format_unpack.c +++ b/src/mesa/main/format_unpack.c @@ -2393,6 +2393,51 @@ unpack_int_rgba_LUMINANCE_UINT32(const GLuint *src, GLuint dst[][4], GLuint n) } static void +unpack_int_rgba_LUMINANCE_UINT16(const GLushort *src, GLuint dst[][4], GLuint n) +{ + unsigned int i; + + for (i = 0; i < n; i++) { + dst[i][0] = dst[i][1] = dst[i][2] = src[i]; + dst[i][3] = 1; + } +} + +static void +unpack_int_rgba_LUMINANCE_INT16(const GLshort *src, GLuint dst[][4], GLuint n) +{ + unsigned int i; + + for (i = 0; i < n; i++) { + dst[i][0] = dst[i][1] = dst[i][2] = src[i]; + dst[i][3] = 1; + } +} + +static void +unpack_int_rgba_LUMINANCE_UINT8(const GLubyte *src, GLuint dst[][4], GLuint n) +{ + unsigned int i; + + for (i = 0; i < n; i++) { + dst[i][0] = dst[i][1] = dst[i][2] = src[i]; + dst[i][3] = 1; + } +} + +static void +unpack_int_rgba_LUMINANCE_INT8(const GLbyte *src, GLuint dst[][4], GLuint n) +{ + unsigned int i; + + for (i = 0; i < n; i++) { + dst[i][0] = dst[i][1] = dst[i][2] = src[i]; + dst[i][3] = 1; + } +} + + +static void unpack_int_rgba_LUMINANCE_ALPHA_UINT32(const GLuint *src, GLuint dst[][4], GLuint n) { unsigned int i; @@ -2618,6 +2663,19 @@ _mesa_unpack_uint_rgba_row(gl_format format, GLuint n, case MESA_FORMAT_LUMINANCE_INT32: unpack_int_rgba_LUMINANCE_UINT32(src, dst, n); break; + case MESA_FORMAT_LUMINANCE_UINT16: + unpack_int_rgba_LUMINANCE_UINT16(src, dst, n); + break; + case MESA_FORMAT_LUMINANCE_INT16: + unpack_int_rgba_LUMINANCE_INT16(src, dst, n); + break; + + case MESA_FORMAT_LUMINANCE_UINT8: + unpack_int_rgba_LUMINANCE_UINT8(src, dst, n); + break; + case MESA_FORMAT_LUMINANCE_INT8: + unpack_int_rgba_LUMINANCE_INT8(src, dst, n); + break; case MESA_FORMAT_LUMINANCE_ALPHA_UINT32: case MESA_FORMAT_LUMINANCE_ALPHA_INT32: |