summaryrefslogtreecommitdiffstats
path: root/progs/tests/getteximage.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2010-01-08 15:42:57 +0000
committerJosé Fonseca <[email protected]>2010-01-08 15:42:57 +0000
commit080c40ab32b2abd6d8381b4a0cc143d36a1652b2 (patch)
treee173767ebc5a82d81b9fc086449d915e29348976 /progs/tests/getteximage.c
parent9cdf6f025b2ed55cfb13dd09f870f01d0c7947d3 (diff)
parenta1de400e8de06a80ab140bb0fa950e990607572d (diff)
Merge remote branch 'origin/master' into lp-binning
Conflicts: src/gallium/auxiliary/util/u_surface.c src/gallium/drivers/llvmpipe/Makefile src/gallium/drivers/llvmpipe/SConscript src/gallium/drivers/llvmpipe/lp_bld_arit.c src/gallium/drivers/llvmpipe/lp_bld_flow.c src/gallium/drivers/llvmpipe/lp_bld_interp.c src/gallium/drivers/llvmpipe/lp_clear.c src/gallium/drivers/llvmpipe/lp_context.c src/gallium/drivers/llvmpipe/lp_context.h src/gallium/drivers/llvmpipe/lp_draw_arrays.c src/gallium/drivers/llvmpipe/lp_jit.c src/gallium/drivers/llvmpipe/lp_jit.h src/gallium/drivers/llvmpipe/lp_prim_vbuf.c src/gallium/drivers/llvmpipe/lp_setup.c src/gallium/drivers/llvmpipe/lp_setup_point.c src/gallium/drivers/llvmpipe/lp_state.h src/gallium/drivers/llvmpipe/lp_state_blend.c src/gallium/drivers/llvmpipe/lp_state_derived.c src/gallium/drivers/llvmpipe/lp_state_fs.c src/gallium/drivers/llvmpipe/lp_state_sampler.c src/gallium/drivers/llvmpipe/lp_state_surface.c src/gallium/drivers/llvmpipe/lp_tex_cache.c src/gallium/drivers/llvmpipe/lp_tex_cache.h src/gallium/drivers/llvmpipe/lp_tex_sample.h src/gallium/drivers/llvmpipe/lp_tile_cache.c
Diffstat (limited to 'progs/tests/getteximage.c')
-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");