Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: VK_EXT_mesh_shader #1019

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

BeastLe9enD
Copy link
Contributor

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);
}

@BeastLe9enD BeastLe9enD marked this pull request as draft March 25, 2023 23:05
@Firestar99
Copy link

Firestar99 commented Dec 28, 2023

rspirv has gotten an updated version on crates.io 8 days ago! 🎉

@eddyb
Copy link
Contributor

eddyb commented Dec 28, 2023

@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.

@Firestar99
Copy link

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.

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.

3 participants