summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/pack.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2013-02-06 22:39:53 +0100
committerMarek Olšák <maraeo@gmail.com>2013-02-11 19:43:01 +0100
commitcb6470775c0139323bf889d2df2facdbc06a2b09 (patch)
treed90da215803505ba7981930442bb464c20a8596a /src/mesa/main/pack.c
parentc8379204ab0af97558871fffccdd74c60a41776a (diff)
mesa: fix GetTexImage if mesa format and internal format don't match
Tested with softpipe only exposing RGBA formats. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/main/pack.c')
-rw-r--r--src/mesa/main/pack.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index e00ae63fc0a..d976e5aae00 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -6027,6 +6027,20 @@ _mesa_rebase_rgba_float(GLuint n, GLfloat rgba[][4], GLenum baseFormat)
rgba[i][ACOMP] = 1.0F;
}
break;
+ case GL_RG:
+ for (i = 0; i < n; i++) {
+ rgba[i][BCOMP] = 0.0F;
+ rgba[i][ACOMP] = 1.0F;
+ }
+ break;
+ case GL_RED:
+ for (i = 0; i < n; i++) {
+ rgba[i][GCOMP] = 0.0F;
+ rgba[i][BCOMP] = 0.0F;
+ rgba[i][ACOMP] = 1.0F;
+ }
+ break;
+
default:
/* no-op */
;
@@ -6070,6 +6084,18 @@ _mesa_rebase_rgba_uint(GLuint n, GLuint rgba[][4], GLenum baseFormat)
rgba[i][ACOMP] = 1;
}
break;
+ case GL_RG:
+ for (i = 0; i < n; i++) {
+ rgba[i][BCOMP] = 0;
+ rgba[i][ACOMP] = 1;
+ }
+ break;
+ case GL_RED:
+ for (i = 0; i < n; i++) {
+ rgba[i][GCOMP] = 0;
+ rgba[i][BCOMP] = 0;
+ rgba[i][ACOMP] = 1;
+ }
default:
/* no-op */
;