diff options
author | Fabian Bieler <fabianbieler@fastmail.fm> | 2014-02-21 10:40:13 +0100 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2014-06-03 21:53:12 -0700 |
commit | 07cb608f6a7ad3d1c018527b2cf38592ad782fc0 (patch) | |
tree | 4b60cb2cf88869bc306adfce9bbefdfbe60d2928 /tests/glslparsertest/glslparsertest.c | |
parent | c2f279cf4545a978811f14bba126885db5551237 (diff) |
glslparsertest: Support tessellation shaders.
V2: Add .tesc and .tese files to installation parameters of generated_tests
and tests.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'tests/glslparsertest/glslparsertest.c')
-rw-r--r-- | tests/glslparsertest/glslparsertest.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c index edce51a0b..3511de185 100644 --- a/tests/glslparsertest/glslparsertest.c +++ b/tests/glslparsertest/glslparsertest.c @@ -128,6 +128,10 @@ get_shader_name(GLenum type) switch(type) { case GL_VERTEX_SHADER: return "vertex"; + case GL_TESS_CONTROL_SHADER: + return "tessellation control"; + case GL_TESS_EVALUATION_SHADER: + return "tessellation evaluation"; case GL_GEOMETRY_SHADER: return "geometry"; case GL_FRAGMENT_SHADER: @@ -223,6 +227,10 @@ test(void) else if (strcmp(filename + strlen(filename) - 4, "vert") == 0) type = GL_VERTEX_SHADER; #ifdef PIGLIT_USE_OPENGL + else if (strcmp(filename + strlen(filename) - 4, "tesc") == 0) + type = GL_TESS_CONTROL_SHADER; + else if (strcmp(filename + strlen(filename) - 4, "tese") == 0) + type = GL_TESS_EVALUATION_SHADER; else if (strcmp(filename + strlen(filename) - 4, "geom") == 0) type = GL_GEOMETRY_SHADER; else if (strcmp(filename + strlen(filename) - 4, "comp") == 0) @@ -238,6 +246,15 @@ test(void) piglit_require_vertex_shader(); piglit_require_fragment_shader(); + if (type == GL_TESS_CONTROL_SHADER || type == GL_TESS_EVALUATION_SHADER) { + if (!piglit_is_extension_supported("GL_ARB_tessellation_shader") && + (piglit_is_gles() || piglit_get_gl_version() < 40)) { + printf("Test requires GL version 4.0 or " + "GL_ARB_tessellation_shader\n"); + piglit_report_result(PIGLIT_SKIP); + } + } + if (type == GL_COMPUTE_SHADER) { if (!piglit_is_extension_supported("GL_ARB_compute_shader") && (piglit_is_gles() || piglit_get_gl_version() < 43)) { @@ -281,7 +298,9 @@ test(void) if (requested_version == 100 || requested_version == 300) attach_complementary_shader(shader_prog, type); #if PIGLIT_USE_OPENGL - if (type == GL_GEOMETRY_SHADER) + if (type == GL_GEOMETRY_SHADER || + type == GL_TESS_CONTROL_SHADER || + type == GL_TESS_EVALUATION_SHADER) attach_dummy_shader(shader_prog, GL_VERTEX_SHADER); if (test_requires_geometry_shader4) { /* The default value of |