Skip to content

feat(lambda-rs): Add support for indexed draw commands - #72

Merged
vmarcella merged 10 commits into
mainfrom
vmarcella/indexed-draws
Nov 23, 2025
Merged

feat(lambda-rs): Add support for indexed draw commands#72
vmarcella merged 10 commits into
mainfrom
vmarcella/indexed-draws

Conversation

@vmarcella

Copy link
Copy Markdown
Member

No description provided.

CopilotAI left a comment

Copy link
Copy Markdown

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
FileDescription
crates/lambda-rs/src/render/command.rsAdds IndexFormat enum with platform mapping and updates Draw/DrawIndexed signatures to include instance ranges
crates/lambda-rs/src/render/mod.rsImplements 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.rsAdds buffer type validation in pipeline builder and device limit checks for vertex buffers/attributes
crates/lambda-rs-platform/src/wgpu/render_pass.rsUpdates platform layer draw methods to accept instance ranges
crates/lambda-rs-platform/src/wgpu/gpu.rsExposes max_vertex_buffers and max_vertex_attributes device limits
crates/lambda-rs/examples/*.rsUpdates all examples to include instances: 0..1 in Draw commands
crates/lambda-rs/examples/indexed_multi_vertex_buffers.rsNew example demonstrating indexed draws with separate position and color vertex buffers
docs/tutorials/indexed-draws-and-multiple-vertex-buffers.mdNew comprehensive tutorial covering indexed geometry implementation (has type error in example code)
docs/specs/indexed-draws-and-multiple-vertex-buffers.mdComplete specification document for indexed draw feature with API surface, validation rules, and performance guidance
tools/obj_loader/src/main.rsUpdates obj loader to use new Draw signature with instances field
docs/tutorials/*.mdUpdates existing tutorial code examples to include instances field
.gitignoreAdds docs/plans/ to ignored directories

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threaddocs/tutorials/indexed-draws-and-multiple-vertex-buffers.md Outdated
@vmarcella
vmarcella merged commit afabc05 into mainNov 23, 2025
5 checks passed
@vmarcella
vmarcella deleted the vmarcella/indexed-draws branch November 23, 2025 23:21
Sign up for freeto 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

@vmarcella