Skip to content

Conversation

@vmarcella
Copy link
Member

No description provided.

Copy link

Copilot AI left a 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 IndexFormat enum and DrawIndexed command with validation
  • Introduces explicit instance ranges to both Draw and DrawIndexed commands (default 0..1 preserves 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.

@vmarcella vmarcella merged commit afabc05 into main Nov 23, 2025
5 checks passed
@vmarcella vmarcella deleted the vmarcella/indexed-draws branch November 23, 2025 23:21
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.

2 participants