[vk::binding(0, 0)] uniform __DynamicResource<__DynamicResourceKind.Sampler> gTextures[]; public struct RID where T : IOpaqueDescriptor { private uint internal; private const static uint INDEX_MASK = 0x0007FFFF; private const static uint GENERATION_MASK = ~INDEX_MASK; public property bool hasValue { get { return (internal & GENERATION_MASK) > 0; } } public property T value { get { // TODO: Check if has value else placeholder. return gTextures[internal & INDEX_MASK].asOpaqueDescriptor(); } } } public extension T where T: IOpaqueDescriptor { public typealias RID = RID; }