summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-01-04 16:08:20 -0800
committerIan Romanick <[email protected]>2012-01-04 16:52:46 -0800
commit0e52be58f05eaa5762b9a03ac860da4d9581cead (patch)
treee941fb784c4b92fd75f11fd36af3de0ae51dafc1
parenta0a0a909f21acfcddaab603079ba98266e8daf0e (diff)
mesa: Add missing GL_RG_INTEGER cases
Adds two missing '|| srcFormat == GL_RG_INTEGER' in assertions and a bunch of missing pixel converions cases. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
-rw-r--r--src/mesa/main/pack.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index 2933ff638fc..8f2c8fd974f 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -692,6 +692,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
dst[i] = (GLubyte) rgba[i][ACOMP];
}
break;
+ case GL_RG_INTEGER:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLubyte) rgba[i][RCOMP];
+ dst[i*2+1] = (GLubyte) rgba[i][GCOMP];
+ }
+ break;
case GL_RGB_INTEGER_EXT:
for (i=0;i<n;i++) {
dst[i*3+0] = (GLubyte) rgba[i][RCOMP];
@@ -843,6 +849,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
dst[i] = (GLbyte) rgba[i][ACOMP];
}
break;
+ case GL_RG_INTEGER:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLbyte) rgba[i][RCOMP];
+ dst[i*2+1] = (GLbyte) rgba[i][GCOMP];
+ }
+ break;
case GL_RGB_INTEGER_EXT:
for (i=0;i<n;i++) {
dst[i*3+0] = (GLbyte) rgba[i][RCOMP];
@@ -994,6 +1006,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
dst[i] = (GLushort) rgba[i][ACOMP];
}
break;
+ case GL_RG_INTEGER:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLushort) rgba[i][RCOMP];
+ dst[i*2+1] = (GLushort) rgba[i][GCOMP];
+ }
+ break;
case GL_RGB_INTEGER_EXT:
for (i=0;i<n;i++) {
dst[i*3+0] = (GLushort) rgba[i][RCOMP];
@@ -1145,6 +1163,13 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
dst[i] = (GLshort) rgba[i][ACOMP];
}
break;
+ case GL_RG_INTEGER:
+ for (i=0;i<n;i++) {
+ dst[i*3+0] = (GLshort) rgba[i][RCOMP];
+ dst[i*3+1] = (GLshort) rgba[i][GCOMP];
+ dst[i*3+2] = (GLshort) rgba[i][BCOMP];
+ }
+ break;
case GL_RGB_INTEGER_EXT:
for (i=0;i<n;i++) {
dst[i*3+0] = (GLshort) rgba[i][RCOMP];
@@ -1296,6 +1321,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
dst[i] = (GLuint) rgba[i][ACOMP];
}
break;
+ case GL_RG_INTEGER:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLuint) rgba[i][RCOMP];
+ dst[i*2+1] = (GLuint) rgba[i][GCOMP];
+ }
+ break;
case GL_RGB_INTEGER_EXT:
for (i=0;i<n;i++) {
dst[i*3+0] = (GLuint) rgba[i][RCOMP];
@@ -1454,6 +1485,12 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n, GLfloat rgba[][4],
dst[i] = (GLint) rgba[i][ACOMP];
}
break;
+ case GL_RG_INTEGER:
+ for (i=0;i<n;i++) {
+ dst[i*2+0] = (GLint) rgba[i][RCOMP];
+ dst[i*2+1] = (GLint) rgba[i][GCOMP];
+ }
+ break;
case GL_RGB_INTEGER_EXT:
for (i=0;i<n;i++) {
dst[i*3+0] = (GLint) rgba[i][RCOMP];
@@ -2397,6 +2434,7 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4],
srcFormat == GL_GREEN_INTEGER_EXT ||
srcFormat == GL_BLUE_INTEGER_EXT ||
srcFormat == GL_ALPHA_INTEGER_EXT ||
+ srcFormat == GL_RG_INTEGER ||
srcFormat == GL_RGB_INTEGER_EXT ||
srcFormat == GL_RGBA_INTEGER_EXT ||
srcFormat == GL_BGR_INTEGER_EXT ||
@@ -3778,6 +3816,7 @@ _mesa_unpack_color_span_float( struct gl_context *ctx,
srcFormat == GL_GREEN_INTEGER_EXT ||
srcFormat == GL_BLUE_INTEGER_EXT ||
srcFormat == GL_ALPHA_INTEGER_EXT ||
+ srcFormat == GL_RG_INTEGER ||
srcFormat == GL_RGB_INTEGER_EXT ||
srcFormat == GL_RGBA_INTEGER_EXT ||
srcFormat == GL_BGR_INTEGER_EXT ||