Skip to main content

Vulkan Object Python Package

Parsing the vk.xml in Vulkan is easy, processing it is hard!

It is very easy for people to mess up trying to process the vk.xml file, so we created VulkanObject

VulkanObject is just a python dataclass that is defined in Vulkan-Headers/registry/vulkan_object.py. It uses the reg.py framework that the Vulkan Spec is generated with in order to populate the VulkanObject data structure.

This python package makes it super easy to get going.

pip install vulkan-object

and then it is as simple as

#!/usr/bin/env python3
from vulkan_object import get_vulkan_object

# This builds the VulkanObject that is populated and ready to be used
vk = get_vulkan_object()

print(f'There are now {len([x for x in vk.extensions.values()])} extensions in Vulkan')

print(f'Built with the {vk.headerVersion} headers')

longest_count = 0
for struct in vk.structs.values():
    if len(struct.name) > longest_count:
        longest_count = len(struct.name)
        longest_struct = struct
print(f'Longest Struct name is {longest_struct.name} at {longest_count} characters')

Quick query from the terminal

Just run the following and you can quickly use vk in your terminal for some quick query

python -i -c "from vulkan_object import get_vulkan_object;vk = get_vulkan_object()"

Vulkan Video

Added in 1.4.342 release

By default, the video.xml file is not parsed, but can be turned on. (example: video_example.py)

vk = get_vulkan_object(video=True)

More example

example.py has more in depth ways to use this

What is this package/repo actually?

The Vulkan-Headers contain a bunch of scripts in the Vulkan-Headers/registry/ directory that repos can use to help generate code.

The main issue is the delivery mechanism for python projects. This package/repo just grabs the Vulkan-Headers scripts (not the C header files themselves!) and make it easier to integrate with projects.

Updating this repo

run python update.py /path/to/Vulkan-Headers and it will do everything to sync this package up with the new headers

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vulkan_object-1.4.361.tar.gz (413.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vulkan_object-1.4.361-py3-none-any.whl (423.2 kB view details)

Uploaded Python 3

File details

Details for the file vulkan_object-1.4.361.tar.gz.

File metadata

  • Download URL: vulkan_object-1.4.361.tar.gz
  • Upload date:
  • Size: 413.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vulkan_object-1.4.361.tar.gz
Algorithm Hash digest
SHA256 35a967f269a5a811244ef1417e5a0206cb91b61f220cd1b3c0368865df4752cc
MD5 64fb5f08b27e0599cf54d2d11b41e060
BLAKE2b-256 9c139e2dabb749b2140c7ec3ec9800b5faf15fee9dd483b94ea87533a33dcab4

See more details on using hashes here.

Provenance

The following attestation bundles were made for vulkan_object-1.4.361.tar.gz:

Publisher: publish.yml on KhronosGroup/vulkan-object

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vulkan_object-1.4.361-py3-none-any.whl.

File metadata

  • Download URL: vulkan_object-1.4.361-py3-none-any.whl
  • Upload date:
  • Size: 423.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for vulkan_object-1.4.361-py3-none-any.whl
Algorithm Hash digest
SHA256 57520ec2ebe6b71d06c91fde5f8ca6c3146e49eabf2daa49a221bbbbbf104151
MD5 60c34c191f6d751859ad26daa94008ca
BLAKE2b-256 5e8d9312e5c369e59d84dca50d1ccd9f121f110377b80edcbcdc170a0d9ec9aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for vulkan_object-1.4.361-py3-none-any.whl:

Publisher: publish.yml on KhronosGroup/vulkan-object

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.4.362

2 files

This release

1.4.361 This release

2 files

1.4.360

2 files

1.4.359

2 files

1.4.358

2 files

1.4.357.post1

2 files

1.4.357

2 files

1.4.356

2 files

1.4.355

2 files

1.4.354

2 files

1.4.353

2 files

1.4.352

2 files

1.4.351

2 files

1.4.350

2 files

1.4.349

2 files

1.4.348

2 files

1.4.347

2 files

1.4.346

2 files

1.4.345

2 files

1.4.344

2 files

1.4.343

2 files

1.4.342.post2

2 files

1.4.342.post1

2 files

1.4.342

2 files

1.4.341

2 files

1.4.339

2 files

1.4.338

2 files

1.4.336

2 files

1.4.335

2 files

1.4.334

2 files

1.4.333

2 files

1.4.332

2 files

1.4.330

2 files

1.4.329

2 files

1.4.328

2 files

1.4.327

2 files

1.4.326

2 files

1.4.325

2 files

1.4.323

2 files

1.4.322

2 files

1.4.321

2 files

1.4.320

2 files

1.4.319

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page