MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
main.py File Reference

MXVK Python compute-shader post-processing example. More...

Go to the source code of this file.

Classes

class  main.SpriteWindow

Namespaces

namespace  main

Functions

int main.main ()
argparse.Namespace main.parse_args ()

Variables

str main.DATA_DIR = EXAMPLE_DIR / "data"
 main.EXAMPLE_DIR = Path(__file__).resolve().parent

Detailed Description

MXVK Python compute-shader post-processing example.

Loads an image sprite, attaches a compute post-processing shader, and updates shader mouse, timing, frame-rate, and audio-style uniforms. The shader is inspected before use, preventing a fragment or vertex SPIR-V module from being attached as a compute effect.

Running the example

python3 python-examples/compute/main.py --filename inter.comp.spv --vsync

Controls

  • Move the mouse to update the shader mouse position.
  • Hold the left mouse button to set the shader pressed state.
  • Escape: exit.

Rendering flow

SpriteWindow queues the source sprite in proc(), then MXVK runs the PostProcessingEffect compute stage and presents its output. The explicit close() method detaches the effect before releasing native resources.

Definition in file main.py.