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

Vertex buffers support #102

Merged
merged 8 commits into from
Mar 31, 2024
Merged

Vertex buffers support #102

merged 8 commits into from
Mar 31, 2024

Conversation

kvark
Copy link
Owner

@kvark kvark commented Mar 25, 2024

Closes #101
Example bits from the updated bunnymark:

#[derive(blade_macros::Vertex)]
struct SpriteVertex {
    pos: [f32; 2],
}

            vertex_fetches: &[gpu::VertexFetchState {
                layout: &<SpriteVertex as gpu::Vertex>::layout(),
                instanced: false,
            }],

rc.bind_vertex(0, sprite.vertex_buf);

TODO:

  • API update
    • more vertex formats
  • derive macro
  • bunnymark example update
  • Implementation
    • Vulkan
    • Metal
    • GLES
    • WebGL
  • prototype in Zed

This is pretty much done, and it opens the doors properly to use GLES backend with real geometry. However, I realized that porting Zed to vertex buffers isn't going to be as straightforward as I thought. Both Rust and WGSL side structures are deeply nested in it, and that's not expected by either Naga or Blade today. We may need to have additional changes here once we confirm with Zed.

@kvark kvark merged commit 7c80d61 into main Mar 31, 2024
5 checks passed
@kvark kvark deleted the vertex branch March 31, 2024 17:47
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.

Hard to do anything useful on WebGL backend
1 participant