@@ -21,73 +21,72 @@ pub enum Scope {
21
21
QueueFamily = 5 ,
22
22
}
23
23
24
- bitflags:: bitflags! {
25
- pub struct Semantics : u32 {
26
- /// No memory semantics.
27
- const NONE = 0 ;
28
-
29
- /// On an atomic instruction, orders memory operations provided in program
30
- /// order after this atomic instruction against this atomic instruction. On
31
- /// a barrier, orders memory operations provided in program order after this
32
- /// barrier against atomic instructions before this barrier.
33
- const ACQUIRE = 0x2 ;
34
-
35
- /// On an atomic instruction, orders memory operations provided in program
36
- /// order before this atomic instruction against this atomic instruction. On
37
- /// a barrier, orders memory operations provided in program order before
38
- /// this barrier against atomic instructions after this barrier.
39
- const RELEASE = 0x4 ;
40
-
41
- /// Has the properties of both [`Self::ACQUIRE`] and [`Self::RELEASE`] semantics. It
42
- /// is used for read-modify-write operations.
43
- const ACQUIRE_RELEASE = 0x8 ;
44
-
45
- /// All observers see this memory access in the same order with respect to
46
- /// other sequentially-consistent memory accesses from this invocation.
47
- /// If the declared memory model is `vulkan`, `SEQUENTIALLY_CONST` must
48
- /// not be used.
49
- const SEQUENTIALLY_CONST = 0x10 ;
50
-
51
- /// Apply the memory-ordering constraints to
52
- /// [`crate::storage_class::StorageBuffer`],
53
- /// [`crate::storage_class::PhysicalStorageBuffer`], or
54
- /// [`crate::storage_class::Uniform`] Storage Class memory.
55
- const UNIFORM_MEMORY = 0x40 ;
56
-
57
- /// Apply the memory-ordering constraints to subgroup memory.
58
- const SUBGROUP_MEMORY = 0x80 ;
59
-
60
- /// Apply the memory-ordering constraints to
61
- /// [`crate::storage_class::Workgroup`] Storage Class memory.
62
- const WORKGROUP_MEMORY = 0x100 ;
63
-
64
- /// Apply the memory-ordering constraints to
65
- /// [`crate::storage_class::CrossWorkgroup`] Storage Class memory.
66
- const CROSS_WORKGROUP_MEMORY = 0x200 ;
67
-
68
- /// Apply the memory-ordering constraints to
69
- /// [`crate::storage_class::AtomicCounter`] Storage Class memory.
70
- const ATOMIC_COUNTER_MEMORY = 0x400 ;
71
-
72
- /// Apply the memory-ordering constraints to image contents (types declared
73
- /// by `OpTypeImage`), or to accesses done through pointers to the
74
- /// [`crate::storage_class::Image`] Storage Class.
75
- const IMAGE_MEMORY = 0x800 ;
76
-
77
- /// Apply the memory-ordering constraints to the
78
- /// [`crate::storage_class::Output`] Storage Class memory.
79
- const OUTPUT_MEMORY = 0x1000 ;
80
-
81
- /// Perform an availability operation on all references in the selected
82
- /// storage classes.
83
- const MAKE_AVAILABLE = 0x2000 ;
84
-
85
- /// Perform a visibility operation on all references in the selected
86
- /// storage classes.
87
- const MAKE_VISIBLE = 0x4000 ;
88
-
89
- /// This access cannot be eliminated, duplicated, or combined with
90
- /// other accesses.
91
- const VOLATILE = 0x8000 ;
92
- }
24
+ #[ derive( Debug , PartialEq , Eq ) ]
25
+ pub enum Semantics {
26
+ /// No memory semantics.
27
+ None = 0 ,
28
+
29
+ /// On an atomic instruction, orders memory operations provided in program
30
+ /// order after this atomic instruction against this atomic instruction. On
31
+ /// a barrier, orders memory operations provided in program order after this
32
+ /// barrier against atomic instructions before this barrier.
33
+ Acquire = 0x2 ,
34
+
35
+ /// On an atomic instruction, orders memory operations provided in program
36
+ /// order before this atomic instruction against this atomic instruction. On
37
+ /// a barrier, orders memory operations provided in program order before
38
+ /// this barrier against atomic instructions after this barrier.
39
+ Release = 0x4 ,
40
+
41
+ /// Has the properties of both [`Self::Acquire`] and [`Self::Release`] semantics. It
42
+ /// is used for read-modify-write operations.
43
+ AcquireRelease = 0x8 ,
44
+
45
+ /// All observers see this memory access in the same order with respect to
46
+ /// other sequentially-consistent memory accesses from this invocation.
47
+ /// If the declared memory model is `vulkan`, `SequentiallyConsistent` must
48
+ /// not be used.
49
+ SequentiallyConsistent = 0x10 ,
50
+
51
+ /// Apply the memory-ordering constraints to
52
+ /// [`crate::storage_class::StorageBuffer`],
53
+ /// [`crate::storage_class::PhysicalStorageBuffer`], or
54
+ /// [`crate::storage_class::Uniform`] Storage Class memory.
55
+ UniformMemory = 0x40 ,
56
+
57
+ /// Apply the memory-ordering constraints to subgroup memory.
58
+ SubgroupMemory = 0x80 ,
59
+
60
+ /// Apply the memory-ordering constraints to
61
+ /// [`crate::storage_class::Workgroup`] Storage Class memory.
62
+ WorkgroupMemory = 0x100 ,
63
+
64
+ /// Apply the memory-ordering constraints to
65
+ /// [`crate::storage_class::CrossWorkgroup`] Storage Class memory.
66
+ CrossWorkgroupMemory = 0x200 ,
67
+
68
+ /// Apply the memory-ordering constraints to
69
+ /// [`crate::storage_class::AtomicCounter`] Storage Class memory.
70
+ AtomicCounterMemory = 0x400 ,
71
+
72
+ /// Apply the memory-ordering constraints to image contents (types declared
73
+ /// by `OpTypeImage`), or to accesses done through pointers to the
74
+ /// [`crate::storage_class::Image`] Storage Class.
75
+ ImageMemory = 0x800 ,
76
+
77
+ /// Apply the memory-ordering constraints to the
78
+ /// [`crate::storage_class::Output`] Storage Class memory.
79
+ OutputMemory = 0x1000 ,
80
+
81
+ /// Perform an availability operation on all references in the selected
82
+ /// storage classes.
83
+ MakeAvailable = 0x2000 ,
84
+
85
+ /// Perform a visibility operation on all references in the selected
86
+ /// storage classes.
87
+ MakeVisible = 0x4000 ,
88
+
89
+ /// This access cannot be eliminated, duplicated, or combined with
90
+ /// other accesses.
91
+ Volatile = 0x8000 ,
93
92
}
0 commit comments