Skip to content

Commit 3bc0187

Browse files
committed
[add] tests for blend modes and blend mode default.
1 parent b8e78cb commit 3bc0187

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

crates/lambda-rs/src/render/pipeline.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,30 @@ mod tests {
777777
));
778778
}
779779

780+
/// Ensures blend modes default to `None` and map to platform blend modes.
781+
#[test]
782+
fn blend_mode_defaults_and_maps_to_platform() {
783+
let builder = RenderPipelineBuilder::new();
784+
assert!(matches!(builder.blend_mode, BlendMode::None));
785+
786+
assert!(matches!(
787+
BlendMode::None.to_platform(),
788+
platform_pipeline::BlendMode::None
789+
));
790+
assert!(matches!(
791+
BlendMode::AlphaBlending.to_platform(),
792+
platform_pipeline::BlendMode::AlphaBlending
793+
));
794+
assert!(matches!(
795+
BlendMode::PremultipliedAlpha.to_platform(),
796+
platform_pipeline::BlendMode::PremultipliedAlpha
797+
));
798+
assert!(matches!(
799+
BlendMode::Additive.to_platform(),
800+
platform_pipeline::BlendMode::Additive
801+
));
802+
}
803+
780804
/// Ensures invalid MSAA sample counts are clamped/fallen back to `1`.
781805
#[test]
782806
fn pipeline_builder_invalid_sample_count_falls_back_to_one() {

0 commit comments

Comments
 (0)