Commit 73217dee authored by Samuel Pitoiset's avatar Samuel Pitoiset

skip the 'GL >= x.y' line if present

shaderdb runner fails at parsing shader_test files when the first
line inside the require block is not 'GLSL >= x.y'. This just skips
the GL version requirement which is actually unused and allows to
compile +164 shaders from piglit.
parent 286d1808
......@@ -77,6 +77,7 @@ get_shaders(const struct context_info *core, const struct context_info *compat,
const char *shader_name)
{
static const char *req = "[require]";
static const char *gl_req = "\nGL >= ";
static const char *glsl_req = "\nGLSL >= ";
static const char *fp_req = "\nGL_ARB_fragment_program";
static const char *vp_req = "\nGL_ARB_vertex_program";
......@@ -97,6 +98,11 @@ get_shaders(const struct context_info *core, const struct context_info *compat,
/* Find the [require] block and parse it first. */
text = memmem(text, end_text - text, req, strlen(req)) + strlen(req);
/* Skip the GL >= x.y line if present. */
if (memcmp(text, gl_req, strlen(gl_req)) == 0) {
text += strlen(gl_req) + 3; /* for x.y */
}
if (memcmp(text, glsl_req, strlen(glsl_req)) == 0) {
text += strlen(glsl_req);
long major = strtol(text, (char **)&text, 10);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment