-
Notifications
You must be signed in to change notification settings - Fork 2
feat(lambda-rs): Add Depth tests, stencil tests, and MSAA #71
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
… 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.
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 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.
No description provided.