summaryrefslogtreecommitdiff
path: root/tests/general
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2015-12-17 18:22:51 -0800
committerIan Romanick <ian.d.romanick@intel.com>2016-01-12 09:49:25 -0800
commita7e165d2f6bf33ae049a6d11f294531f99a54bf5 (patch)
tree1a0a29de3fa3f0dccc6f0f33ae9d12e066949f8b /tests/general
parent83075064ed9648ad4ec616dd65028436397c8f14 (diff)
namespace-pollution: Add glCopyTexSubImage2D as an operation to test
v2: See v6 comment in first namespace-pollution commit. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363 Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'tests/general')
-rw-r--r--tests/general/object-namespace-pollution.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/general/object-namespace-pollution.c b/tests/general/object-namespace-pollution.c
index 8251817ee..7b980c1f4 100644
--- a/tests/general/object-namespace-pollution.c
+++ b/tests/general/object-namespace-pollution.c
@@ -442,6 +442,33 @@ do_CopyPixels(void)
}
static bool
+do_CopyTexSubImage2D(void)
+{
+ GLuint tex = FIRST_SPARE_OBJECT;
+
+ /* Set non-1.0 pixel zoom to avoid i965 blorp path. */
+ glPixelZoom(1.5f, 1.5f);
+
+ glBindTexture(GL_TEXTURE_2D, tex);
+
+ /* Pick GL_LUMINANCE8_ALPHA8 because most hardware can support it
+ * natively, and most hardware cannot use a blit fast path from RGB or
+ * RGBA to LA. i965 currently cannot.
+ */
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE8_ALPHA8, 16, 16, 0,
+ GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, NULL);
+
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 16, 16);
+
+ glPixelZoom(1.0f, 1.0f);
+
+ glBindTexture(GL_TEXTURE_2D, 0);
+ glDeleteTextures(1, &tex);
+
+ return piglit_check_gl_error(GL_NO_ERROR);
+}
+
+static bool
do_DrawPixels(void)
{
GLuint pixels[16 * 16];
@@ -492,6 +519,7 @@ static const struct operation {
{ "glBitmap", do_Bitmap },
{ "glClear", do_Clear },
{ "glCopyPixels", do_CopyPixels },
+ { "glCopyTexSubImage2D", do_CopyTexSubImage2D },
{ "glDrawPixels", do_DrawPixels },
{ "glGenerateMipmap", do_GenerateMipmap },
};