@@ -2651,18 +2651,48 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
2651
2651
}
2652
2652
#endif /* SPV_ENABLE_UTILITY_CODE */
2653
2653
2654
- // Overload operator| for mask bit combining
2654
+ // Overload bitwise operators for mask bit combining
2655
2655
2656
2656
inline ImageOperandsMask operator |(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask (unsigned (a) | unsigned (b)); }
2657
+ inline ImageOperandsMask operator &(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask (unsigned (a) & unsigned (b)); }
2658
+ inline ImageOperandsMask operator ^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask (unsigned (a) ^ unsigned (b)); }
2659
+ inline ImageOperandsMask operator ~(ImageOperandsMask a) { return ImageOperandsMask (~unsigned (a)); }
2657
2660
inline FPFastMathModeMask operator |(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask (unsigned (a) | unsigned (b)); }
2661
+ inline FPFastMathModeMask operator &(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask (unsigned (a) & unsigned (b)); }
2662
+ inline FPFastMathModeMask operator ^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask (unsigned (a) ^ unsigned (b)); }
2663
+ inline FPFastMathModeMask operator ~(FPFastMathModeMask a) { return FPFastMathModeMask (~unsigned (a)); }
2658
2664
inline SelectionControlMask operator |(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask (unsigned (a) | unsigned (b)); }
2665
+ inline SelectionControlMask operator &(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask (unsigned (a) & unsigned (b)); }
2666
+ inline SelectionControlMask operator ^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask (unsigned (a) ^ unsigned (b)); }
2667
+ inline SelectionControlMask operator ~(SelectionControlMask a) { return SelectionControlMask (~unsigned (a)); }
2659
2668
inline LoopControlMask operator |(LoopControlMask a, LoopControlMask b) { return LoopControlMask (unsigned (a) | unsigned (b)); }
2669
+ inline LoopControlMask operator &(LoopControlMask a, LoopControlMask b) { return LoopControlMask (unsigned (a) & unsigned (b)); }
2670
+ inline LoopControlMask operator ^(LoopControlMask a, LoopControlMask b) { return LoopControlMask (unsigned (a) ^ unsigned (b)); }
2671
+ inline LoopControlMask operator ~(LoopControlMask a) { return LoopControlMask (~unsigned (a)); }
2660
2672
inline FunctionControlMask operator |(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask (unsigned (a) | unsigned (b)); }
2673
+ inline FunctionControlMask operator &(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask (unsigned (a) & unsigned (b)); }
2674
+ inline FunctionControlMask operator ^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask (unsigned (a) ^ unsigned (b)); }
2675
+ inline FunctionControlMask operator ~(FunctionControlMask a) { return FunctionControlMask (~unsigned (a)); }
2661
2676
inline MemorySemanticsMask operator |(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask (unsigned (a) | unsigned (b)); }
2677
+ inline MemorySemanticsMask operator &(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask (unsigned (a) & unsigned (b)); }
2678
+ inline MemorySemanticsMask operator ^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask (unsigned (a) ^ unsigned (b)); }
2679
+ inline MemorySemanticsMask operator ~(MemorySemanticsMask a) { return MemorySemanticsMask (~unsigned (a)); }
2662
2680
inline MemoryAccessMask operator |(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask (unsigned (a) | unsigned (b)); }
2681
+ inline MemoryAccessMask operator &(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask (unsigned (a) & unsigned (b)); }
2682
+ inline MemoryAccessMask operator ^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask (unsigned (a) ^ unsigned (b)); }
2683
+ inline MemoryAccessMask operator ~(MemoryAccessMask a) { return MemoryAccessMask (~unsigned (a)); }
2663
2684
inline KernelProfilingInfoMask operator |(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask (unsigned (a) | unsigned (b)); }
2685
+ inline KernelProfilingInfoMask operator &(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask (unsigned (a) & unsigned (b)); }
2686
+ inline KernelProfilingInfoMask operator ^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask (unsigned (a) ^ unsigned (b)); }
2687
+ inline KernelProfilingInfoMask operator ~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask (~unsigned (a)); }
2664
2688
inline RayFlagsMask operator |(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask (unsigned (a) | unsigned (b)); }
2689
+ inline RayFlagsMask operator &(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask (unsigned (a) & unsigned (b)); }
2690
+ inline RayFlagsMask operator ^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask (unsigned (a) ^ unsigned (b)); }
2691
+ inline RayFlagsMask operator ~(RayFlagsMask a) { return RayFlagsMask (~unsigned (a)); }
2665
2692
inline FragmentShadingRateMask operator |(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask (unsigned (a) | unsigned (b)); }
2693
+ inline FragmentShadingRateMask operator &(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask (unsigned (a) & unsigned (b)); }
2694
+ inline FragmentShadingRateMask operator ^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask (unsigned (a) ^ unsigned (b)); }
2695
+ inline FragmentShadingRateMask operator ~(FragmentShadingRateMask a) { return FragmentShadingRateMask (~unsigned (a)); }
2666
2696
2667
2697
} // end namespace spv
2668
2698
0 commit comments