@@ -2651,18 +2651,38 @@ 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) { return ImageOperandsMask (~unsigned (a)); }
2657
2659
inline FPFastMathModeMask operator |(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask (unsigned (a) | unsigned (b)); }
2660
+ inline FPFastMathModeMask operator &(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask (unsigned (a) & unsigned (b)); }
2661
+ inline FPFastMathModeMask operator ~(FPFastMathModeMask a) { return FPFastMathModeMask (~unsigned (a)); }
2658
2662
inline SelectionControlMask operator |(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask (unsigned (a) | unsigned (b)); }
2663
+ inline SelectionControlMask operator &(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask (unsigned (a) & unsigned (b)); }
2664
+ inline SelectionControlMask operator ~(SelectionControlMask a) { return SelectionControlMask (~unsigned (a)); }
2659
2665
inline LoopControlMask operator |(LoopControlMask a, LoopControlMask b) { return LoopControlMask (unsigned (a) | unsigned (b)); }
2666
+ inline LoopControlMask operator &(LoopControlMask a, LoopControlMask b) { return LoopControlMask (unsigned (a) & unsigned (b)); }
2667
+ inline LoopControlMask operator ~(LoopControlMask a) { return LoopControlMask (~unsigned (a)); }
2660
2668
inline FunctionControlMask operator |(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask (unsigned (a) | unsigned (b)); }
2669
+ inline FunctionControlMask operator &(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask (unsigned (a) & unsigned (b)); }
2670
+ inline FunctionControlMask operator ~(FunctionControlMask a) { return FunctionControlMask (~unsigned (a)); }
2661
2671
inline MemorySemanticsMask operator |(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask (unsigned (a) | unsigned (b)); }
2672
+ inline MemorySemanticsMask operator &(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask (unsigned (a) & unsigned (b)); }
2673
+ inline MemorySemanticsMask operator ~(MemorySemanticsMask a) { return MemorySemanticsMask (~unsigned (a)); }
2662
2674
inline MemoryAccessMask operator |(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask (unsigned (a) | unsigned (b)); }
2675
+ inline MemoryAccessMask operator &(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask (unsigned (a) & unsigned (b)); }
2676
+ inline MemoryAccessMask operator ~(MemoryAccessMask a) { return MemoryAccessMask (~unsigned (a)); }
2663
2677
inline KernelProfilingInfoMask operator |(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask (unsigned (a) | unsigned (b)); }
2678
+ inline KernelProfilingInfoMask operator &(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask (unsigned (a) & unsigned (b)); }
2679
+ inline KernelProfilingInfoMask operator ~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask (~unsigned (a)); }
2664
2680
inline RayFlagsMask operator |(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask (unsigned (a) | unsigned (b)); }
2681
+ inline RayFlagsMask operator &(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask (unsigned (a) & unsigned (b)); }
2682
+ inline RayFlagsMask operator ~(RayFlagsMask a) { return RayFlagsMask (~unsigned (a)); }
2665
2683
inline FragmentShadingRateMask operator |(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask (unsigned (a) | unsigned (b)); }
2684
+ inline FragmentShadingRateMask operator &(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask (unsigned (a) & unsigned (b)); }
2685
+ inline FragmentShadingRateMask operator ~(FragmentShadingRateMask a) { return FragmentShadingRateMask (~unsigned (a)); }
2666
2686
2667
2687
} // end namespace spv
2668
2688
0 commit comments