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.
macos/v1.5.9
Eric Anholt 11 years ago
parent 972989b4ce
commit bf628d9cf3
  1. 16
      src/gen_dispatch.py

@ -535,6 +535,22 @@ class Generator(object):
for provider in alias_func.providers.values(): for provider in alias_func.providers.values():
providers.append(provider) 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: if len(providers) != 1:
self.outln(' static const enum {0}_provider providers[] = {{'.format(self.target)) self.outln(' static const enum {0}_provider providers[] = {{'.format(self.target))
for provider in providers: for provider in providers:

Loading…
Cancel
Save