Hi,
I am trying to use the AutomaticSourceOutputGenerator
Python class from the SDK to write a script that generates code for an API layer.
I am able to write a generator that works great for core spec (I can specify a list of functions from the core spec and get code generated for them). However, I am unable to get this to work for core extensions (eg: xrGetVisibilityMaskKHR()
).
My generator is here:
OpenXR-Toolkit/dispatch_generator.py at main · mbucchia/OpenXR-Toolkit (github.com)
I noticed that there are two class members, core_commands
and ext_commands
. However, even looking at the ext_commands
dictionary, I am not able to see functions from extensions.
Down to the call to apiGen()
, I don’t understand all the parameters of AutomaticSourceGeneratorOptions
: what is the difference between addExtensions
and emitExtensions
for example? What is defaultExtensions
?
I’m pretty sure it’s down to this apiGen
call that I am missing something, but I just can’t figure out what it is…
conventions = OpenXRConventions()
featuresPat = "XR_VERSION_1_0"
registry.setGenerator(DispatchGenCppOutputGenerator(diagFile=None))
registry.apiGen(AutomaticSourceGeneratorOptions(
conventions = conventions,
filename = 'dispatch.gen.cpp',
directory = cur_dir,
apiname = 'openxr',
profile = None,
versions = featuresPat,
emitversions = featuresPat,
defaultExtensions = 'openxr',
addExtensions = None,
removeExtensions = None,
emitExtensions = None))
I tried setting emitExtensions
to makeREstring('.*')
like it is done in genxr.py
, but that did not make any difference.
Any help appreciated. Thanks!
CC @rpavlik.