summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2017-08-21 14:44:38 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2017-08-21 14:44:40 -0700
commit0aa8ae764d5b73979965f58f63e87b26bc434768 (patch)
treea1ade05022b73cccce02aaf3964fa2fa84e55baa
parent2fe32ddb90369a2d766e74eac189d72603cee4c1 (diff)
glsl_scraper: Provide a QO_EXTENSION macro for handling #extension
You can't put #extension directly in C source so we need to make a magic qonos macro to allow declaring extensions.
-rw-r--r--misc/glsl_scraper.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/misc/glsl_scraper.py b/misc/glsl_scraper.py
index 83b2087..6a3d503 100644
--- a/misc/glsl_scraper.py
+++ b/misc/glsl_scraper.py
@@ -28,6 +28,10 @@ class Shader:
def finish_text(self, line):
self.glsl = self.stream.getvalue()
self.stream = None
+
+ # Handle the QO_EXTENSION macro
+ self.glsl = self.glsl.replace('QO_EXTENSION', '#extension')
+
self.line = line
def __run_glslc(self, extra_args=[]):