[Piglit] [PATCH] tests: intel_conservative_rasterization: fix invalid draws
Lionel Landwerlin
lionel.g.landwerlin at intel.com
Tue Jul 10 18:39:25 UTC 2018
In a12310df3bdd0a we realized that
intel_conservative_rasterization-invalid_gles3 was not added to the
test list. Turns out we didn't even run this test on gles.
Although quite a few cases are opengl specific, there are still 2
invalid cases we can verify on gles.
Fixes: a12310df3bdd0a ("tests/opengl: Add intel_conservative_rasterization-invalid_gles3")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
.../intel_conservative_rasterization/invalid.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/tests/spec/intel_conservative_rasterization/invalid.c b/tests/spec/intel_conservative_rasterization/invalid.c
index 1e7181628..7ae43f664 100644
--- a/tests/spec/intel_conservative_rasterization/invalid.c
+++ b/tests/spec/intel_conservative_rasterization/invalid.c
@@ -35,6 +35,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
#if defined(PIGLIT_USE_OPENGL)
config.supports_gl_core_version = 42;
+#elif defined(PIGLIT_USE_OPENGL_ES3)
+ config.supports_gl_es_version = 31;
#endif
PIGLIT_GL_TEST_CONFIG_END
@@ -52,6 +54,9 @@ void piglit_init(int argc, char **argv)
GLuint prog = piglit_build_simple_program(
#if defined(PIGLIT_USE_OPENGL)
"#version 330\n"
+#elif defined(PIGLIT_USE_OPENGL_ES3)
+ "#version 310 es\n"
+ "precision highp float;\n"
#endif
"in vec4 piglit_vertex;\n"
"void main()\n"
@@ -60,8 +65,13 @@ void piglit_init(int argc, char **argv)
"}\n",
#if defined(PIGLIT_USE_OPENGL)
"#version 330\n"
- "out vec4 color;\n"
+#elif defined(PIGLIT_USE_OPENGL_ES3)
+ "#version 310 es\n"
+ "precision highp float;\n"
#endif
+ "\n"
+ "out vec4 color;\n"
+ "\n"
"void main()\n"
"{\n"
" color = vec4(1.0, 0.0, 0.0, 1.0);\n"
@@ -89,7 +99,9 @@ void piglit_init(int argc, char **argv)
glEnableVertexAttribArray(0);
glEnable(GL_CONSERVATIVE_RASTERIZATION_INTEL);
+#ifdef PIGLIT_USE_OPENGL
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+#endif
glClear(GL_COLOR_BUFFER_BIT);
glDrawArrays(GL_POINTS, 0, 3);
@@ -100,6 +112,7 @@ void piglit_init(int argc, char **argv)
if (!piglit_check_gl_error(GL_INVALID_OPERATION))
piglit_report_result(PIGLIT_FAIL);
+#ifdef PIGLIT_USE_OPENGL
glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
glDrawArrays(GL_LINES, 0, 3);
if (!piglit_check_gl_error(GL_INVALID_OPERATION))
@@ -109,6 +122,7 @@ void piglit_init(int argc, char **argv)
glDrawArrays(GL_LINES, 0, 3);
if (!piglit_check_gl_error(GL_INVALID_OPERATION))
piglit_report_result(PIGLIT_FAIL);
+#endif
piglit_report_result(PIGLIT_PASS);
}
--
2.18.0
More information about the Piglit
mailing list