Commit 49752f34 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winevulkan: Get rid of unix_funcs.

parent 395061e3
......@@ -34,7 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
DEFINE_DEVPROPKEY(DEVPROPKEY_GPU_LUID, 0x60b193cb, 0x5276, 0x4d0f, 0x96, 0xfc, 0xf1, 0x73, 0xab, 0xad, 0x3e, 0xc6, 2);
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_GPU_VULKAN_UUID, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5c, 2);
const struct unix_funcs *unix_funcs;
NTSTATUS (WINAPI *p_vk_direct_unix_call)(unixlib_handle_t handle, unsigned int code, void *args);
unixlib_handle_t unix_handle;
static HINSTANCE hinstance;
......@@ -231,7 +231,9 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
&unix_handle, sizeof(unix_handle), NULL))
return FALSE;
return !vk_unix_call(unix_init, &unix_funcs);
if (vk_unix_call(unix_init, &p_vk_direct_unix_call)) return FALSE;
if (!p_vk_direct_unix_call) p_vk_direct_unix_call = __wine_unix_call;
return TRUE;
}
static BOOL wine_vk_init_once(void)
......
......@@ -176,7 +176,7 @@ class ThunkType(Enum):
# - PUBLIC means the implementation is fully auto generated.
# - PRIVATE thunks can be used in custom implementations for
# struct conversion.
# - loader_thunk sets whether to create a thunk for unix_funcs.
# - loader_thunk sets whether to create a thunk for unix funcs.
FUNCTION_OVERRIDES = {
# Global functions
"vkCreateInstance" : {"dispatch" : False, "driver" : True, "thunk" : ThunkType.NONE, "loader_thunk" : ThunkType.PRIVATE},
......@@ -777,7 +777,7 @@ class VkFunction(object):
if self.type != "void" and not self.returns_longlong():
body += "return "
if self.needs_direct_call():
body += "unix_funcs->p_vk_call(unix_{0}, &params);\n".format(self.name)
body += "p_vk_direct_unix_call(unix_handle, unix_{0}, &params);\n".format(self.name)
else:
body += "vk_unix_call(unix_{0}, &params);\n".format(self.name)
if self.returns_longlong():
......@@ -2851,15 +2851,10 @@ class VkGenerator(object):
f.write("};\n")
f.write("C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count);\n\n")
f.write("static NTSTATUS WINAPI wine_vk_call(enum unix_call code, void *params)\n")
f.write("NTSTATUS WINAPI vk_direct_unix_call(unixlib_handle_t handle, unsigned int code, void *params)\n")
f.write("{\n")
f.write(" return __wine_unix_call_funcs[code](params);\n")
f.write("}\n\n")
f.write("const struct unix_funcs loader_funcs =\n")
f.write("{\n")
f.write(" wine_vk_call,\n")
f.write("};\n")
f.write("}\n")
def generate_thunks_h(self, f, prefix):
self._generate_copyright(f)
......
......@@ -444,7 +444,7 @@ NTSTATUS init_vulkan(void *args)
}
*(const struct unix_funcs **)args = &loader_funcs;
*(void **)args = vk_direct_unix_call;
return STATUS_SUCCESS;
}
......
......@@ -106,7 +106,8 @@ struct is_available_device_function_params
const char *name;
};
extern const struct unix_funcs *unix_funcs;
extern NTSTATUS (WINAPI *p_vk_direct_unix_call)(unixlib_handle_t handle, unsigned int code,
void *args) DECLSPEC_HIDDEN;
extern unixlib_handle_t unix_handle DECLSPEC_HIDDEN;
static inline NTSTATUS vk_unix_call(enum unix_call code, void *params)
......@@ -114,9 +115,4 @@ static inline NTSTATUS vk_unix_call(enum unix_call code, void *params)
return __wine_unix_call(unix_handle, code, params);
}
struct unix_funcs
{
NTSTATUS (WINAPI *p_vk_call)(enum unix_call, void *);
};
#endif /* __WINE_VULKAN_LOADER_H */
......@@ -212,7 +212,7 @@ uint64_t wine_vk_unwrap_handle(VkObjectType type, uint64_t handle) DECLSPEC_HIDD
NTSTATUS init_vulkan(void *args) DECLSPEC_HIDDEN;
extern const struct unix_funcs loader_funcs;
NTSTATUS WINAPI vk_direct_unix_call(unixlib_handle_t handle, unsigned int code, void *arg) DECLSPEC_HIDDEN;
NTSTATUS vk_is_available_instance_function(void *arg) DECLSPEC_HIDDEN;
NTSTATUS vk_is_available_device_function(void *arg) DECLSPEC_HIDDEN;
......
......@@ -10751,12 +10751,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
};
C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count);
static NTSTATUS WINAPI wine_vk_call(enum unix_call code, void *params)
NTSTATUS WINAPI vk_direct_unix_call(unixlib_handle_t handle, unsigned int code, void *params)
{
return __wine_unix_call_funcs[code](params);
}
const struct unix_funcs loader_funcs =
{
wine_vk_call,
};
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