mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 04:54:46 +00:00
winevulkan: Convert pointers to pointer-sized variables in 32-bit thunks.
This commit is contained in:
parent
3ceae1dcaf
commit
a8539fc979
|
@ -1617,16 +1617,20 @@ class VkParam(VkVariable):
|
||||||
ret += " convert_{0}_{3}_to_{5}host({4}{1}{2}, {2}_host);\n".format(self.type, prefix, self.name, win_type, ctx_param, wrap_part)
|
ret += " convert_{0}_{3}_to_{5}host({4}{1}{2}, {2}_host);\n".format(self.type, prefix, self.name, win_type, ctx_param, wrap_part)
|
||||||
ret += " }\n"
|
ret += " }\n"
|
||||||
return ret
|
return ret
|
||||||
else:
|
elif self.is_struct():
|
||||||
return " convert_{0}_{3}_to_{5}host({4}{1}{2}, &{2}_host);\n".format(self.type, prefix, self.name, win_type, ctx_param, wrap_part)
|
return " convert_{0}_{3}_to_{5}host({4}{1}{2}, &{2}_host);\n".format(self.type, prefix, self.name, win_type, ctx_param, wrap_part)
|
||||||
|
else:
|
||||||
|
return " {1}_host = *{0}{1};\n".format(prefix, self.name)
|
||||||
else:
|
else:
|
||||||
if self.is_dynamic_array():
|
if self.is_dynamic_array():
|
||||||
return " convert_{0}_array_{1}host_to_{2}({3}_host, {4}{3}, {5});\n".format(
|
return " convert_{0}_array_{1}host_to_{2}({3}_host, {4}{3}, {5});\n".format(
|
||||||
self.type, wrap_part, win_type, self.name, prefix, self.get_dyn_array_len(prefix))
|
self.type, wrap_part, win_type, self.name, prefix, self.get_dyn_array_len(prefix))
|
||||||
else:
|
elif self.is_struct():
|
||||||
ref_part = "" if self.optional else "&"
|
ref_part = "" if self.optional else "&"
|
||||||
return " convert_{0}_host_to_{3}({4}{2}_host, {1}{2});\n".format(
|
return " convert_{0}_host_to_{3}({4}{2}_host, {1}{2});\n".format(
|
||||||
self.type, prefix, self.name, win_type, ref_part)
|
self.type, prefix, self.name, win_type, ref_part)
|
||||||
|
else:
|
||||||
|
return " *{0}{1} = {1}_host;\n".format(prefix, self.name)
|
||||||
|
|
||||||
def definition(self, postfix=None, is_member=False, conv=False):
|
def definition(self, postfix=None, is_member=False, conv=False):
|
||||||
""" Return prototype for the parameter. E.g. 'const char *foo' """
|
""" Return prototype for the parameter. E.g. 'const char *foo' """
|
||||||
|
@ -1684,9 +1688,9 @@ class VkParam(VkVariable):
|
||||||
return self.struct.needs_conversion(conv, unwrap, direction, self.is_const())
|
return self.struct.needs_conversion(conv, unwrap, direction, self.is_const())
|
||||||
|
|
||||||
if self.is_handle():
|
if self.is_handle():
|
||||||
# non-array handles are handled inline in thunks
|
# non-pointer handles are handled inline in thunks
|
||||||
if not self.is_dynamic_array() and not self.is_static_array():
|
if not self.is_dynamic_array() and not self.is_static_array():
|
||||||
return False
|
return conv and self.is_pointer() and self.handle.is_dispatchable()
|
||||||
|
|
||||||
# vkAllocateCommandBuffers is a special case, we use it in our private thunk as an input param
|
# vkAllocateCommandBuffers is a special case, we use it in our private thunk as an input param
|
||||||
param_direction = (Direction.INPUT if self.is_const() else Direction.OUTPUT)
|
param_direction = (Direction.INPUT if self.is_const() else Direction.OUTPUT)
|
||||||
|
@ -1699,6 +1703,8 @@ class VkParam(VkVariable):
|
||||||
return True
|
return True
|
||||||
if conv and self.handle.is_dispatchable():
|
if conv and self.handle.is_dispatchable():
|
||||||
return True
|
return True
|
||||||
|
elif self.is_pointer() and self.is_pointer_size():
|
||||||
|
return conv
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -33296,13 +33296,16 @@ static NTSTATUS thunk32_vkCreateDevice(void *args)
|
||||||
VkResult result;
|
VkResult result;
|
||||||
} *params = args;
|
} *params = args;
|
||||||
VkDeviceCreateInfo pCreateInfo_host;
|
VkDeviceCreateInfo pCreateInfo_host;
|
||||||
|
VkDevice pDevice_host;
|
||||||
struct conversion_context ctx;
|
struct conversion_context ctx;
|
||||||
|
|
||||||
TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pCreateInfo, params->pAllocator, params->pDevice);
|
TRACE("%p, %p, %p, %p\n", params->physicalDevice, params->pCreateInfo, params->pAllocator, params->pDevice);
|
||||||
|
|
||||||
init_conversion_context(&ctx);
|
init_conversion_context(&ctx);
|
||||||
convert_VkDeviceCreateInfo_win32_to_host(&ctx, params->pCreateInfo, &pCreateInfo_host);
|
convert_VkDeviceCreateInfo_win32_to_host(&ctx, params->pCreateInfo, &pCreateInfo_host);
|
||||||
params->result = wine_vkCreateDevice(params->physicalDevice, &pCreateInfo_host, params->pAllocator, params->pDevice, params->client_ptr);
|
pDevice_host = *params->pDevice;
|
||||||
|
params->result = wine_vkCreateDevice(params->physicalDevice, &pCreateInfo_host, params->pAllocator, &pDevice_host, params->client_ptr);
|
||||||
|
*params->pDevice = pDevice_host;
|
||||||
free_conversion_context(&ctx);
|
free_conversion_context(&ctx);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -33610,13 +33613,16 @@ static NTSTATUS thunk32_vkCreateInstance(void *args)
|
||||||
VkResult result;
|
VkResult result;
|
||||||
} *params = args;
|
} *params = args;
|
||||||
VkInstanceCreateInfo pCreateInfo_host;
|
VkInstanceCreateInfo pCreateInfo_host;
|
||||||
|
VkInstance pInstance_host;
|
||||||
struct conversion_context ctx;
|
struct conversion_context ctx;
|
||||||
|
|
||||||
TRACE("%p, %p, %p\n", params->pCreateInfo, params->pAllocator, params->pInstance);
|
TRACE("%p, %p, %p\n", params->pCreateInfo, params->pAllocator, params->pInstance);
|
||||||
|
|
||||||
init_conversion_context(&ctx);
|
init_conversion_context(&ctx);
|
||||||
convert_VkInstanceCreateInfo_win32_to_host(&ctx, params->pCreateInfo, &pCreateInfo_host);
|
convert_VkInstanceCreateInfo_win32_to_host(&ctx, params->pCreateInfo, &pCreateInfo_host);
|
||||||
params->result = wine_vkCreateInstance(&pCreateInfo_host, params->pAllocator, params->pInstance, params->client_ptr);
|
pInstance_host = *params->pInstance;
|
||||||
|
params->result = wine_vkCreateInstance(&pCreateInfo_host, params->pAllocator, &pInstance_host, params->client_ptr);
|
||||||
|
*params->pInstance = pInstance_host;
|
||||||
free_conversion_context(&ctx);
|
free_conversion_context(&ctx);
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -37477,10 +37483,13 @@ static NTSTATUS thunk32_vkGetDeviceQueue(void *args)
|
||||||
uint32_t queueIndex;
|
uint32_t queueIndex;
|
||||||
VkQueue *pQueue;
|
VkQueue *pQueue;
|
||||||
} *params = args;
|
} *params = args;
|
||||||
|
VkQueue pQueue_host;
|
||||||
|
|
||||||
TRACE("%p, %u, %u, %p\n", params->device, params->queueFamilyIndex, params->queueIndex, params->pQueue);
|
TRACE("%p, %u, %u, %p\n", params->device, params->queueFamilyIndex, params->queueIndex, params->pQueue);
|
||||||
|
|
||||||
wine_vkGetDeviceQueue(params->device, params->queueFamilyIndex, params->queueIndex, params->pQueue);
|
pQueue_host = *params->pQueue;
|
||||||
|
wine_vkGetDeviceQueue(params->device, params->queueFamilyIndex, params->queueIndex, &pQueue_host);
|
||||||
|
*params->pQueue = pQueue_host;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37509,11 +37518,14 @@ static NTSTATUS thunk32_vkGetDeviceQueue2(void *args)
|
||||||
VkQueue *pQueue;
|
VkQueue *pQueue;
|
||||||
} *params = args;
|
} *params = args;
|
||||||
VkDeviceQueueInfo2 pQueueInfo_host;
|
VkDeviceQueueInfo2 pQueueInfo_host;
|
||||||
|
VkQueue pQueue_host;
|
||||||
|
|
||||||
TRACE("%p, %p, %p\n", params->device, params->pQueueInfo, params->pQueue);
|
TRACE("%p, %p, %p\n", params->device, params->pQueueInfo, params->pQueue);
|
||||||
|
|
||||||
convert_VkDeviceQueueInfo2_win32_to_host(params->pQueueInfo, &pQueueInfo_host);
|
convert_VkDeviceQueueInfo2_win32_to_host(params->pQueueInfo, &pQueueInfo_host);
|
||||||
wine_vkGetDeviceQueue2(params->device, &pQueueInfo_host, params->pQueue);
|
pQueue_host = *params->pQueue;
|
||||||
|
wine_vkGetDeviceQueue2(params->device, &pQueueInfo_host, &pQueue_host);
|
||||||
|
*params->pQueue = pQueue_host;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39818,10 +39830,13 @@ static NTSTATUS thunk32_vkGetPipelineCacheData(void *args)
|
||||||
void *pData;
|
void *pData;
|
||||||
VkResult result;
|
VkResult result;
|
||||||
} *params = args;
|
} *params = args;
|
||||||
|
size_t pDataSize_host;
|
||||||
|
|
||||||
TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pDataSize, params->pData);
|
TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->pDataSize, params->pData);
|
||||||
|
|
||||||
params->result = wine_device_from_handle(params->device)->funcs.p_vkGetPipelineCacheData(wine_device_from_handle(params->device)->device, params->pipelineCache, params->pDataSize, params->pData);
|
pDataSize_host = *params->pDataSize;
|
||||||
|
params->result = wine_device_from_handle(params->device)->funcs.p_vkGetPipelineCacheData(wine_device_from_handle(params->device)->device, params->pipelineCache, &pDataSize_host, params->pData);
|
||||||
|
*params->pDataSize = pDataSize_host;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40420,10 +40435,13 @@ static NTSTATUS thunk32_vkGetShaderInfoAMD(void *args)
|
||||||
void *pInfo;
|
void *pInfo;
|
||||||
VkResult result;
|
VkResult result;
|
||||||
} *params = args;
|
} *params = args;
|
||||||
|
size_t pInfoSize_host;
|
||||||
|
|
||||||
TRACE("%p, 0x%s, %#x, %#x, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shaderStage, params->infoType, params->pInfoSize, params->pInfo);
|
TRACE("%p, 0x%s, %#x, %#x, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipeline), params->shaderStage, params->infoType, params->pInfoSize, params->pInfo);
|
||||||
|
|
||||||
params->result = wine_device_from_handle(params->device)->funcs.p_vkGetShaderInfoAMD(wine_device_from_handle(params->device)->device, params->pipeline, params->shaderStage, params->infoType, params->pInfoSize, params->pInfo);
|
pInfoSize_host = *params->pInfoSize;
|
||||||
|
params->result = wine_device_from_handle(params->device)->funcs.p_vkGetShaderInfoAMD(wine_device_from_handle(params->device)->device, params->pipeline, params->shaderStage, params->infoType, &pInfoSize_host, params->pInfo);
|
||||||
|
*params->pInfoSize = pInfoSize_host;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40559,10 +40577,13 @@ static NTSTATUS thunk32_vkGetValidationCacheDataEXT(void *args)
|
||||||
void *pData;
|
void *pData;
|
||||||
VkResult result;
|
VkResult result;
|
||||||
} *params = args;
|
} *params = args;
|
||||||
|
size_t pDataSize_host;
|
||||||
|
|
||||||
TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pDataSize, params->pData);
|
TRACE("%p, 0x%s, %p, %p\n", params->device, wine_dbgstr_longlong(params->validationCache), params->pDataSize, params->pData);
|
||||||
|
|
||||||
params->result = wine_device_from_handle(params->device)->funcs.p_vkGetValidationCacheDataEXT(wine_device_from_handle(params->device)->device, params->validationCache, params->pDataSize, params->pData);
|
pDataSize_host = *params->pDataSize;
|
||||||
|
params->result = wine_device_from_handle(params->device)->funcs.p_vkGetValidationCacheDataEXT(wine_device_from_handle(params->device)->device, params->validationCache, &pDataSize_host, params->pData);
|
||||||
|
*params->pDataSize = pDataSize_host;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue