diff options
author | Brian Paul <[email protected]> | 2010-10-21 16:38:18 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-10-21 17:05:35 -0600 |
commit | d4a296caaabfe608fc2b9b3e3c7188249cc2b402 (patch) | |
tree | e046bb97b877e97ec08402b9668a8ab257cb25a5 /src/mesa/main/image.c | |
parent | d4c1bcce44add7642e857237dfe69bf1fc4511d9 (diff) |
mesa: add missing cases for packing red/green images
Diffstat (limited to 'src/mesa/main/image.c')
-rw-r--r-- | src/mesa/main/image.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 2c3af332c0c..4b5d7dadc94 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -2107,6 +2107,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], dst[i*2+1] = FLOAT_TO_UBYTE(rgba[i][ACOMP]); } break; + case GL_RG: + for (i=0;i<n;i++) { + dst[i*2+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]); + dst[i*2+1] = FLOAT_TO_UBYTE(rgba[i][GCOMP]); + } + break; case GL_RGB: for (i=0;i<n;i++) { dst[i*3+0] = FLOAT_TO_UBYTE(rgba[i][RCOMP]); @@ -2187,6 +2193,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], dst[i*2+1] = FLOAT_TO_BYTE(rgba[i][ACOMP]); } break; + case GL_RG: + for (i=0;i<n;i++) { + dst[i*2+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]); + dst[i*2+1] = FLOAT_TO_BYTE(rgba[i][GCOMP]); + } + break; case GL_RGB: for (i=0;i<n;i++) { dst[i*3+0] = FLOAT_TO_BYTE(rgba[i][RCOMP]); @@ -2267,6 +2279,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], CLAMPED_FLOAT_TO_USHORT(dst[i*2+1], rgba[i][ACOMP]); } break; + case GL_RG: + for (i=0;i<n;i++) { + CLAMPED_FLOAT_TO_USHORT(dst[i*2+0], rgba[i][RCOMP]); + CLAMPED_FLOAT_TO_USHORT(dst[i*2+1], rgba[i][GCOMP]); + } + break; case GL_RGB: for (i=0;i<n;i++) { CLAMPED_FLOAT_TO_USHORT(dst[i*3+0], rgba[i][RCOMP]); @@ -2347,6 +2365,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], dst[i*2+1] = FLOAT_TO_SHORT(rgba[i][ACOMP]); } break; + case GL_RG: + for (i=0;i<n;i++) { + dst[i*2+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]); + dst[i*2+1] = FLOAT_TO_SHORT(rgba[i][GCOMP]); + } + break; case GL_RGB: for (i=0;i<n;i++) { dst[i*3+0] = FLOAT_TO_SHORT(rgba[i][RCOMP]); @@ -2427,6 +2451,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], dst[i*2+1] = FLOAT_TO_UINT(rgba[i][ACOMP]); } break; + case GL_RG: + for (i=0;i<n;i++) { + dst[i*2+0] = FLOAT_TO_UINT(rgba[i][RCOMP]); + dst[i*2+1] = FLOAT_TO_UINT(rgba[i][GCOMP]); + } + break; case GL_RGB: for (i=0;i<n;i++) { dst[i*3+0] = FLOAT_TO_UINT(rgba[i][RCOMP]); @@ -2507,6 +2537,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], dst[i*2+1] = FLOAT_TO_INT(rgba[i][ACOMP]); } break; + case GL_RG: + for (i=0;i<n;i++) { + dst[i*2+0] = FLOAT_TO_INT(rgba[i][RCOMP]); + dst[i*2+1] = FLOAT_TO_INT(rgba[i][GCOMP]); + } + break; case GL_RGB: for (i=0;i<n;i++) { dst[i*3+0] = FLOAT_TO_INT(rgba[i][RCOMP]); @@ -2587,6 +2623,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], dst[i*2+1] = rgba[i][ACOMP]; } break; + case GL_RG: + for (i=0;i<n;i++) { + dst[i*2+0] = rgba[i][RCOMP]; + dst[i*2+1] = rgba[i][GCOMP]; + } + break; case GL_RGB: for (i=0;i<n;i++) { dst[i*3+0] = rgba[i][RCOMP]; @@ -2667,6 +2709,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4], dst[i*2+1] = _mesa_float_to_half(rgba[i][ACOMP]); } break; + case GL_RG: + for (i=0;i<n;i++) { + dst[i*2+0] = _mesa_float_to_half(rgba[i][RCOMP]); + dst[i*2+1] = _mesa_float_to_half(rgba[i][GCOMP]); + } + break; case GL_RGB: for (i=0;i<n;i++) { dst[i*3+0] = _mesa_float_to_half(rgba[i][RCOMP]); |