summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2017-06-08 14:22:59 -0700
committerConnor Abbott <cwabbott0@gmail.com>2017-06-08 14:26:53 -0700
commitcebcbbc79defebfccef67887c7c7b684ab45011b (patch)
treefd949c4533e8dc699e8593f06724da8e07fac6f0
parent06c9c23c53be54f9d65874f417db1cb555bfa694 (diff)
glsl_scraper: add the ability to specify preprocessor directives
Right now, if you try to put something like: in a shader, the C preprocessor will try to interpret that line and barf. Now glsl_scraper.py will strip out ///, so you can do something like: ///#extension GL_foo : enable and it'll be ignored when compiling the file itself. Yes, this is a hack, but I couldn't think of anything better... I'm open to suggestions.
-rw-r--r--misc/glsl_scraper.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/glsl_scraper.py b/misc/glsl_scraper.py
index efb08ac..d07c581 100644
--- a/misc/glsl_scraper.py
+++ b/misc/glsl_scraper.py
@@ -28,7 +28,7 @@ class Shader:
self.line = line
def glsl_source(self):
- return dedent(self.stream.getvalue())
+ return dedent(self.stream.getvalue()).replace('///', '')
def __run_glslc(self, extra_args=[]):
stage_flag = '-fshader-stage='