summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-12-16 09:29:53 -0800
committerEric Anholt <eric@anholt.net>2013-12-16 09:33:33 -0800
commitbf628d9cf36332aff50e09d46a2f0e33a94031b1 (patch)
tree90a03461d8d23439893a4d8323add7a63fd6334e /src
parent972989b4ce364221de64593cd61362ed236f7f06 (diff)
Add support for lower-priority aliases of functions.
For example, on desktop 2.1 GL on Apple, there's no glBindVertexArray, but there is glBindVertexArrayAPPLE, and as far as a caller is concerned, the APPLE variant should be able to stand in for the core/ARB version. Similarly for trying to do FBOs on an old Mesa implementation that didn't have ARB_fbo yet, but did have EXT_fbo.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/gen_dispatch.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py
index 8acd9da..dabca02 100755
--- a/src/gen_dispatch.py
+++ b/src/gen_dispatch.py
@@ -535,6 +535,22 @@ class Generator(object):
for provider in alias_func.providers.values():
providers.append(provider)
+ # Add some partial aliases of a few functions. These are ones
+ # that aren't quite aliases, because of some trivial behavior
+ # difference (like whether to produce an error for a
+ # non-Genned name), but where we'd like to fall back to the
+ # similar function if the proper one isn't present.
+ half_aliases = {
+ 'glBindVertexArray' : 'glBindVertexArrayAPPLE',
+ 'glBindVertexArrayAPPLE' : 'glBindVertexArray',
+ 'glBindFramebuffer' : 'glBindFramebufferEXT',
+ 'glBindFramebufferEXT' : 'glBindFramebuffer',
+ }
+ if func.name in half_aliases:
+ alias_func = self.functions[half_aliases[func.name]]
+ for provider in alias_func.providers.values():
+ providers.append(provider)
+
if len(providers) != 1:
self.outln(' static const enum {0}_provider providers[] = {{'.format(self.target))
for provider in providers: