feat(lambda-rs): Add Depth tests, stencil tests, and MSAA#71
Merged
feat(lambda-rs): Add Depth tests, stencil tests, and MSAA#71
Conversation
… frame) and update reflective room example.
…n to include feature flags added for depth, stencil, and msaa validation.
…and tests for the validation.
There was a problem hiding this comment.
Pull request overview
This PR adds depth testing, stencil testing, and multi-sample anti-aliasing (MSAA) support to the lambda-rs rendering engine, enabling advanced 3D rendering techniques such as planar reflections.
Key Changes:
- Introduced depth/stencil operations and MSAA configuration through builder APIs without exposing wgpu types
- Added comprehensive validation with feature-gated logging for debug and release builds
- Created a reflective floor example demonstrating stencil-masked planar reflections with 4× MSAA
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/tutorials/reflective-room.md | New tutorial explaining stencil buffer usage for planar reflections with depth testing and MSAA |
| docs/tutorials/README.md | Updated index to include the reflective room tutorial |
| docs/specs/depth-stencil-msaa.md | Specification document defining API surface, validation, and behavior for depth/stencil/MSAA features |
| docs/features.md | Documentation of Cargo feature flags for render validation behavior |
| crates/lambda-rs/src/util/mod.rs | New utility module providing warn-once functionality to deduplicate validation messages |
| crates/lambda-rs/src/render/validation.rs | Added sample count validation helper |
| crates/lambda-rs/src/render/texture.rs | Introduced engine-level DepthFormat enum mapping to platform types |
| crates/lambda-rs/src/render/render_pass.rs | Extended builders with depth/stencil operations, MSAA support, and device capability validation |
| crates/lambda-rs/src/render/pipeline.rs | Added depth compare functions, stencil state configuration, and MSAA to pipeline builders |
| crates/lambda-rs/src/render/mod.rs | Updated render context to manage MSAA color attachments, depth/stencil textures, and pass/pipeline compatibility validation |
| crates/lambda-rs/src/render/command.rs | Added SetStencilReference command for dynamic stencil reference updates |
| crates/lambda-rs/src/render/window.rs | Removed unused monitor handle retrieval code |
| crates/lambda-rs/src/lib.rs | Exported new util module |
| crates/lambda-rs/examples/reflective_room.rs | Complete example demonstrating stencil-masked planar reflection with toggleable MSAA, depth testing, and stencil |
| crates/lambda-rs/Cargo.toml | Added granular render-validation feature flags for opt-in validation in release builds |
| crates/lambda-rs-platform/src/winit/mod.rs | Changed monitor handle to optional and improved window creation flow |
| crates/lambda-rs-platform/src/wgpu/texture.rs | Added ColorAttachmentTexture for MSAA render targets |
| crates/lambda-rs-platform/src/wgpu/surface.rs | Exposed common BGRA8_UNORM_SRGB surface format constant |
| crates/lambda-rs-platform/src/wgpu/render_pass.rs | Extended render pass builder with stencil operations and MSAA resolve support |
| crates/lambda-rs-platform/src/wgpu/pipeline.rs | Added depth compare, stencil state, and sample count configuration to pipeline builder |
| crates/lambda-rs-platform/src/wgpu/gpu.rs | Implemented device capability queries for MSAA sample count support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… only passes, fix depth clearing on stencil only passses, and add tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.