whoami
Purity:
Safety:
Backends: GL/GLES/WebGL
Overhead:
Ergonomics: AA+
Downloads: every 8 seconds
Purity: (no shader solution)
Safety:
Backends: Vulkan
Overhead:
Ergonomics: A
Downloads: every 9 seconds
Purity: host,
shader processing (3rd party C++)
Safety: host,
shaders, relies on robust buffer/image access
Backends: Vulkan
Overhead:
Ergonomics: AA
Downloads: every 2.5 minutes
Purity: (includes shader solution via
naga
)
Safety: (includes shader instrumentation)
Backends: Vulkan, D3D12, Metal, GL, WebGPU, WebGL2
Overhead:
Ergonomics: AAA
Downloads: every 12 seconds
Purity: (includes shader solution via
naga
)
Safety:
Backends: Vulkan, D3D12, Metal, GL/GLES/WebGL2, WebGPU
Overhead: (directly mapped)
Ergonomics: A+
Downloads: every 12 seconds (same as wgpu)
Purity: (includes shader solution via
naga
)
Safety:
Backends: Vulkan, Metal, GLES/WebGL2
Overhead: (directly mapped)
GPU penalty: (to be discussed)
Ergonomics: AAA+
Downloads: every 15 minutes
Core idea: validating correctness takes as much computation as providing it.
Naga shows GLSL -> SPIRV in just 1.5ms per shader.
Lean and mean graphics API
Shader:
var<storage,read_write> particles: array<Particle>;
var<uniform> parameters: Parameters;
Host:
pc.bind(0, &MainData {
particles: particle_buffer.into(),
parameters: Parameters {
my_uniform: [1,2,3,4],
},
});
pc.dispatch([group_count, 1, 1]);
if let mut pass = command_encoder.compute("fill-gbuf") {
let mut pc = pass.with(&self.fill_pipeline);
pc.bind(0, &FillData {...});
pc.dispatch(groups);
}
// implicit barrier between passes
if let mut pass = command_encoder.compute("ray-trace") {
let mut pc = pass.with(&self.main_pipeline);
pc.bind(0, &MainData {...});
pc.dispatch(groups);
}
API translation and command recording:
Rasterization:
GPU | blade | wgpu-hal |
---|---|---|
Ryzen 3500U | 20K | 20K |
Ryzen 6850U | 70K | 70K |
GeForce 3050 | 100K | 100K |
Supplying GENERAL everywhere sure is state-of-the-art weapons-grade laziness…
Drivers:
Just leave images in the VK_IMAGE_LAYOUT_GENERAL layout
Easy to mitigate by inserting transitions around render passes.