mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 10:20:41 +00:00
(PATCH) Strip lines with #pragma parameter.
It's not valid GLSL to have quotes in them, and it's meaningless to pass in the #pragmas to the driver.
This commit is contained in:
parent
d86bda1ebd
commit
673aab5282
@ -443,6 +443,22 @@ static GLuint gl_glsl_compile_program(glsl_shader_data_t *glsl,
|
|||||||
return prog;
|
return prog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void gl_glsl_strip_parameter_pragmas(char *source)
|
||||||
|
{
|
||||||
|
/* #pragma parameter lines tend to have " characters in them,
|
||||||
|
* which is not legal GLSL. */
|
||||||
|
char *s = strstr(source, "#pragma parameter");
|
||||||
|
|
||||||
|
while (s)
|
||||||
|
{
|
||||||
|
/* #pragmas have to be on a single line,
|
||||||
|
* so we can just replace the entire line with spaces. */
|
||||||
|
while (*s != '\0' && *s != '\n')
|
||||||
|
*s++ = ' ';
|
||||||
|
s = strstr(s, "#pragma parameter");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static bool gl_glsl_load_source_path(struct video_shader_pass *pass,
|
static bool gl_glsl_load_source_path(struct video_shader_pass *pass,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
@ -451,6 +467,7 @@ static bool gl_glsl_load_source_path(struct video_shader_pass *pass,
|
|||||||
if (!ret || len <= 0)
|
if (!ret || len <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
gl_glsl_strip_parameter_pragmas(pass->source.string.vertex);
|
||||||
pass->source.string.fragment = strdup(pass->source.string.vertex);
|
pass->source.string.fragment = strdup(pass->source.string.vertex);
|
||||||
return pass->source.string.fragment && pass->source.string.vertex;
|
return pass->source.string.fragment && pass->source.string.vertex;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user