mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Small cleanup
This commit is contained in:
parent
faa55b4dff
commit
ecbd58d3af
@ -110,7 +110,8 @@ bool glslang_read_shader_file(const char *path, vector<string> *output, bool roo
|
|||||||
|
|
||||||
for (size_t i = root_file ? 1 : 0; i < lines.size(); i++)
|
for (size_t i = root_file ? 1 : 0; i < lines.size(); i++)
|
||||||
{
|
{
|
||||||
const char *line = lines[i];
|
unsigned push_line = 0;
|
||||||
|
const char *line = lines[i];
|
||||||
if (strstr(line, "#include ") == line)
|
if (strstr(line, "#include ") == line)
|
||||||
{
|
{
|
||||||
char *closing = NULL;
|
char *closing = NULL;
|
||||||
@ -141,8 +142,7 @@ bool glslang_read_shader_file(const char *path, vector<string> *output, bool roo
|
|||||||
|
|
||||||
/* After including a file, use line directive
|
/* After including a file, use line directive
|
||||||
* to pull it back to current file. */
|
* to pull it back to current file. */
|
||||||
snprintf(tmp, sizeof(tmp), "#line %u \"%s\"", unsigned(i + 1), basename);
|
push_line = 1;
|
||||||
output->push_back(tmp);
|
|
||||||
}
|
}
|
||||||
else if (strstr(line, "#endif") || strstr(line, "#pragma"))
|
else if (strstr(line, "#endif") || strstr(line, "#pragma"))
|
||||||
{
|
{
|
||||||
@ -151,12 +151,17 @@ bool glslang_read_shader_file(const char *path, vector<string> *output, bool roo
|
|||||||
* Add extra offset here since we're setting #line
|
* Add extra offset here since we're setting #line
|
||||||
* for the line after this one.
|
* for the line after this one.
|
||||||
*/
|
*/
|
||||||
snprintf(tmp, sizeof(tmp), "#line %u \"%s\"", unsigned(i + 2), basename);
|
push_line = 2;
|
||||||
output->push_back(line);
|
output->push_back(line);
|
||||||
output->push_back(tmp);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
output->push_back(line);
|
output->push_back(line);
|
||||||
|
|
||||||
|
if (push_line != 0)
|
||||||
|
{
|
||||||
|
snprintf(tmp, sizeof(tmp), "#line %u \"%s\"", unsigned(i + push_line), basename);
|
||||||
|
output->push_back(tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user