Cool glad to see that these requirements can be relaxed without any major 
issue. While we are it, I have a proposal that would make C bindings a bit less 
cumbersome. So nim sets can't be casted to C bitflags, because the enums are 
converted to powers of two automatically. But if there was a .flagbits pragma 
for enums that could influence how sets are made from this enum, that would 
guarantee full compatibility with C bitflags. Think about it people!
    
    
    type
      VkAccessFlagBits* {.size: sizeof(int32), flagbits.} = enum
        IndirectCommandReadBit = 1
        IndexReadBit
        VertexAttributeReadBit = 4
        UniformReadBit = 8
        InputAttachmentReadBit = 16
        ShaderReadBit = 32
        ShaderWriteBit = 64
        ColorAttachmentReadBit = 128
        ColorAttachmentWriteBit = 256
        DepthStencilAttachmentReadBit = 512
        DepthStencilAttachmentWriteBit = 1024
        TransferReadBit = 2048
        TransferWriteBit = 4096
        HostReadBit = 8192
        HostWriteBit = 16384
        MemoryReadBit = 32768
        MemoryWriteBit = 65536
    
    VkAccessFlags* {.size: sizeof(uint32) = set[VkAccessFlagBits]
    
    
    Run

Reply via email to