Skip to content

Add a Vulkan layer for injecting SPIR-V -> SPIR-T -> SPIR-V into any Vulkan users.#41

Draft
eddyb wants to merge 2 commits intoeddyb/entry-ret-as-abortfrom
eddyb/vk-layer
Draft

Add a Vulkan layer for injecting SPIR-V -> SPIR-T -> SPIR-V into any Vulkan users.#41
eddyb wants to merge 2 commits intoeddyb/entry-ret-as-abortfrom
eddyb/vk-layer

Conversation

@eddyb
Copy link
Copy Markdown
Member

@eddyb eddyb commented Apr 23, 2026

Note: this PR is a draft to avoid accidental merging onto its "base" branch (used as a form of ad-hoc PR stacking), and will remain as such, until its "base" branch can be set to main, i.e. all prerequisite PRs will have landed, up to and including this PR (whose branch is the "base" of this one):


Originally submitted as (description mostly copied from there):

(since then, Vulkan CTS attempts have been hit-and-miss due to interactions with validation layers - running e.g. spirv-val from spirt-vk-layer might work, or maybe even using the layer just to collect SPIR-V samples that can be processed outside of the CTS - and tools for that should exist already)


Behavior is kind of arbitrary right now (mostly a demo), and ergonomics are lacking.
The main goal will be to run the full Vulkan CTS ("Conformance Test Suite") with it enabled.

Both of these should work (where vkapp is e.g. vkcube) on Linux:

VK_LAYER_PATH=$PWD/vk-layer/manifests/target_debug_lib.so VK_LOADER_LAYERS_ENABLE=VK_LAYER_SPIRT_shaders vkapp
cargo build -p spirt-vk-layer --target=i686-unknown-linux-gnu
VK_LAYER_PATH=$PWD/vk-layer/manifests/target_i686-unknown-linux-gnu_debug_lib.so VK_LOADER_LAYERS_ENABLE=VK_LAYER_SPIRT_shaders vkapp32

On Linux/Mesa, by setting MESA_LOADER_DRIVER_OVERRIDE=zink as well, it ends up affecting OpenGL too:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant