diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/framebuffer.c | 1 | ||||
-rw-r--r-- | src/mesa/main/image.c | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index af3b5dfcf9..7d55a84dfc 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -868,6 +868,7 @@ _mesa_source_buffer_exists(struct gl_context *ctx, GLenum format) case GL_LUMINANCE: case GL_LUMINANCE_ALPHA: case GL_INTENSITY: + case GL_RG: case GL_RGB: case GL_BGR: case GL_RGBA: diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index 2c3af332c0..4b5d7dadc9 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]); |