summaryrefslogtreecommitdiffstats
path: root/progs/tests
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-10-29 10:49:38 -0600
committerBrian Paul <[email protected]>2009-10-29 10:50:26 -0600
commit1e2c51702675ad8093b77c3a37ed630e311cceb2 (patch)
tree7066ad58f7f4edda312a5788ea7b16af3012a9e2 /progs/tests
parent01ee5c63d3a8334f20e3fcaf6d19ba00bddf8268 (diff)
progs/tests: also test GL_BGRA format in getteximage.c
Diffstat (limited to 'progs/tests')
-rw-r--r--progs/tests/getteximage.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/progs/tests/getteximage.c b/progs/tests/getteximage.c
index 71f29b4ac84..e4053b8de1a 100644
--- a/progs/tests/getteximage.c
+++ b/progs/tests/getteximage.c
@@ -58,6 +58,26 @@ TestGetTexImage(GLboolean npot)
abort();
}
}
+
+ /* get as BGRA */
+ glGetTexImage(GL_TEXTURE_2D, level, GL_BGRA, GL_UNSIGNED_BYTE, data2);
+
+ /* compare */
+ {
+ const GLubyte *rgba = (GLubyte *) data;
+ const GLubyte *bgra = (GLubyte *) data2;
+ for (i = 0; i < w * h; i += 4) {
+ if (rgba[i+0] != bgra[i+2] ||
+ rgba[i+1] != bgra[i+1] ||
+ rgba[i+2] != bgra[i+0] ||
+ rgba[i+3] != bgra[i+3]) {
+ printf("glTexImage + glGetTexImage(GL_BGRA) failure!\n");
+ printf("Expected value %d, found %d\n", data[i], data2[i]);
+ abort();
+ }
+ }
+ }
+
}
printf("Passed\n");