summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2013-02-22 10:43:58 +0100
committerMarek Olšák <maraeo@gmail.com>2013-02-26 11:05:32 +0100
commitbed88e029c300dd227e1fdcb1e1cbdd6bd5055a1 (patch)
tree5c340f0d6c0c0812f7b02e85600d6290d83a8028
parent7cb95dc6b784faac3f5b2803586f8bb5f748f5ce (diff)
fbo-blit: test BlitFramebuffer with GL_TEXTURE_RECTANGLE
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
-rw-r--r--tests/all.tests1
-rw-r--r--tests/fbo/fbo-blit.c22
2 files changed, 18 insertions, 5 deletions
diff --git a/tests/all.tests b/tests/all.tests
index 22780260d..959507032 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1140,6 +1140,7 @@ add_concurrent_test(arb_texture_rectangle, '1-1-linear-texture')
add_plain_test(arb_texture_rectangle, 'texrect-many')
add_concurrent_test(arb_texture_rectangle, 'getteximage-targets RECT')
add_plain_test(arb_texture_rectangle, 'texrect_simple_arb_texrect')
+add_plain_test(arb_texture_rectangle, 'fbo-blit rect')
arb_texture_storage = Group()
spec['ARB_texture_storage'] = arb_texture_storage
diff --git a/tests/fbo/fbo-blit.c b/tests/fbo/fbo-blit.c
index 933a56ffe..efa06613a 100644
--- a/tests/fbo/fbo-blit.c
+++ b/tests/fbo/fbo-blit.c
@@ -52,6 +52,8 @@ PIGLIT_GL_TEST_CONFIG_END
/* size of texture/renderbuffer (power of two) */
#define FBO_SIZE 64
+static GLuint target = GL_TEXTURE_2D;
+
static GLuint
make_fbo(int w, int h)
@@ -64,17 +66,17 @@ make_fbo(int w, int h)
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);
glGenTextures(1, &tex);
- glBindTexture(GL_TEXTURE_2D, tex);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
+ glBindTexture(target, tex);
+ glTexImage2D(target, 0, GL_RGBA,
w, h, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT,
- GL_TEXTURE_2D,
+ target,
tex,
0);
assert(glGetError() == 0);
@@ -219,8 +221,18 @@ piglit_display(void)
void
piglit_init(int argc, char **argv)
{
+ int i;
+
piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
piglit_require_extension("GL_EXT_framebuffer_object");
piglit_require_extension("GL_EXT_framebuffer_blit");
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "rect") == 0) {
+ piglit_require_extension("GL_ARB_texture_rectangle");
+ target = GL_TEXTURE_RECTANGLE;
+ puts("Testing ARB_texture_rectangle");
+ }
+ }
}