mesa: add missing cases for packing red/green images
authorBrian Paul <brianp@vmware.com>
Thu, 21 Oct 2010 22:38:18 +0000 (16:38 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 21 Oct 2010 23:05:35 +0000 (17:05 -0600)
src/mesa/main/image.c

index 2c3af332c0c2fab0823b405cf4debce909a61df7..4b5d7dadc94983d7ec9bbf5f08b2c66779f60f1a 100644 (file)
@@ -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]);