@@ -752,29 +752,6 @@ impl RenderContext {
752752 ) -> bool {
753753 return depth_ops. is_some ( ) || stencil_ops. is_some ( ) ;
754754 }
755-
756- /// Map high-level depth operations to platform depth operations, returning
757- /// `None` when no depth operations were requested.
758- fn map_depth_ops (
759- depth_ops : Option < render_pass:: DepthOperations > ,
760- ) -> Option < platform:: render_pass:: DepthOperations > {
761- return depth_ops. map ( |dops| platform:: render_pass:: DepthOperations {
762- load : match dops. load {
763- render_pass:: DepthLoadOp :: Load => {
764- platform:: render_pass:: DepthLoadOp :: Load
765- }
766- render_pass:: DepthLoadOp :: Clear ( value) => {
767- platform:: render_pass:: DepthLoadOp :: Clear ( value as f32 )
768- }
769- } ,
770- store : match dops. store {
771- render_pass:: StoreOp :: Store => platform:: render_pass:: StoreOp :: Store ,
772- render_pass:: StoreOp :: Discard => {
773- platform:: render_pass:: StoreOp :: Discard
774- }
775- } ,
776- } ) ;
777- }
778755}
779756
780757/// Errors reported while preparing or presenting a frame.
@@ -850,21 +827,4 @@ mod tests {
850827 let has_attachment = RenderContext :: has_depth_attachment ( None , stencil_ops) ;
851828 assert ! ( has_attachment) ;
852829 }
853-
854- #[ test]
855- fn map_depth_ops_none_when_no_depth_operations ( ) {
856- let mapped = RenderContext :: map_depth_ops ( None ) ;
857- assert ! ( mapped. is_none( ) ) ;
858- }
859-
860- #[ test]
861- fn map_depth_ops_maps_clear_and_store ( ) {
862- let depth_ops = render_pass:: DepthOperations {
863- load : render_pass:: DepthLoadOp :: Clear ( 0.5 ) ,
864- store : render_pass:: StoreOp :: Store ,
865- } ;
866- let mapped = RenderContext :: map_depth_ops ( Some ( depth_ops) ) . expect ( "mapped" ) ;
867- assert_eq ! ( mapped. load, platform:: render_pass:: DepthLoadOp :: Clear ( 0.5 ) ) ;
868- assert_eq ! ( mapped. store, platform:: render_pass:: StoreOp :: Store ) ;
869- }
870830}
0 commit comments