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 | |
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>
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | framework/glsl_parser_test.py | 6 | ||||
-rw-r--r-- | tests/glslparsertest/glslparsertest.c | 21 |
3 files changed, 25 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a77a2a87a..434577ac5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -439,14 +439,14 @@ install ( install ( DIRECTORY tests DESTINATION ${PIGLIT_INSTALL_LIBDIR} - FILES_MATCHING REGEX ".*\\.(py|program_test|shader_test|frag|vert|geom|ktx|cl|txt|vpfp)$" + FILES_MATCHING REGEX ".*\\.(py|program_test|shader_test|frag|vert|geom|tesc|tese|ktx|cl|txt|vpfp)$" REGEX "CMakeFiles|CMakeLists" EXCLUDE ) install ( DIRECTORY ${CMAKE_BINARY_DIR}/generated_tests DESTINATION ${PIGLIT_INSTALL_LIBDIR} - FILES_MATCHING REGEX ".*\\.(shader_test|program_test|frag|vert|geom|cl|txt)$" + FILES_MATCHING REGEX ".*\\.(shader_test|program_test|frag|vert|geom|tesc|tese|cl|txt)$" REGEX "CMakeFiles|CMakeLists" EXCLUDE ) diff --git a/framework/glsl_parser_test.py b/framework/glsl_parser_test.py index 4c1da4903..27fd2ca36 100644 --- a/framework/glsl_parser_test.py +++ b/framework/glsl_parser_test.py @@ -56,7 +56,7 @@ def import_glsl_parser_tests(group, basepath, subdirectories): for f in filenames: # Add f as a test if its file extension is good. ext = f.rsplit('.')[-1] - if ext in ['vert', 'geom', 'frag', 'comp']: + if ext in ['vert', 'tesc', 'tese', 'geom', 'frag', 'comp']: filepath = path.join(dirpath, f) # testname := filepath relative to # basepath. @@ -76,8 +76,8 @@ class GLSLParserTest(PiglitTest): to sort in the profile. Arguments: - filepath -- the path to a glsl_parser_test which must end in .frag, .vert, - or .geom + filepath -- the path to a glsl_parser_test which must end in .vert, + .tesc, .tese, .geom or .frag """ def __init__(self, filepath): 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 |