feat(lambda-rs): Update pipelines to disable blending by default #183
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.
Summary
Pipelines previously hardcoded
ALPHA_BLENDINGfor all color targets, adding unnecessary blending overhead for the common case (fully opaque geometry). This PR changes the default to no blending (opaque/replace) and adds an explicit opt-in API for transparency.Related Issues
Changes
RenderPipelineBuildercolor target blending toNone(replace/opaque) instead of always enablingALPHA_BLENDING.BlendModeenum +RenderPipelineBuilder::with_blend(BlendMode)to opt into:None(default)AlphaBlendingPremultipliedAlphaAdditiveCustom(wgpu::BlendState)(platform-level advanced use)wgpu.Noneand that presets map to the expectedwgpublend states.Type of Change
Affected Crates
lambda-rslambda-rs-platformlambda-rs-argslambda-rs-loggingdemos,docsChecklist
cargo +nightly fmt --all)cargo clippy --workspace --all-targets -- -D warnings)cargo test --workspace)Testing
Commands run:
Manual verification steps (if applicable):
demos/renderreflective-room and confirm the floor tint remains translucent by enabling.with_blend(BlendMode::AlphaBlending).Screenshots/Recordings
N/A
Platform Testing
Additional Notes
Migration: any pipeline that relied on implicit alpha blending must now opt in:
This improves default performance for opaque geometry, especially on tile-based GPUs where blending can increase bandwidth/cost.