Dav1dde / glad

Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.
https://glad.dav1d.de/
Other
3.73k stars 440 forks source link

2.0.6 fails to parse Vulkan specs #486

Closed ceeac closed 1 week ago

ceeac commented 1 week ago

OS: Arch Stable GLAD version: 2.0.6

Generating Vulkan 1.0 headers using

$ glad --out-path glad/ --api vulkan=1.0 c --header-only

fails with the following output:

[05.09.2024 07:35:28][DEBUG ][glad.plugin   ]: loaded language c: <class 'glad.generator.c.__init__.CGenerator'>
[05.09.2024 07:35:28][DEBUG ][glad.plugin   ]: loaded language rust: <class 'glad.generator.rust.__init__.RustGenerator'>
[05.09.2024 07:35:28][DEBUG ][glad.plugin   ]: loaded specification egl: <class 'glad.specification.EGL'>
[05.09.2024 07:35:28][DEBUG ][glad.plugin   ]: loaded specification gl: <class 'glad.specification.GL'>
[05.09.2024 07:35:28][DEBUG ][glad.plugin   ]: loaded specification glx: <class 'glad.specification.GLX'>
[05.09.2024 07:35:28][DEBUG ][glad.plugin   ]: loaded specification vk: <class 'glad.specification.VK'>
[05.09.2024 07:35:28][DEBUG ][glad.plugin   ]: loaded specification wgl: <class 'glad.specification.WGL'>
[05.09.2024 07:35:28][INFO  ][glad      ]: getting 'vk' specification from remote location
[05.09.2024 07:35:28][INFO  ][glad.opener   ]: opening: 'https://raw.githubusercontent.com/KhronosGroup/Vulkan-Docs/main/xml/vk.xml'
[05.09.2024 07:35:29][INFO  ][glad      ]: generating vulkan:None/vk=Version(major=1, minor=0)
Traceback (most recent call last):
  File "/usr/bin/glad", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/glad/__main__.py", line 184, in main
    feature_sets = list(select(specification, api, info) for api, info in apis)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/glad/__main__.py", line 184, in <genexpr>
    feature_sets = list(select(specification, api, info) for api, info in apis)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/glad/__main__.py", line 181, in select
    return generator.select(specification, api, info.version, info.profile, extensions, config, sink=logging_sink)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/glad/generator/c/__init__.py", line 379, in select
    return JinjaGenerator.select(self, spec, api, version, profile, extensions, config, sink=sink)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/glad/generator/__init__.py", line 60, in select
    return spec.select(api, version, profile, extensions, sink=sink)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/glad/parse.py", line 669, in select
    available_profiles = self.profiles_for_api(api)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/glad/parse.py", line 487, in profiles_for_api
    for feature in chain(self.features[api].values(), self.extensions[api].values()):
                         ^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/glad/util.py", line 165, in memoized
    cache[key] = func(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/glad/parse.py", line 458, in features
    num = Version(*map(int, element.attrib['number'].split('.')))
                            ~~~~~~~~~~~~~~^^^^^^^^^^
  File "src/lxml/etree.pyx", line 2547, in lxml.etree._Attrib.__getitem__
KeyError: 'number'
Dav1dde commented 1 week ago

This was fixed in 8dc0d4d, will create a new release.

Dav1dde commented 1 week ago

2.0.7 is out, thanks for the report!