A hello-triangle example using SpirV shaders in wgpu.
The example uses shaders from Vulkan Tutorial. and Vulkan backend.
The purpose of this repo is to give a direct example of using SpirV in wgpu
,
since it's not obvious for newcomer of wgpu
.
Q: How to use a SpirV shader in wgpu
?
A: Create shader source with wgpu::util::make_spirv
or include it
statically with wgpu::include_spirv!
.
Please see comments in src/main.rs
for more details.
cargo run
Install naga-cli:
cargo install naga-cli
Convert shaders:
naga shader.frag frag.spv
naga shader.vert vert.spv
- Validation Error: [ VUID-VkSwapchainCreateInfoKHR-imageExtent-01274 ] - gfx-rs/wgpu#1958