@@ -22,6 +22,10 @@ use std::{
22
22
23
23
use futures:: FutureExt as _;
24
24
use parking_lot:: Mutex ;
25
+ #[ cfg( feature = "trace" ) ]
26
+ use serde:: Serialize ;
27
+ #[ cfg( feature = "replay" ) ]
28
+ use serde:: Deserialize ;
25
29
26
30
#[ cfg( not( target_arch = "wasm32" ) ) ]
27
31
pub use wgc:: instance:: { AdapterInfo , DeviceType } ;
@@ -797,23 +801,42 @@ pub enum BindingResource<'a> {
797
801
}
798
802
799
803
/// Operation to perform to the output attachment at the start of a renderpass.
800
- #[ derive( Clone , Copy , Debug , Hash , PartialEq ) ]
804
+ #[ derive( Copy , Clone , Debug , Hash , Eq , PartialEq ) ]
805
+ #[ cfg_attr( feature = "trace" , derive( Serialize ) ) ]
806
+ #[ cfg_attr( feature = "replay" , derive( Deserialize ) ) ]
801
807
pub enum LoadOp < V > {
802
808
/// Clear with a specified value.
803
809
Clear ( V ) ,
804
810
/// Load from memory.
805
811
Load ,
806
812
}
807
813
814
+ impl < V : Default > Default for LoadOp < V > {
815
+ fn default ( ) -> Self {
816
+ Self :: Clear ( Default :: default ( ) )
817
+ }
818
+ }
819
+
808
820
/// Pair of load and store operations for an attachment aspect.
809
- #[ derive( Clone , Debug , Hash , PartialEq ) ]
821
+ #[ derive( Copy , Clone , Debug , Hash , Eq , PartialEq ) ]
822
+ #[ cfg_attr( feature = "trace" , derive( Serialize ) ) ]
823
+ #[ cfg_attr( feature = "replay" , derive( Deserialize ) ) ]
810
824
pub struct Operations < V > {
811
825
/// How data should be read through this attachment.
812
826
pub load : LoadOp < V > ,
813
827
/// Whether data will be written to through this attachment.
814
828
pub store : bool ,
815
829
}
816
830
831
+ impl < V : Default > Default for Operations < V > {
832
+ fn default ( ) -> Self {
833
+ Self {
834
+ load : Default :: default ( ) ,
835
+ store : true ,
836
+ }
837
+ }
838
+ }
839
+
817
840
/// Describes a color attachment to a [`RenderPass`].
818
841
#[ derive( Clone ) ]
819
842
pub struct RenderPassColorAttachmentDescriptor < ' a > {
0 commit comments