[Piglit] [PATCH 05/16] namespace-pollution: Add glCopyTexSubImage2D as an operation to test
Ian Romanick
idr at freedesktop.org
Wed Jan 6 16:53:05 PST 2016
From: Ian Romanick <ian.d.romanick at intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
---
tests/all.py | 2 +-
tests/general/object-namespace-pollution.c | 33 ++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/tests/all.py b/tests/all.py
index 4ffe824..9222c3b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4609,7 +4609,7 @@ with profile.group_manager(
PiglitGLTest,
grouptools.join('object namespace pollution')) as g:
for object_type in ("buffer", "texture"):
- for operation in ("glBitmap", "glClear", "glCopyPixels", "glDrawPixels", "glGenerateMipmap"):
+ for operation in ("glBitmap", "glClear", "glCopyPixels", "glCopyTexSubImage2D", "glDrawPixels", "glGenerateMipmap"):
g(['object-namespace-pollution', operation, object_type],
'{} with {}'.format(object_type, operation))
diff --git a/tests/general/object-namespace-pollution.c b/tests/general/object-namespace-pollution.c
index 973f997..d3c97d3 100644
--- a/tests/general/object-namespace-pollution.c
+++ b/tests/general/object-namespace-pollution.c
@@ -465,6 +465,38 @@ do_CopyPixels(bool silent_skip)
}
static bool
+do_CopyTexSubImage2D(bool silent_skip)
+{
+ GLuint tex = FIRST_SPARE_OBJECT;
+
+ /* glCopyTexSubImage2D is always supported, so there is no opportunity
+ * to skip.
+ */
+ (void) silent_skip;
+
+ /* 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(bool silent_skip)
{
GLuint pixels[16 * 16];
@@ -523,6 +555,7 @@ static const struct {
{ "glBitmap", do_Bitmap },
{ "glClear", do_Clear },
{ "glCopyPixels", do_CopyPixels },
+ { "glCopyTexSubImage2D", do_CopyTexSubImage2D },
{ "glDrawPixels", do_DrawPixels },
{ "glGenerateMipmap", do_GenerateMipmap },
};
--
2.5.0
More information about the Piglit
mailing list