rust-gpu
rust-gpu copied to clipboard
WIP: VK_EXT_mesh_shader
This PR adds support for VK_EXT_mesh_shader. At the moment, it depends on my unofficial updated rspirv version.
An example mesh shader looks like this:
#[spirv(mesh_ext(
threads(1),
output_vertices = 3,
output_primitives_ext = 1,
output_triangles_ext
))]
pub fn my_mesh_shader(
#[spirv(position)] positions: &mut [Vec4; 3],
#[spirv(primitive_triangle_indices_ext)] indices: &mut [UVec3; 1],
) {
unsafe {
set_mesh_outputs_ext(3, 1);
}
positions[0] = Vec4::new(-0.5, 0.5, 0.0, 1.0);
positions[1] = Vec4::new(0.5, 0.5, 0.0, 1.0);
positions[2] = Vec4::new(0.0, -0.5, 0.0, 1.0);
indices[0] = UVec3::new(0, 1, 2);
}
rspirv has gotten an updated version on crates.io 8 days ago! :tada:
@BeastLe9enD can you rebase (to get rid of the merge commits) and switch to the new rspirv release? If there's other errors to fix from the rspirv bump, ping me so we can get this through.
I'm giving this a try myself, expect a new PR soonish. I'll split the rspirv update in a separate PR, as it seems to require some small breaking changes due to extension deprecation / removal, like BaryCoordNV -> BaryCoordKHR.