Git Product home page Git Product logo

vulkanmitts's Introduction

Vulkan Python Bindings

How to install

I didn't try to do a manylinux build so binaries will only work on the same distribution of linux that they were build with. The only binary version available are wheel files for Ubuntu 20.04 for a few python version. They are available as gitlab pipeline artefacts.

How to build the WHL

Linux

Check this dockerfile for an example how to setup the environment to build.

PYTHONPATH=/usr/share/vulkan/registry python genswigi.py /usr/share/vulkan/registry/vk.xml .
python setup.py bdist_wheel

Windows

  • Install the VulkanSDK
  • Edit cli.ps1 to set the correct path to the VulkanSDK
  • Install CMake
  • Clone Vulkan-Docs
  • Install a tool chain of Visual Studio 2019 or above
  • Do git checkout v1.3.246 in the Vulkan-Docs repository (replace version with the one you downloaded)
  • Run cli.ps1 to get a powershell prompt with the correct environment
  • Start visual studio code from this prompt code .

Do something like this:

set PYTHONPATH=.\Vulkan-Docs\scripts
python genswigi.py .\Vulkan-Docs\xml\vk.xml .
python setup.py bdist_wheel

The current setup.py looks for Visual Studio 2019, you can change this in (setup.py)[setup.py].

Tests

Coverage is very limited. Currently we have the equivalent of the "template" sample in the Lunar SDK. It's a textured cube.

More test cases are welcome.

The unit tests depends on the following packages:

  • contextlib2
  • pillow

After cloning this repository:

python test_vulkanmitts_no_window.py
python hello_vulkanmittsoffscreen.py

Developer Overview

These python bindings are for the most part generated from vk.xml in Vulkan-Docs using a script derived from generator.py.

  • genswigi.py generates two SWIG interfaces files vulkan.ixx and shared_ptr.ixx;
  • swig.exe generates the actual bindings from vulkanmitts.i which includes these generated interface files.

Because of they are generated from the spec, the bindings are mostly complete, excluding some extensions, but not tested.

Also included is pyglslang, Python binding for the glslang library that implements GLSL to SPIR-V compilation.

vulkanmitts's People

Contributors

mlamarre avatar

Stargazers

Tim Lehr avatar Etienne Danvoye avatar  avatar  avatar Aaron Carlton avatar

Watchers

James Cloos avatar  avatar

Forkers

jameslinus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.