summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2014-06-13 16:16:51 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2014-06-19 12:17:14 +0100
commitfe975c8884fa1a64a634ac780b09fefbf050b608 (patch)
tree26ac2d8c0c997fbb872324e1846cf78d26c555ac
parenta488fea8f766b5b4d4471b52a784e7fa307bdd73 (diff)
When generating shims, limit the considered features to GL version <=1.2
This fixes a problem seen with registry data since the change of 2013-08-16 removed glBlend(Color|Equation) from GL1.2 and added them to GL_ARB_imaging. Considering all features, no shims are generated for glBlend(Color|Equation) as they are first emitted for GL 1.4 (which we ignore), then emission for GL_ARB_imaging is skipped as they have already been emitted. Also improve feature name matching so it is exact, not on an initial substring, so 'GL_ARB_texture_compression_bptc' and 'GL_ARB_texture_compression_rgtc' aren't matched by 'GL_ARB_texture_compression'.
-rwxr-xr-xhw/xwin/glx/gen_gl_wrappers.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/hw/xwin/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py
index cdbba638a..69ab1efa9 100755
--- a/hw/xwin/glx/gen_gl_wrappers.py
+++ b/hw/xwin/glx/gen_gl_wrappers.py
@@ -100,13 +100,16 @@ reg = Registry()
tree = etree.parse(regFilename)
reg.loadElementTree(tree)
-allVersions = '.*'
+if shim:
+ versions = '1\.[012]'
+else:
+ versions = '.*'
genOpts = CGeneratorOptions(
apiname = prefix,
profile = 'compatibility',
- versions = allVersions,
- emitversions = allVersions,
+ versions = versions,
+ emitversions = versions,
defaultExtensions = prefix, # Default extensions for GL
protectFile = protect,
protectFeature = protect,
@@ -257,7 +260,7 @@ class ThunkOutputGenerator(OutputGenerator):
pass
def beginFeature(self, interface, emit):
OutputGenerator.beginFeature(self, interface, emit)
- self.OldVersion = self.featureName.startswith('GL_VERSION_1_0') or self.featureName.startswith('GL_VERSION_1_1')
+ self.OldVersion = (self.featureName in ['GL_VERSION_1_0', 'GL_VERSION_1_1'])
def endFeature(self):
OutputGenerator.endFeature(self)
def genType(self, typeinfo, name):
@@ -355,7 +358,7 @@ class ShimOutputGenerator(OutputGenerator):
pass
def beginFeature(self, interface, emit):
OutputGenerator.beginFeature(self, interface, emit)
- self.OldVersion = self.featureName.startswith('GL_VERSION_1_0') or self.featureName.startswith('GL_VERSION_1_1') or self.featureName.startswith('GL_VERSION_1_2') or self.featureName.startswith('GL_ARB_imaging') or self.featureName.startswith('GL_ARB_multitexture') or self.featureName.startswith('GL_ARB_texture_compression')
+ self.OldVersion = (self.featureName in ['GL_VERSION_1_0', 'GL_VERSION_1_1', 'GL_VERSION_1_2', 'GL_ARB_imaging', 'GL_ARB_multitexture', 'GL_ARB_texture_compression'])
def endFeature(self):
OutputGenerator.endFeature(self)
def genType(self, typeinfo, name):