gfx, luminance, vulkano, wgpu, rafx, sierra …
Yet another graphics library?
Case: Rusty Vangers
Lots workloads where CPU costs are small:
Constraints…
No per-object state. No image layout transitions.
Global barriers between passes.
if let mut pass_encoder = encoder.compute() {
let mut pipeline_encoder = pass_encoder.with(pipeline);
pipeline_encoder.dispatch(..);
}
No layouts. No descriptor sets.
No uniform buffers, just plain data.
#[derive(bytemuck::Pod)]
struct MyUniformStruct {
data: u32
}
#[derive(blade::ShaderData)]
struct Foo {
texture: blade::TextureView,
uniform: MyUniformStruct,
}
let foo_layout = <Foo as blade::ShaderData>::layout();
context.create_pipeline(blade::ComputePipelineDescriptor {
data_layouts: &[&foo_layout],
});
pass.bind(0, &Foo {
texture: my_texture_view,
uniform: MyUniformStruct { // plain data
data: 1,
},
});
Makes prototyping a breeze!
Was BG/BGL/PL a design mistake in WebGPU?
Disclaimer: Blade is much incomplete!
Can do around 20K draw calls per frame on a low-end laptop.
Who needs vertex buffers, anyway?
One context - one window.
All libraries: we got you!
Blade: bring your own maintainer
Resource objects: light and copyable.
pub struct Buffer {
raw: vk::Buffer,
memory_handle: usize,
mapped_data: *mut u8,
}
Context: Has everything, internally synchronized.
Validated(*) WGSL modules.
Without resource binding decorations!
var sprite_texture: texture_2d<f32>;
var sprite_sampler: sampler;