On 11/10/2017 12:16 PM, Charmaine Lee wrote:
From: Brian Paul <[email protected]>
Sent: Thursday, November 9, 2017 12:52 PM
To: [email protected]
Cc: Charmaine Lee; Brian Paul
Subject: [PATCH] gl-1.0-logicop: allow testing single mode on the command line
And require GL 1.1 since that's when color logicops were introduced.
Technically, we should move/rename the test, but it's hardly worth it.
---
tests/spec/gl-1.0/logicop.c | 90 +++++++++++++++++++++++++++++----------------
1 file changed, 58 insertions(+), 32 deletions(-)
diff --git a/tests/spec/gl-1.0/logicop.c b/tests/spec/gl-1.0/logicop.c
index 9ff80be..d415335 100644
--- a/tests/spec/gl-1.0/logicop.c
+++ b/tests/spec/gl-1.0/logicop.c
@@ -46,7 +46,7 @@
PIGLIT_GL_TEST_CONFIG_BEGIN
- config.supports_gl_compat_version = 10;
+ config.supports_gl_compat_version = 11;
config.window_visual = PIGLIT_GL_VISUAL_RGBA |
PIGLIT_GL_VISUAL_DOUBLE;
@@ -54,12 +54,28 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
PIGLIT_GL_TEST_CONFIG_END
-void
-piglit_init(int argc, char **argv)
-{
- srand(0);
- piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
-}
+
+static const GLenum logicop_modes[] = {
+ GL_CLEAR,
+ GL_SET,
+ GL_COPY,
+ GL_COPY_INVERTED,
+ GL_NOOP,
+ GL_INVERT,
+ GL_AND,
+ GL_NAND,
+ GL_OR,
+ GL_NOR,
+ GL_XOR,
+ GL_EQUIV,
+ GL_AND_REVERSE,
+ GL_AND_INVERTED,
+ GL_OR_REVERSE,
+ GL_OR_INVERTED
+};
+
+static GLenum test_single = 0; /* 0 = test all logicop modes */
+
static GLubyte*
random_image_data(void)
@@ -67,7 +83,7 @@ random_image_data(void)
int i;
GLubyte *img = malloc(4 * img_width * img_height * sizeof(GLubyte));
for (i = 0; i < 4 * img_width * img_height; ++i) {
- img[i] = rand() % 256;
+ img[i] = /*rand()*/ (100+i) % 256;
Is this change intentional or just a left over from debugging?
Oops, left-over from debugging. Thanks for catching that.
-Brian
Other than that,
Reviewed-by: Charmaine Lee <[email protected]>
_______________________________________________
Piglit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/piglit