diff options
author | Anuj Phogat <anuj.phogat@gmail.com> | 2014-01-28 12:46:06 -0800 |
---|---|---|
committer | Anuj Phogat <anuj.phogat@gmail.com> | 2014-01-30 10:23:12 -0800 |
commit | cb77598981956894ee2559f04344b02dad395908 (patch) | |
tree | 6bdbbac71d1ea9225b8807f86ca98f7b51feaa59 /tests/glslparsertest | |
parent | 454fae4a55420f1dcf2b03621307c921d74f5bc5 (diff) |
glslparsertest: Support geometry and compute shader in {compile, link} status
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'tests/glslparsertest')
-rw-r--r-- | tests/glslparsertest/glslparsertest.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c index 59571448f..18bd0627f 100644 --- a/tests/glslparsertest/glslparsertest.c +++ b/tests/glslparsertest/glslparsertest.c @@ -122,6 +122,24 @@ get_shader_info_log_length(GLuint shader) return length; } +static char* +get_shader_name(GLenum type) +{ + switch(type) { + case GL_VERTEX_SHADER: + return "vertex"; + case GL_GEOMETRY_SHADER: + return "geometry"; + case GL_FRAGMENT_SHADER: + return "fragment"; + case GL_COMPUTE_SHADER: + return "compute"; + default: + fprintf(stderr, "Unexpected type in get_shader_name()\n"); + piglit_report_result(PIGLIT_FAIL); + } + return NULL; +} /** * Attach a dumy shader of the given type. @@ -295,7 +313,7 @@ test(void) if (!ok) { fprintf(out, "Failed to %s %s shader %s: %s\n", failing_stage, - type == GL_FRAGMENT_SHADER ? "fragment" : "vertex", + get_shader_name(type), filename, info); if (expected_pass) { printf("Shader source:\n"); @@ -304,7 +322,7 @@ test(void) } else { fprintf(out, "Successfully %s %s shader %s: %s\n", check_link ? "compiled and linked" : "compiled", - type == GL_FRAGMENT_SHADER ? "fragment" : "vertex", + get_shader_name(type), filename, info); if (!expected_pass) { printf("Shader source:\n"); |