arb_direct_state_access: Testing glCompressedTextureSubImage1D.

Submitted by Laura Ekstrand on Feb. 13, 2015, 11:28 p.m.

Details

Message ID 1423870110-7886-1-git-send-email-laura@jlekstrand.net
State New
Headers show

Not browsing as part of any series.

Commit Message

Laura Ekstrand Feb. 13, 2015, 11:28 p.m.
---
 .../arb_direct_state_access/compressedtexturesubimage.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_direct_state_access/compressedtexturesubimage.c b/tests/spec/arb_direct_state_access/compressedtexturesubimage.c
index 5372d10..473c3a3 100644
--- a/tests/spec/arb_direct_state_access/compressedtexturesubimage.c
+++ b/tests/spec/arb_direct_state_access/compressedtexturesubimage.c
@@ -192,6 +192,23 @@  upload_subtest(GLenum target, bool use_pbo)
 enum piglit_result
 piglit_display(void)
 {
+	/* According to the EXT_texture_compression_s3tc spec:
+	 *	"The S3TC texture compression algorithm supports only 2D
+	 *	images without borders. CompressedTexImage1DARB and
+	 *	CompressedTexImage3DARB produce an INVALID_ENUM error if
+	 *	<internalformat> is an S3TC format."
+	 *
+	 * Array textures can use CompressedTextureSubImage3D, but
+	 * CompressedTextureSubImage1D will still throw an error.  This is
+	 * because most compression formats use 2D compression, so 1D
+	 * compressed textures don't make sense.
+	 */
+	GLuint tex;
+	glCreateTextures(GL_TEXTURE_1D, 1, &tex);
+	glCompressedTextureSubImage1D(tex, 0, 0, WIDTH * HEIGHT, FORMAT,
+	                              IMAGE_SIZE, NULL);
+	subtest(piglit_check_gl_error(GL_INVALID_ENUM), "GL_TEXTURE_1D");
+
 	/* Non-PBO tests */
 	upload_subtest(GL_TEXTURE_2D, false);
 	if (piglit_is_extension_supported("GL_EXT_texture_array"))