summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaura Ekstrand <laura@jlekstrand.net>2015-02-25 15:41:32 -0800
committerLaura Ekstrand <laura@jlekstrand.net>2015-03-09 16:20:44 -0700
commit1bbc411710dbae9433e53503e911acec05c03fa8 (patch)
treeeb4ba5457a9fe86a7fe73f243e885cf580447a7c
parent1faf8845739c7b3ca2e8c5808301fe8f2ee8cdb8 (diff)
arb_direct_state_access: Test errors thrown by CopyTex[ture]SubImage*D.
-rw-r--r--tests/spec/arb_direct_state_access/texture-errors.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/spec/arb_direct_state_access/texture-errors.c b/tests/spec/arb_direct_state_access/texture-errors.c
index 438d5c328..cf2772fc2 100644
--- a/tests/spec/arb_direct_state_access/texture-errors.c
+++ b/tests/spec/arb_direct_state_access/texture-errors.c
@@ -525,6 +525,53 @@ test_compressed_tex_subimage(void)
return pass_tex && pass_texture_rect && pass_texture_bad_target;
}
+static bool
+test_copy_tex_subimage(void)
+{
+ bool pass_tex = true;
+ bool pass_texture = true;
+ GLuint tex_3D, tex_2D;
+
+ /* Call glCopyTexSubImage*D with target = 0.
+ * In Mesa Bug 89312, a dEQP test made similar calls and failed to
+ * receive GL_INVALID_ENUM. This checks to see if the situation was
+ * remedied properly.
+ */
+ glCopyTexSubImage1D(0, 0, 0, 0, 0, 32);
+ pass_tex = piglit_check_gl_error(GL_INVALID_ENUM) && pass_tex;
+
+ glCopyTexSubImage2D(0, 0, 0, 0, 0, 0, 32, 32);
+ pass_tex = piglit_check_gl_error(GL_INVALID_ENUM) && pass_tex;
+
+ glCopyTexSubImage3D(0, 0, 0, 0, 0, 0, 0, 32, 32);
+ pass_tex = piglit_check_gl_error(GL_INVALID_ENUM) && pass_tex;
+
+ piglit_report_subtest_result(pass_tex ? PIGLIT_PASS : PIGLIT_FAIL,
+ "glCopyTexSubImage*D: GL_INVALID_ENUM for target = 0");
+
+ /* Check to make sure that the behavior of
+ * glCopyTextureSubImage*D is also correct.
+ */
+ glCreateTextures(GL_TEXTURE_2D, 1, &tex_2D);
+ glCreateTextures(GL_TEXTURE_3D, 1, &tex_3D);
+
+ glCopyTextureSubImage1D(tex_2D, 0, 0, 0, 0, 32);
+ pass_texture = piglit_check_gl_error(GL_INVALID_ENUM) && pass_texture;
+
+ glCopyTextureSubImage2D(tex_3D, 0, 0, 0, 0, 0, 32, 32);
+ pass_texture = piglit_check_gl_error(GL_INVALID_ENUM) && pass_texture;
+
+ glCopyTextureSubImage3D(tex_2D, 0, 0, 0, 0, 0, 0, 32, 32);
+ pass_texture = piglit_check_gl_error(GL_INVALID_ENUM) && pass_texture;
+
+
+ piglit_report_subtest_result(pass_texture ? PIGLIT_PASS :
+ PIGLIT_FAIL,
+ "glCopyTextureSubImage*D: GL_INVALID_ENUM for bad targets");
+
+ return pass_tex && pass_texture;
+}
+
enum piglit_result
piglit_display(void)
{
@@ -547,6 +594,7 @@ piglit_display(void)
}
pass = test_compressed_tex_subimage() && pass;
+ pass = test_copy_tex_subimage() && pass;
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
}