Why in vulkan.h non-sending objects are always dialed up to 64 bits?

Peering at vulkan.h, I see this:

#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || ..... #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object; #else #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object; #endif 

Does anyone have an idea why 64 bit? Itโ€™s wiser for me to always use the first case of ifdef

+5
source share
1 answer

The spec explicitly states that unallocated descriptors must be 64 bits:

Non-downloadable descriptor types are a 64-bit integer type whose value is implementation-dependent and can encode object information directly in the descriptor, rather than pointing to the software structure. Objects of a non-distributable type may not have unique descriptor values โ€‹โ€‹within a type or between types. If the descriptor values โ€‹โ€‹are not unique, then the destruction of one such handle should not cause identical handles of other types to become invalid and should not call identical the same type to become invalid if this handle value was created more than it was destroyed.

+5
source

Source: https://habr.com/ru/post/1243683/


All Articles