Commit 9ca95e32 authored by Georg Lehmann's avatar Georg Lehmann Committed by Alexandre Julliard

winevulkan: Override VK_USE_64_BIT_PTR_DEFINES instead of handle definition.

A bit simpler and more consistent because currently VK_USE_64_BIT_PTR_DEFINES can be 1 but non dipatchable handles are always unit64_t. Signed-off-by: 's avatarGeorg Lehmann <dadschoorse@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent feb88dfe
......@@ -319,15 +319,11 @@ class VkDefine(object):
# <type category="define" name="some_name">some_value</type>
name = define.attrib.get("name")
# We override behavior of VK_DEFINE_NON_DISPATCHABLE handle as the default
# We override behavior of VK_USE_64_BIT_PTR_DEFINES as the default non-dispatchable handle
# definition various between 64-bit (uses pointers) and 32-bit (uses uint64_t).
# This complicates TRACEs in the thunks, so just use uint64_t.
if name == "VK_DEFINE_NON_DISPATCHABLE_HANDLE":
value = "#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;"
# As VK_DEFINE_NON_DISPATCHABLE handle is overriden above, we must also override
# VK_NULL_HANDLE so that its type will match.
elif name == "VK_NULL_HANDLE":
value = "#define VK_NULL_HANDLE 0ULL"
if name == "VK_USE_64_BIT_PTR_DEFINES":
value = "#define VK_USE_64_BIT_PTR_DEFINES 0"
else:
value = define.text
return VkDefine(name, value)
......
......@@ -449,16 +449,30 @@
#define VK_HEADER_VERSION 176
#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 2, VK_HEADER_VERSION)
#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
#define VK_USE_64_BIT_PTR_DEFINES 0
#ifndef VK_USE_64_BIT_PTR_DEFINES
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
#define VK_USE_64_BIT_PTR_DEFINES 1
#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE
#if (VK_USE_64_BIT_PTR_DEFINES==1)
#if __cplusplus >= 201103L || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L))
#define VK_NULL_HANDLE nullptr
#else
#define VK_USE_64_BIT_PTR_DEFINES 0
#endif
#define VK_NULL_HANDLE ((void*)0)
#endif
#else
#define VK_NULL_HANDLE 0ULL
#endif
#endif
#ifndef VK_NULL_HANDLE
#define VK_NULL_HANDLE 0
#endif
#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE
#if (VK_USE_64_BIT_PTR_DEFINES==1)
#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
#endif
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureNV)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment