vulkan_int/
macros.rs

1#[macro_export]
2macro_rules! vulkan_int_operation_impl {
3    (
4        $trait:
5            ident,
6        
7        $method:
8            ident,
9        
10        $op:
11            tt
12    ) => {
13        impl
14            $trait for
15                VulkanInt {
16                    type Output =
17                        VulkanInt;
18                    
19                    fn $method(
20                        self:
21                            VulkanInt,
22                        
23                        other:
24                            VulkanInt
25                    ) ->
26                        Self::Output {
27                            VulkanInt {
28                                value:
29                                    clamp::
30                                        clamp(
31                                            self
32                                                .value $op 
33                                            other
34                                                .value,
35                                            
36                                            -54 ..= 54
37                                        )
38                            }
39                        }
40                }
41    }
42}