-
Notifications
You must be signed in to change notification settings - Fork 2
feat(lambda-rs): Add support for indexed draw commands #72
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces indexed draw command support to the lambda-rs rendering engine, enabling more efficient rendering through index buffers and multiple vertex buffer configurations. The changes add a complete API surface for indexed geometry while maintaining backward compatibility with existing non-indexed draw workflows.
- Adds engine-level
IndexFormatenum andDrawIndexedcommand with validation - Introduces explicit instance ranges to both
DrawandDrawIndexedcommands (default0..1preserves single-instance behavior) - Implements comprehensive validation for index buffer formats, buffer types, and draw command ordering
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
crates/lambda-rs/src/render/command.rs |
Adds IndexFormat enum with platform mapping and updates Draw/DrawIndexed signatures to include instance ranges |
crates/lambda-rs/src/render/mod.rs |
Implements validation logic for index buffers, draw commands, and device limits; adds tracking for bound index buffers and current pipeline |
crates/lambda-rs/src/render/pipeline.rs |
Adds buffer type validation in pipeline builder and device limit checks for vertex buffers/attributes |
crates/lambda-rs-platform/src/wgpu/render_pass.rs |
Updates platform layer draw methods to accept instance ranges |
crates/lambda-rs-platform/src/wgpu/gpu.rs |
Exposes max_vertex_buffers and max_vertex_attributes device limits |
crates/lambda-rs/examples/*.rs |
Updates all examples to include instances: 0..1 in Draw commands |
crates/lambda-rs/examples/indexed_multi_vertex_buffers.rs |
New example demonstrating indexed draws with separate position and color vertex buffers |
docs/tutorials/indexed-draws-and-multiple-vertex-buffers.md |
New comprehensive tutorial covering indexed geometry implementation (has type error in example code) |
docs/specs/indexed-draws-and-multiple-vertex-buffers.md |
Complete specification document for indexed draw feature with API surface, validation rules, and performance guidance |
tools/obj_loader/src/main.rs |
Updates obj loader to use new Draw signature with instances field |
docs/tutorials/*.md |
Updates existing tutorial code examples to include instances field |
.gitignore |
Adds docs/plans/ to ignored directories |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.