About 'dispatchable' object in Vulkan

I’ve read the Object model chapter in Vulkan specification,and the following description confuse me:
‘At the API level, all objects are referred to by handles. There are two classes of handles, dispatchable and non-dispatchable. Dispatchable handle types are a pointer to an opaque type. This pointer may be used by layers as part of intercepting API commands, and thus each API command takes a dispatchable type as its first parameter. Each object of a dispatchable type must have a unique handle value during its lifetime
I think the object handle like VKDevice is a pointer, and the pointer may be copy.For example,the vulkanGuide tutorial use cpature-by-value lambda to delete vulkan objects when program is over, is that a violation of ‘must have unique handle value’? Or more commonly,should programers always make sure that the handles never get copied,like unique_ptr?

Each object of a dispatchable type must have a unique handle value during its lifetime

The sentence addresses drivers and layers. As in, when you vkCreate* stuff, it would give you an unique value for the handle, if it is dispatchable. The value is only unique for the lifetime; i.e. it could give you a duplicate value, assuming the previous handle that had that same value was already vkDestroy*ed.

The samantics is similar to a pointer, and typically implemented by a pointer.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.