Hi all,
This wave of patches gets winevulkan to a usable state. Many simple applications such as Doom, Wolfenstein II and many others including dxvk should now work.
Use of winevulkan at this point requires installation of Windows Vulkan SDK e.g. through winetricks (latest version). In addition registry settings and winevulkan.json need to be added by hand, which will be improved in the future.
Thanks, Roderick
Roderick Colenbrander (7): winevulkan: Implement vkQueueSubmit. winevulkan: Implement vkQueuePresentInfoKHR. winevulkan: Implement vkQueueBindSparse and vkQueueWaitIdle. winevulkan: Filter graphics driver reported instance extensions. winevulkan: Implement VK_KHR_get_physical_device_properties2 winevulkan: Allow vkGetDeviceProcAddr to load instance functions for broken games. winevulkan: Support various device extensions.
dlls/winevulkan/make_vulkan | 96 +++++-- dlls/winevulkan/vulkan.c | 146 ++++++++++- dlls/winevulkan/vulkan_thunks.c | 545 +++++++++++++++++++++++++++++++++++++--- dlls/winevulkan/vulkan_thunks.h | 191 ++++++++++++-- dlls/winex11.drv/vulkan.c | 60 ++++- include/wine/vulkan.h | 458 ++++++++++++++++++++++----------- 6 files changed, 1257 insertions(+), 239 deletions(-)
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/make_vulkan | 1 + dlls/winevulkan/vulkan.c | 56 +++++++++++++++++++++++++++++++++++++++++ dlls/winevulkan/vulkan_thunks.c | 6 ----- dlls/winevulkan/vulkan_thunks.h | 1 + 4 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index 5c5f38f40f..af2b369f05 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -117,6 +117,7 @@ FUNCTION_OVERRIDES = { "vkFreeCommandBuffers" : {"dispatch" : True, "driver" : False, "thunk" : False}, "vkGetDeviceProcAddr" : {"dispatch" : True, "driver" : True, "thunk" : False}, "vkGetDeviceQueue" : {"dispatch": True, "driver" : False, "thunk" : False}, + "vkQueueSubmit" : {"dispatch": True, "driver" : False, "thunk" : False},
# VK_KHR_surface "vkDestroySurfaceKHR" : {"dispatch" : True, "driver" : True, "thunk" : False}, diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 0a5a77dcf3..08a957bc22 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -968,6 +968,62 @@ VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supporte return VK_SUCCESS; }
+VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t count, + const VkSubmitInfo *submits, VkFence fence) +{ + VkSubmitInfo *submits_host; + VkResult res; + VkCommandBuffer *command_buffers; + unsigned int i, j, num_command_buffers; + + TRACE("%p %u %p 0x%s\n", queue, count, submits, wine_dbgstr_longlong(fence)); + + if (count == 0) + { + return queue->device->funcs.p_vkQueueSubmit(queue->queue, 0, NULL, fence); + } + + submits_host = heap_calloc(count, sizeof(*submits_host)); + if (!submits_host) + { + ERR("Unable to allocate memory for submit buffers!\n"); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } + + for (i = 0; i < count; i++) + { + memcpy(&submits_host[i], &submits[i], sizeof(*submits_host)); + + num_command_buffers = submits[i].commandBufferCount; + command_buffers = heap_calloc(num_command_buffers, sizeof(*submits_host)); + if (!command_buffers) + { + ERR("Unable to allocate memory for comman buffers!\n"); + res = VK_ERROR_OUT_OF_HOST_MEMORY; + goto err; + } + + for (j = 0; j < num_command_buffers; j++) + { + command_buffers[j] = submits[i].pCommandBuffers[j]->command_buffer; + } + submits_host[i].pCommandBuffers = command_buffers; + } + + res = queue->device->funcs.p_vkQueueSubmit(queue->queue, count, submits_host, fence); + +err: + for (i = 0; i < count; i++) + { + heap_free((void *)submits_host[i].pCommandBuffers); + } + heap_free(submits_host); + + TRACE("Returning %d\n", res); + return res; +} + + BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved) { switch (reason) diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index f1be25ed75..285c7cb652 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -1641,12 +1641,6 @@ static VkResult WINAPI wine_vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCo return VK_ERROR_OUT_OF_HOST_MEMORY; }
-static VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) -{ - FIXME("stub: %p, %u, %p, 0x%s\n", queue, submitCount, pSubmits, wine_dbgstr_longlong(fence)); - return VK_ERROR_OUT_OF_HOST_MEMORY; -} - static VkResult WINAPI wine_vkQueueWaitIdle(VkQueue queue) { FIXME("stub: %p\n", queue); diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index 951945d548..ae95e938ed 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -37,6 +37,7 @@ VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physi VkBool32 WINAPI wine_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) DECLSPEC_HIDDEN; VkResult WINAPI wine_vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages) DECLSPEC_HIDDEN; VkResult WINAPI wine_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) DECLSPEC_HIDDEN; +VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) DECLSPEC_HIDDEN;
typedef struct VkCommandBufferAllocateInfo_host {
Signed-off-by: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/vulkan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 08a957bc22..8547531247 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -933,8 +933,8 @@ VkResult WINAPI wine_vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swa
VkResult WINAPI wine_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *present_info) { - FIXME("stub: %p, %p\n", queue, present_info); - return VK_ERROR_OUT_OF_HOST_MEMORY; + TRACE("%p, %p\n", queue, present_info); + return vk_funcs->p_vkQueuePresentKHR(queue->queue, present_info); }
void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name)
Signed-off-by: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/make_vulkan | 22 +---- dlls/winevulkan/vulkan_thunks.c | 210 +++++++++++++++++++++++++++++++++++++++- dlls/winevulkan/vulkan_thunks.h | 60 ++++++++++++ 3 files changed, 268 insertions(+), 24 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index af2b369f05..c835b997fc 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -394,14 +394,6 @@ class VkFunction(object): def needs_dispatch(self): return self.dispatch
- def needs_stub(self): - """ Temporary function to limit script hacks until more code is implemented. """ - - if self.params[0].type in ["VkQueue"]: - return True - - return False - def needs_thunk(self): return self.thunk_needed
@@ -1692,10 +1684,6 @@ class VkGenerator(object): if not func.is_required(): continue
- # Temporary filter. - if func.needs_stub(): - continue - if not func.needs_conversion(): continue
@@ -1745,11 +1733,7 @@ class VkGenerator(object): if not vk_func.needs_thunk(): continue
- # Temporary filter. - if vk_func.needs_stub(): - f.write("static " + vk_func.stub(prefix=prefix, call_conv="WINAPI")) - else: - f.write("static " + vk_func.thunk(prefix=prefix, call_conv="WINAPI")) + f.write("static " + vk_func.thunk(prefix=prefix, call_conv="WINAPI"))
f.write("static const struct vulkan_func vk_device_dispatch_table[] =\n{\n") for vk_func in self.registry.device_funcs: @@ -1863,9 +1847,7 @@ class VkGenerator(object): LOGGER.debug("skipping {0} in vulkan_device_funcs".format(vk_func.name)) continue
- # Temporary filter out functions, which need conversion, but for which - # we are only implemented stubs at this point. - if not vk_func.needs_stub() and vk_func.needs_conversion(): + if vk_func.needs_conversion(): f.write("#if defined(USE_STRUCT_CONVERSION)\n") f.write(" {0};\n".format(vk_func.pfn(conv=True))) f.write("#else\n") diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 285c7cb652..4b635c2645 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -600,6 +600,196 @@ static inline void convert_VkPhysicalDeviceProperties_host_to_win(const VkPhysic out->sparseProperties = in->sparseProperties; }
+static inline VkSparseMemoryBind_host *convert_VkSparseMemoryBind_array_win_to_host(const VkSparseMemoryBind *in, uint32_t count) +{ + VkSparseMemoryBind_host *out; + unsigned int i; + + if (!in) return NULL; + + out = heap_alloc(count * sizeof(*out)); + for (i = 0; i < count; i++) + { + out[i].resourceOffset = in[i].resourceOffset; + out[i].size = in[i].size; + out[i].memory = in[i].memory; + out[i].memoryOffset = in[i].memoryOffset; + out[i].flags = in[i].flags; + } + + return out; +} + +static inline void free_VkSparseMemoryBind_array(VkSparseMemoryBind_host *in, uint32_t count) +{ + if (!in) return; + + heap_free(in); +} + +static inline VkSparseBufferMemoryBindInfo_host *convert_VkSparseBufferMemoryBindInfo_array_win_to_host(const VkSparseBufferMemoryBindInfo *in, uint32_t count) +{ + VkSparseBufferMemoryBindInfo_host *out; + unsigned int i; + + if (!in) return NULL; + + out = heap_alloc(count * sizeof(*out)); + for (i = 0; i < count; i++) + { + out[i].buffer = in[i].buffer; + out[i].bindCount = in[i].bindCount; + out[i].pBinds = convert_VkSparseMemoryBind_array_win_to_host(in[i].pBinds, in[i].bindCount); + } + + return out; +} + +static inline void free_VkSparseBufferMemoryBindInfo_array(VkSparseBufferMemoryBindInfo_host *in, uint32_t count) +{ + unsigned int i; + + if (!in) return; + + for (i = 0; i < count; i++) + { + free_VkSparseMemoryBind_array((VkSparseMemoryBind_host *)in[i].pBinds, in[i].bindCount); + } + heap_free(in); +} + +static inline VkSparseImageOpaqueMemoryBindInfo_host *convert_VkSparseImageOpaqueMemoryBindInfo_array_win_to_host(const VkSparseImageOpaqueMemoryBindInfo *in, uint32_t count) +{ + VkSparseImageOpaqueMemoryBindInfo_host *out; + unsigned int i; + + if (!in) return NULL; + + out = heap_alloc(count * sizeof(*out)); + for (i = 0; i < count; i++) + { + out[i].image = in[i].image; + out[i].bindCount = in[i].bindCount; + out[i].pBinds = convert_VkSparseMemoryBind_array_win_to_host(in[i].pBinds, in[i].bindCount); + } + + return out; +} + +static inline void free_VkSparseImageOpaqueMemoryBindInfo_array(VkSparseImageOpaqueMemoryBindInfo_host *in, uint32_t count) +{ + unsigned int i; + + if (!in) return; + + for (i = 0; i < count; i++) + { + free_VkSparseMemoryBind_array((VkSparseMemoryBind_host *)in[i].pBinds, in[i].bindCount); + } + heap_free(in); +} + +static inline VkSparseImageMemoryBind_host *convert_VkSparseImageMemoryBind_array_win_to_host(const VkSparseImageMemoryBind *in, uint32_t count) +{ + VkSparseImageMemoryBind_host *out; + unsigned int i; + + if (!in) return NULL; + + out = heap_alloc(count * sizeof(*out)); + for (i = 0; i < count; i++) + { + out[i].subresource = in[i].subresource; + out[i].offset = in[i].offset; + out[i].extent = in[i].extent; + out[i].memory = in[i].memory; + out[i].memoryOffset = in[i].memoryOffset; + out[i].flags = in[i].flags; + } + + return out; +} + +static inline void free_VkSparseImageMemoryBind_array(VkSparseImageMemoryBind_host *in, uint32_t count) +{ + if (!in) return; + + heap_free(in); +} + +static inline VkSparseImageMemoryBindInfo_host *convert_VkSparseImageMemoryBindInfo_array_win_to_host(const VkSparseImageMemoryBindInfo *in, uint32_t count) +{ + VkSparseImageMemoryBindInfo_host *out; + unsigned int i; + + if (!in) return NULL; + + out = heap_alloc(count * sizeof(*out)); + for (i = 0; i < count; i++) + { + out[i].image = in[i].image; + out[i].bindCount = in[i].bindCount; + out[i].pBinds = convert_VkSparseImageMemoryBind_array_win_to_host(in[i].pBinds, in[i].bindCount); + } + + return out; +} + +static inline void free_VkSparseImageMemoryBindInfo_array(VkSparseImageMemoryBindInfo_host *in, uint32_t count) +{ + unsigned int i; + + if (!in) return; + + for (i = 0; i < count; i++) + { + free_VkSparseImageMemoryBind_array((VkSparseImageMemoryBind_host *)in[i].pBinds, in[i].bindCount); + } + heap_free(in); +} + +static inline VkBindSparseInfo_host *convert_VkBindSparseInfo_array_win_to_host(const VkBindSparseInfo *in, uint32_t count) +{ + VkBindSparseInfo_host *out; + unsigned int i; + + if (!in) return NULL; + + out = heap_alloc(count * sizeof(*out)); + for (i = 0; i < count; i++) + { + out[i].sType = in[i].sType; + out[i].pNext = in[i].pNext; + out[i].waitSemaphoreCount = in[i].waitSemaphoreCount; + out[i].pWaitSemaphores = in[i].pWaitSemaphores; + out[i].bufferBindCount = in[i].bufferBindCount; + out[i].pBufferBinds = convert_VkSparseBufferMemoryBindInfo_array_win_to_host(in[i].pBufferBinds, in[i].bufferBindCount); + out[i].imageOpaqueBindCount = in[i].imageOpaqueBindCount; + out[i].pImageOpaqueBinds = convert_VkSparseImageOpaqueMemoryBindInfo_array_win_to_host(in[i].pImageOpaqueBinds, in[i].imageOpaqueBindCount); + out[i].imageBindCount = in[i].imageBindCount; + out[i].pImageBinds = convert_VkSparseImageMemoryBindInfo_array_win_to_host(in[i].pImageBinds, in[i].imageBindCount); + out[i].signalSemaphoreCount = in[i].signalSemaphoreCount; + out[i].pSignalSemaphores = in[i].pSignalSemaphores; + } + + return out; +} + +static inline void free_VkBindSparseInfo_array(VkBindSparseInfo_host *in, uint32_t count) +{ + unsigned int i; + + if (!in) return; + + for (i = 0; i < count; i++) + { + free_VkSparseBufferMemoryBindInfo_array((VkSparseBufferMemoryBindInfo_host *)in[i].pBufferBinds, in[i].bufferBindCount); + free_VkSparseImageOpaqueMemoryBindInfo_array((VkSparseImageOpaqueMemoryBindInfo_host *)in[i].pImageOpaqueBinds, in[i].imageOpaqueBindCount); + free_VkSparseImageMemoryBindInfo_array((VkSparseImageMemoryBindInfo_host *)in[i].pImageBinds, in[i].imageBindCount); + } + heap_free(in); +} + static inline VkDescriptorImageInfo_host *convert_VkDescriptorImageInfo_array_win_to_host(const VkDescriptorImageInfo *in, uint32_t count) { VkDescriptorImageInfo_host *out; @@ -1637,14 +1827,26 @@ static VkResult WINAPI wine_vkMergePipelineCaches(VkDevice device, VkPipelineCac
static VkResult WINAPI wine_vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo *pBindInfo, VkFence fence) { - FIXME("stub: %p, %u, %p, 0x%s\n", queue, bindInfoCount, pBindInfo, wine_dbgstr_longlong(fence)); - return VK_ERROR_OUT_OF_HOST_MEMORY; +#if defined(USE_STRUCT_CONVERSION) + VkResult result; + VkBindSparseInfo_host *pBindInfo_host; + TRACE("%p, %u, %p, 0x%s\n", queue, bindInfoCount, pBindInfo, wine_dbgstr_longlong(fence)); + + pBindInfo_host = convert_VkBindSparseInfo_array_win_to_host(pBindInfo, bindInfoCount); + result = queue->device->funcs.p_vkQueueBindSparse(queue->queue, bindInfoCount, pBindInfo_host, fence); + + free_VkBindSparseInfo_array(pBindInfo_host, bindInfoCount); + return result; +#else + TRACE("%p, %u, %p, 0x%s\n", queue, bindInfoCount, pBindInfo, wine_dbgstr_longlong(fence)); + return queue->device->funcs.p_vkQueueBindSparse(queue->queue, bindInfoCount, pBindInfo, fence); +#endif }
static VkResult WINAPI wine_vkQueueWaitIdle(VkQueue queue) { - FIXME("stub: %p\n", queue); - return VK_ERROR_OUT_OF_HOST_MEMORY; + TRACE("%p\n", queue); + return queue->device->funcs.p_vkQueueWaitIdle(queue->queue); }
static VkResult WINAPI wine_vkResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index ae95e938ed..7ca4122268 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -426,6 +426,62 @@ typedef struct VkPhysicalDeviceProperties_host VkPhysicalDeviceSparseProperties sparseProperties; } VkPhysicalDeviceProperties_host;
+typedef struct VkSparseMemoryBind_host +{ + VkDeviceSize resourceOffset; + VkDeviceSize size; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseMemoryBind_host; + +typedef struct VkSparseBufferMemoryBindInfo_host +{ + VkBuffer buffer; + uint32_t bindCount; + const VkSparseMemoryBind_host *pBinds; +} VkSparseBufferMemoryBindInfo_host; + +typedef struct VkSparseImageOpaqueMemoryBindInfo_host +{ + VkImage image; + uint32_t bindCount; + const VkSparseMemoryBind_host *pBinds; +} VkSparseImageOpaqueMemoryBindInfo_host; + +typedef struct VkSparseImageMemoryBind_host +{ + VkImageSubresource subresource; + VkOffset3D offset; + VkExtent3D extent; + VkDeviceMemory memory; + VkDeviceSize memoryOffset; + VkSparseMemoryBindFlags flags; +} VkSparseImageMemoryBind_host; + +typedef struct VkSparseImageMemoryBindInfo_host +{ + VkImage image; + uint32_t bindCount; + const VkSparseImageMemoryBind_host *pBinds; +} VkSparseImageMemoryBindInfo_host; + +typedef struct VkBindSparseInfo_host +{ + VkStructureType sType; + const void *pNext; + uint32_t waitSemaphoreCount; + const VkSemaphore *pWaitSemaphores; + uint32_t bufferBindCount; + const VkSparseBufferMemoryBindInfo_host *pBufferBinds; + uint32_t imageOpaqueBindCount; + const VkSparseImageOpaqueMemoryBindInfo_host *pImageOpaqueBinds; + uint32_t imageBindCount; + const VkSparseImageMemoryBindInfo_host *pImageBinds; + uint32_t signalSemaphoreCount; + const VkSemaphore *pSignalSemaphores; +} VkBindSparseInfo_host; + typedef struct VkDescriptorImageInfo_host { VkSampler sampler; @@ -663,7 +719,11 @@ struct vulkan_device_funcs #endif VkResult (*p_vkMapMemory)(VkDevice, VkDeviceMemory, VkDeviceSize, VkDeviceSize, VkMemoryMapFlags, void **); VkResult (*p_vkMergePipelineCaches)(VkDevice, VkPipelineCache, uint32_t, const VkPipelineCache *); +#if defined(USE_STRUCT_CONVERSION) + VkResult (*p_vkQueueBindSparse)(VkQueue, uint32_t, const VkBindSparseInfo_host *, VkFence); +#else VkResult (*p_vkQueueBindSparse)(VkQueue, uint32_t, const VkBindSparseInfo *, VkFence); +#endif VkResult (*p_vkQueueSubmit)(VkQueue, uint32_t, const VkSubmitInfo *, VkFence); VkResult (*p_vkQueueWaitIdle)(VkQueue); VkResult (*p_vkResetCommandBuffer)(VkCommandBuffer, VkCommandBufferResetFlags);
Signed-off-by: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/make_vulkan | 23 +++++++++++++- dlls/winevulkan/vulkan.c | 67 ++++++++++++++++++++++++++++++++++++++++- dlls/winevulkan/vulkan_thunks.c | 17 +++++++++++ dlls/winevulkan/vulkan_thunks.h | 1 + dlls/winex11.drv/vulkan.c | 60 ++++++++++++++++++++++++++++-------- 5 files changed, 153 insertions(+), 15 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index c835b997fc..a1d71f9aa0 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -1796,6 +1796,15 @@ class VkGenerator(object): f.write(" "{0}",\n".format(ext["name"])) f.write("};\n\n")
+ # Create array of instance extensions. + f.write("static const char *vk_instance_extensions[] =\n{\n") + for ext in self.registry.extensions: + if ext["type"] != "instance": + continue + + f.write(" "{0}",\n".format(ext["name"])) + f.write("};\n\n") + f.write("BOOL wine_vk_device_extension_supported(const char *name)\n") f.write("{\n") f.write(" unsigned int i;\n") @@ -1805,6 +1814,17 @@ class VkGenerator(object): f.write(" return TRUE;\n") f.write(" }\n") f.write(" return FALSE;\n") + f.write("}\n\n") + + f.write("BOOL wine_vk_instance_extension_supported(const char *name)\n") + f.write("{\n") + f.write(" unsigned int i;\n") + f.write(" for (i = 0; i < ARRAY_SIZE(vk_instance_extensions); i++)\n") + f.write(" {\n") + f.write(" if (strcmp(vk_instance_extensions[i], name) == 0)\n") + f.write(" return TRUE;\n") + f.write(" }\n") + f.write(" return FALSE;\n") f.write("}\n")
def generate_thunks_h(self, f, prefix): @@ -1822,7 +1842,8 @@ class VkGenerator(object): f.write("void *wine_vk_get_device_proc_addr(const char *name) DECLSPEC_HIDDEN;\n") f.write("void *wine_vk_get_instance_proc_addr(const char *name) DECLSPEC_HIDDEN;\n\n")
- f.write("BOOL wine_vk_device_extension_supported(const char *name) DECLSPEC_HIDDEN;\n\n") + f.write("BOOL wine_vk_device_extension_supported(const char *name) DECLSPEC_HIDDEN;\n") + f.write("BOOL wine_vk_instance_extension_supported(const char *name) DECLSPEC_HIDDEN;\n\n")
# Generate prototypes for device and instance functions requiring a custom implementation. f.write("/* Functions for which we have custom implementations outside of the thunks. */\n") diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 8547531247..c0fc810a14 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -769,8 +769,73 @@ VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice phys_ static VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, VkExtensionProperties *properties) { + VkResult res; + uint32_t num_properties = 0, num_host_properties = 0; + VkExtensionProperties *host_properties = NULL; + unsigned int i, j; + TRACE("%p %p %p\n", layer_name, count, properties); - return vk_funcs->p_vkEnumerateInstanceExtensionProperties(layer_name, count, properties); + + /* This shouldn't get called with layer_name set, the ICD loader prevents it. */ + if (layer_name) + { + ERR("Layer enumeration not supported from ICD.\n"); + return VK_ERROR_LAYER_NOT_PRESENT; + } + + res = vk_funcs->p_vkEnumerateInstanceExtensionProperties(NULL, &num_host_properties, NULL); + if (res != VK_SUCCESS) + return res; + + host_properties = heap_calloc(num_host_properties, sizeof(*host_properties)); + if (!host_properties) + return VK_ERROR_OUT_OF_HOST_MEMORY; + + res = vk_funcs->p_vkEnumerateInstanceExtensionProperties(NULL, &num_host_properties, host_properties); + if (res != VK_SUCCESS) + { + ERR("Failed to retrieve host properties, res=%d\n", res); + heap_free(host_properties); + return res; + } + + /* The Wine graphics driver provides us with all extensions supported by the host side + * including extension fixup (e.g. VK_KHR_xlib_surface -> VK_KHR_win32_surface). It is + * up to us here to filter the list down to extensions for which we have thunks. + */ + for (i = 0; i < num_host_properties; i++) + { + if (wine_vk_instance_extension_supported(host_properties[i].extensionName)) + num_properties++; + } + + /* We only have to count. */ + if (!properties) + { + TRACE("Returning %u extensions\n", num_properties); + *count = num_properties; + heap_free(host_properties); + return VK_SUCCESS; + } + + for (i = 0, j = 0; i < num_host_properties && j < *count; i++) + { + if (wine_vk_instance_extension_supported(host_properties[i].extensionName)) + { + TRACE("Enabling extension '%s'\n", host_properties[i].extensionName); + memcpy(&properties[j], &host_properties[i], sizeof(*properties)); + j++; + } + } + + /* Return incomplete if the buffer is smaller than the number of supported extensions. */ + if (*count < num_properties) + res = VK_INCOMPLETE; + else + res = VK_SUCCESS; + + heap_free(host_properties); + return res; }
VkResult WINAPI wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *device_count, diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 4b635c2645..0e7b299b27 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -2102,6 +2102,12 @@ static const char * const vk_device_extensions[] = "VK_KHR_swapchain", };
+static const char *vk_instance_extensions[] = +{ + "VK_KHR_surface", + "VK_KHR_win32_surface", +}; + BOOL wine_vk_device_extension_supported(const char *name) { unsigned int i; @@ -2112,3 +2118,14 @@ BOOL wine_vk_device_extension_supported(const char *name) } return FALSE; } + +BOOL wine_vk_instance_extension_supported(const char *name) +{ + unsigned int i; + for (i = 0; i < ARRAY_SIZE(vk_instance_extensions); i++) + { + if (strcmp(vk_instance_extensions[i], name) == 0) + return TRUE; + } + return FALSE; +} diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index 7ca4122268..9fb5670762 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -13,6 +13,7 @@ void *wine_vk_get_device_proc_addr(const char *name) DECLSPEC_HIDDEN; void *wine_vk_get_instance_proc_addr(const char *name) DECLSPEC_HIDDEN;
BOOL wine_vk_device_extension_supported(const char *name) DECLSPEC_HIDDEN; +BOOL wine_vk_instance_extension_supported(const char *name) DECLSPEC_HIDDEN;
/* Functions for which we have custom implementations outside of the thunks. */ VkResult WINAPI wine_vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) DECLSPEC_HIDDEN; diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 1d9bc606eb..0586096254 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -21,6 +21,7 @@ #include "wine/port.h"
#include <stdarg.h> +#include <stdio.h>
#include "windef.h" #include "winbase.h" @@ -40,10 +41,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
-#ifndef ARRAY_SIZE -#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) -#endif - typedef VkFlags VkXlibSurfaceCreateFlagsKHR; #define VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR 1000004000
@@ -69,6 +66,7 @@ static VkResult (*pvkCreateXlibSurfaceKHR)(VkInstance, const VkXlibSurfaceCreate static void (*pvkDestroyInstance)(VkInstance, const VkAllocationCallbacks *); static void (*pvkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); static void (*pvkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); +static VkResult (*pvkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *); static void * (*pvkGetDeviceProcAddr)(VkDevice, const char *); static void * (*pvkGetInstanceProcAddr)(VkInstance, const char *); static VkResult (*pvkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice, VkSurfaceKHR, VkSurfaceCapabilitiesKHR *); @@ -79,12 +77,45 @@ static VkBool32 (*pvkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevi static VkResult (*pvkGetSwapchainImagesKHR)(VkDevice, VkSwapchainKHR, uint32_t *, VkImage *); static VkResult (*pvkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *);
-/* TODO: dynamically generate based on host driver capabilities. */ -static const struct VkExtensionProperties winex11_vk_instance_extensions[] = +static struct VkExtensionProperties *winex11_vk_instance_extensions = NULL; +static unsigned int winex11_vk_instance_extensions_count = 0; + +static void wine_vk_load_instance_extensions(void) { - { "VK_KHR_surface", 1 }, - { "VK_KHR_win32_surface", 1}, -}; + uint32_t num_properties; + VkExtensionProperties *properties; + unsigned int i; + + pvkEnumerateInstanceExtensionProperties(NULL, &num_properties, NULL); + + properties = heap_calloc(num_properties, sizeof(*properties)); + if (!properties) + return; + + /* We will return the same number of instance extensions reported by the host back to + * winevulkan. Along the way we may replace xlib extensions with their win32 equivalents. + * Winevulkan will perform more detailed filtering as it knows whether it has thunks + * for a particular extension. + */ + pvkEnumerateInstanceExtensionProperties(NULL, &num_properties, properties); + for (i = 0; i < num_properties; i++) + { + /* For now the only x11 extension we need to fixup. Long-term we may need an array. */ + if (!strcmp(properties[i].extensionName, "VK_KHR_xlib_surface")) + { + TRACE("Substituting VK_KHR_xlib_surface for VK_KHR_win32_surface\n"); + + memset(properties[i].extensionName, 0, sizeof(properties[i].extensionName)); + snprintf(properties[i].extensionName, sizeof(properties[i].extensionName), "VK_KHR_win32_surface"); + properties[i].specVersion = 6; /* Revision as of 4/24/2017 */ + } + + TRACE("Loaded extension: %s\n", properties[i].extensionName); + } + + winex11_vk_instance_extensions = properties; + winex11_vk_instance_extensions_count = num_properties; +}
/* Helper function to convert VkSurfaceKHR (uint64_t) to a surface pointer. */ static inline struct wine_vk_surface * surface_from_handle(VkSurfaceKHR handle) @@ -110,6 +141,7 @@ LOAD_FUNCPTR(vkCreateXlibSurfaceKHR) LOAD_FUNCPTR(vkDestroyInstance) LOAD_FUNCPTR(vkDestroySurfaceKHR) LOAD_FUNCPTR(vkDestroySwapchainKHR) +LOAD_FUNCPTR(vkEnumerateInstanceExtensionProperties) LOAD_FUNCPTR(vkGetDeviceProcAddr) LOAD_FUNCPTR(vkGetInstanceProcAddr) LOAD_FUNCPTR(vkGetPhysicalDeviceSurfaceCapabilitiesKHR) @@ -121,6 +153,8 @@ LOAD_FUNCPTR(vkGetSwapchainImagesKHR) LOAD_FUNCPTR(vkQueuePresentKHR) #undef LOAD_FUNCPTR
+ wine_vk_load_instance_extensions(); + return TRUE; }
@@ -353,11 +387,11 @@ static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_ * VK_KHR_win32_surface. Long-term this needs to be an intersection * between what the native library supports and what thunks we have. */ - *count = ARRAY_SIZE(winex11_vk_instance_extensions); + *count = winex11_vk_instance_extensions_count; return VK_SUCCESS; }
- if (*count < ARRAY_SIZE(winex11_vk_instance_extensions)) + if (*count < winex11_vk_instance_extensions_count) { /* Incomplete is a type of success used to signal the application * that not all devices got copied. @@ -367,13 +401,13 @@ static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_ } else { - num_copies = ARRAY_SIZE(winex11_vk_instance_extensions); + num_copies = winex11_vk_instance_extensions_count; res = VK_SUCCESS; }
for (i = 0; i < num_copies; i++) { - memcpy(&properties[i], &winex11_vk_instance_extensions[i], sizeof(winex11_vk_instance_extensions[i])); + memcpy(&properties[i], &winex11_vk_instance_extensions[i], sizeof(*properties)); } *count = num_copies;
Signed-off-by: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/make_vulkan | 1 + dlls/winevulkan/vulkan_thunks.c | 133 ++++++++++++++ dlls/winevulkan/vulkan_thunks.h | 49 +++++- include/wine/vulkan.h | 377 ++++++++++++++++++++++++---------------- 4 files changed, 414 insertions(+), 146 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index a1d71f9aa0..b8eaafa4bd 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -80,6 +80,7 @@ EXT_BLOCK_SIZE = 1000 # and need custom wrappers due to e.g. win32 / X11 specific code. # List of supported instance extensions. SUPPORTED_EXTENSIONS = [ + "VK_KHR_get_physical_device_properties2", "VK_KHR_surface", "VK_KHR_win32_surface", "VK_KHR_swapchain", diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index 0e7b299b27..cf1e9768b6 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -450,6 +450,23 @@ static inline void convert_VkImageFormatProperties_host_to_win(const VkImageForm out->maxResourceSize = in->maxResourceSize; }
+static inline void convert_VkImageFormatProperties2KHR_win_to_host(const VkImageFormatProperties2KHR *in, VkImageFormatProperties2KHR_host *out) +{ + if (!in) return; + + out->pNext = in->pNext; + out->sType = in->sType; +} + +static inline void convert_VkImageFormatProperties2KHR_host_to_win(const VkImageFormatProperties2KHR_host *in, VkImageFormatProperties2KHR *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + convert_VkImageFormatProperties_host_to_win(&in->imageFormatProperties, &out->imageFormatProperties); +} + static inline void convert_VkMemoryHeap_static_array_host_to_win(const VkMemoryHeap_host *in, VkMemoryHeap *out, uint32_t count) { unsigned int i; @@ -473,6 +490,23 @@ static inline void convert_VkPhysicalDeviceMemoryProperties_host_to_win(const Vk convert_VkMemoryHeap_static_array_host_to_win(in->memoryHeaps, out->memoryHeaps, VK_MAX_MEMORY_HEAPS); }
+static inline void convert_VkPhysicalDeviceMemoryProperties2KHR_win_to_host(const VkPhysicalDeviceMemoryProperties2KHR *in, VkPhysicalDeviceMemoryProperties2KHR_host *out) +{ + if (!in) return; + + out->pNext = in->pNext; + out->sType = in->sType; +} + +static inline void convert_VkPhysicalDeviceMemoryProperties2KHR_host_to_win(const VkPhysicalDeviceMemoryProperties2KHR_host *in, VkPhysicalDeviceMemoryProperties2KHR *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + convert_VkPhysicalDeviceMemoryProperties_host_to_win(&in->memoryProperties, &out->memoryProperties); +} + static inline void convert_VkPhysicalDeviceLimits_host_to_win(const VkPhysicalDeviceLimits_host *in, VkPhysicalDeviceLimits *out) { if (!in) return; @@ -600,6 +634,23 @@ static inline void convert_VkPhysicalDeviceProperties_host_to_win(const VkPhysic out->sparseProperties = in->sparseProperties; }
+static inline void convert_VkPhysicalDeviceProperties2KHR_win_to_host(const VkPhysicalDeviceProperties2KHR *in, VkPhysicalDeviceProperties2KHR_host *out) +{ + if (!in) return; + + out->pNext = in->pNext; + out->sType = in->sType; +} + +static inline void convert_VkPhysicalDeviceProperties2KHR_host_to_win(const VkPhysicalDeviceProperties2KHR_host *in, VkPhysicalDeviceProperties2KHR *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + convert_VkPhysicalDeviceProperties_host_to_win(&in->properties, &out->properties); +} + static inline VkSparseMemoryBind_host *convert_VkSparseMemoryBind_array_win_to_host(const VkSparseMemoryBind *in, uint32_t count) { VkSparseMemoryBind_host *out; @@ -1712,12 +1763,24 @@ static void WINAPI wine_vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDev physicalDevice->instance->funcs.p_vkGetPhysicalDeviceFeatures(physicalDevice->phys_dev, pFeatures); }
+static void WINAPI wine_vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures) +{ + TRACE("%p, %p\n", physicalDevice, pFeatures); + physicalDevice->instance->funcs.p_vkGetPhysicalDeviceFeatures2KHR(physicalDevice->phys_dev, pFeatures); +} + static void WINAPI wine_vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties) { TRACE("%p, %d, %p\n", physicalDevice, format, pFormatProperties); physicalDevice->instance->funcs.p_vkGetPhysicalDeviceFormatProperties(physicalDevice->phys_dev, format, pFormatProperties); }
+static void WINAPI wine_vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2KHR *pFormatProperties) +{ + TRACE("%p, %d, %p\n", physicalDevice, format, pFormatProperties); + physicalDevice->instance->funcs.p_vkGetPhysicalDeviceFormatProperties2KHR(physicalDevice->phys_dev, format, pFormatProperties); +} + static VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties) { #if defined(USE_STRUCT_CONVERSION) @@ -1735,6 +1798,24 @@ static VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties(VkPhysicalD #endif }
+static VkResult WINAPI wine_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, VkImageFormatProperties2KHR *pImageFormatProperties) +{ +#if defined(USE_STRUCT_CONVERSION) + VkResult result; + VkImageFormatProperties2KHR_host pImageFormatProperties_host; + TRACE("%p, %p, %p\n", physicalDevice, pImageFormatInfo, pImageFormatProperties); + + convert_VkImageFormatProperties2KHR_win_to_host(pImageFormatProperties, &pImageFormatProperties_host); + result = physicalDevice->instance->funcs.p_vkGetPhysicalDeviceImageFormatProperties2KHR(physicalDevice->phys_dev, pImageFormatInfo, &pImageFormatProperties_host); + + convert_VkImageFormatProperties2KHR_host_to_win(&pImageFormatProperties_host, pImageFormatProperties); + return result; +#else + TRACE("%p, %p, %p\n", physicalDevice, pImageFormatInfo, pImageFormatProperties); + return physicalDevice->instance->funcs.p_vkGetPhysicalDeviceImageFormatProperties2KHR(physicalDevice->phys_dev, pImageFormatInfo, pImageFormatProperties); +#endif +} + static void WINAPI wine_vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties) { #if defined(USE_STRUCT_CONVERSION) @@ -1750,6 +1831,22 @@ static void WINAPI wine_vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice phy #endif }
+static void WINAPI wine_vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties) +{ +#if defined(USE_STRUCT_CONVERSION) + VkPhysicalDeviceMemoryProperties2KHR_host pMemoryProperties_host; + TRACE("%p, %p\n", physicalDevice, pMemoryProperties); + + convert_VkPhysicalDeviceMemoryProperties2KHR_win_to_host(pMemoryProperties, &pMemoryProperties_host); + physicalDevice->instance->funcs.p_vkGetPhysicalDeviceMemoryProperties2KHR(physicalDevice->phys_dev, &pMemoryProperties_host); + + convert_VkPhysicalDeviceMemoryProperties2KHR_host_to_win(&pMemoryProperties_host, pMemoryProperties); +#else + TRACE("%p, %p\n", physicalDevice, pMemoryProperties); + physicalDevice->instance->funcs.p_vkGetPhysicalDeviceMemoryProperties2KHR(physicalDevice->phys_dev, pMemoryProperties); +#endif +} + static void WINAPI wine_vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) { #if defined(USE_STRUCT_CONVERSION) @@ -1765,18 +1862,46 @@ static void WINAPI wine_vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalD #endif }
+static void WINAPI wine_vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2KHR *pProperties) +{ +#if defined(USE_STRUCT_CONVERSION) + VkPhysicalDeviceProperties2KHR_host pProperties_host; + TRACE("%p, %p\n", physicalDevice, pProperties); + + convert_VkPhysicalDeviceProperties2KHR_win_to_host(pProperties, &pProperties_host); + physicalDevice->instance->funcs.p_vkGetPhysicalDeviceProperties2KHR(physicalDevice->phys_dev, &pProperties_host); + + convert_VkPhysicalDeviceProperties2KHR_host_to_win(&pProperties_host, pProperties); +#else + TRACE("%p, %p\n", physicalDevice, pProperties); + physicalDevice->instance->funcs.p_vkGetPhysicalDeviceProperties2KHR(physicalDevice->phys_dev, pProperties); +#endif +} + static void WINAPI wine_vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties) { TRACE("%p, %p, %p\n", physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); physicalDevice->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice->phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); }
+static void WINAPI wine_vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties) +{ + TRACE("%p, %p, %p\n", physicalDevice, pQueueFamilyPropertyCount, pQueueFamilyProperties); + physicalDevice->instance->funcs.p_vkGetPhysicalDeviceQueueFamilyProperties2KHR(physicalDevice->phys_dev, pQueueFamilyPropertyCount, pQueueFamilyProperties); +} + static void WINAPI wine_vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties) { TRACE("%p, %d, %d, %d, %#x, %d, %p, %p\n", physicalDevice, format, type, samples, usage, tiling, pPropertyCount, pProperties); physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSparseImageFormatProperties(physicalDevice->phys_dev, format, type, samples, usage, tiling, pPropertyCount, pProperties); }
+static void WINAPI wine_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2KHR *pProperties) +{ + TRACE("%p, %p, %p, %p\n", physicalDevice, pFormatInfo, pPropertyCount, pProperties); + physicalDevice->instance->funcs.p_vkGetPhysicalDeviceSparseImageFormatProperties2KHR(physicalDevice->phys_dev, pFormatInfo, pPropertyCount, pProperties); +} + static VkResult WINAPI wine_vkGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t *pDataSize, void *pData) { TRACE("%p, 0x%s, %p, %p\n", device, wine_dbgstr_longlong(pipelineCache), pDataSize, pData); @@ -2056,12 +2181,19 @@ static const struct vulkan_func vk_instance_dispatch_table[] = {"vkEnumerateDeviceLayerProperties", &wine_vkEnumerateDeviceLayerProperties}, {"vkEnumeratePhysicalDevices", &wine_vkEnumeratePhysicalDevices}, {"vkGetPhysicalDeviceFeatures", &wine_vkGetPhysicalDeviceFeatures}, + {"vkGetPhysicalDeviceFeatures2KHR", &wine_vkGetPhysicalDeviceFeatures2KHR}, {"vkGetPhysicalDeviceFormatProperties", &wine_vkGetPhysicalDeviceFormatProperties}, + {"vkGetPhysicalDeviceFormatProperties2KHR", &wine_vkGetPhysicalDeviceFormatProperties2KHR}, {"vkGetPhysicalDeviceImageFormatProperties", &wine_vkGetPhysicalDeviceImageFormatProperties}, + {"vkGetPhysicalDeviceImageFormatProperties2KHR", &wine_vkGetPhysicalDeviceImageFormatProperties2KHR}, {"vkGetPhysicalDeviceMemoryProperties", &wine_vkGetPhysicalDeviceMemoryProperties}, + {"vkGetPhysicalDeviceMemoryProperties2KHR", &wine_vkGetPhysicalDeviceMemoryProperties2KHR}, {"vkGetPhysicalDeviceProperties", &wine_vkGetPhysicalDeviceProperties}, + {"vkGetPhysicalDeviceProperties2KHR", &wine_vkGetPhysicalDeviceProperties2KHR}, {"vkGetPhysicalDeviceQueueFamilyProperties", &wine_vkGetPhysicalDeviceQueueFamilyProperties}, + {"vkGetPhysicalDeviceQueueFamilyProperties2KHR", &wine_vkGetPhysicalDeviceQueueFamilyProperties2KHR}, {"vkGetPhysicalDeviceSparseImageFormatProperties", &wine_vkGetPhysicalDeviceSparseImageFormatProperties}, + {"vkGetPhysicalDeviceSparseImageFormatProperties2KHR", &wine_vkGetPhysicalDeviceSparseImageFormatProperties2KHR}, {"vkGetPhysicalDeviceSurfaceCapabilitiesKHR", &wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR}, {"vkGetPhysicalDeviceSurfaceFormatsKHR", &wine_vkGetPhysicalDeviceSurfaceFormatsKHR}, {"vkGetPhysicalDeviceSurfacePresentModesKHR", &wine_vkGetPhysicalDeviceSurfacePresentModesKHR}, @@ -2104,6 +2236,7 @@ static const char * const vk_device_extensions[] =
static const char *vk_instance_extensions[] = { + "VK_KHR_get_physical_device_properties2", "VK_KHR_surface", "VK_KHR_win32_surface", }; diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index 9fb5670762..221f48bb98 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -290,6 +290,13 @@ typedef struct VkImageFormatProperties_host VkDeviceSize maxResourceSize; } VkImageFormatProperties_host;
+typedef struct VkImageFormatProperties2KHR_host +{ + VkStructureType sType; + void *pNext; + VkImageFormatProperties_host imageFormatProperties; +} VkImageFormatProperties2KHR_host; + typedef struct VkMemoryHeap_host { VkDeviceSize size; @@ -304,6 +311,13 @@ typedef struct VkPhysicalDeviceMemoryProperties_host VkMemoryHeap_host memoryHeaps[VK_MAX_MEMORY_HEAPS]; } VkPhysicalDeviceMemoryProperties_host;
+typedef struct VkPhysicalDeviceMemoryProperties2KHR_host +{ + VkStructureType sType; + void *pNext; + VkPhysicalDeviceMemoryProperties_host memoryProperties; +} VkPhysicalDeviceMemoryProperties2KHR_host; + typedef struct VkPhysicalDeviceLimits_host { uint32_t maxImageDimension1D; @@ -427,6 +441,13 @@ typedef struct VkPhysicalDeviceProperties_host VkPhysicalDeviceSparseProperties sparseProperties; } VkPhysicalDeviceProperties_host;
+typedef struct VkPhysicalDeviceProperties2KHR_host +{ + VkStructureType sType; + void *pNext; + VkPhysicalDeviceProperties_host properties; +} VkPhysicalDeviceProperties2KHR_host; + typedef struct VkSparseMemoryBind_host { VkDeviceSize resourceOffset; @@ -750,24 +771,43 @@ struct vulkan_instance_funcs VkResult (*p_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice, uint32_t *, VkLayerProperties *); VkResult (*p_vkEnumeratePhysicalDevices)(VkInstance, uint32_t *, VkPhysicalDevice *); void (*p_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice, VkPhysicalDeviceFeatures *); + void (*p_vkGetPhysicalDeviceFeatures2KHR)(VkPhysicalDevice, VkPhysicalDeviceFeatures2KHR *); void (*p_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice, VkFormat, VkFormatProperties *); + void (*p_vkGetPhysicalDeviceFormatProperties2KHR)(VkPhysicalDevice, VkFormat, VkFormatProperties2KHR *); #if defined(USE_STRUCT_CONVERSION) VkResult (*p_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice, VkFormat, VkImageType, VkImageTiling, VkImageUsageFlags, VkImageCreateFlags, VkImageFormatProperties_host *); #else VkResult (*p_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice, VkFormat, VkImageType, VkImageTiling, VkImageUsageFlags, VkImageCreateFlags, VkImageFormatProperties *); #endif +#if defined(USE_STRUCT_CONVERSION) + VkResult (*p_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *, VkImageFormatProperties2KHR_host *); +#else + VkResult (*p_vkGetPhysicalDeviceImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *, VkImageFormatProperties2KHR *); +#endif #if defined(USE_STRUCT_CONVERSION) void (*p_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties_host *); #else void (*p_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties *); #endif +#if defined(USE_STRUCT_CONVERSION) + void (*p_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2KHR_host *); +#else + void (*p_vkGetPhysicalDeviceMemoryProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceMemoryProperties2KHR *); +#endif #if defined(USE_STRUCT_CONVERSION) void (*p_vkGetPhysicalDeviceProperties)(VkPhysicalDevice, VkPhysicalDeviceProperties_host *); #else void (*p_vkGetPhysicalDeviceProperties)(VkPhysicalDevice, VkPhysicalDeviceProperties *); +#endif +#if defined(USE_STRUCT_CONVERSION) + void (*p_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceProperties2KHR_host *); +#else + void (*p_vkGetPhysicalDeviceProperties2KHR)(VkPhysicalDevice, VkPhysicalDeviceProperties2KHR *); #endif void (*p_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties *); + void (*p_vkGetPhysicalDeviceQueueFamilyProperties2KHR)(VkPhysicalDevice, uint32_t *, VkQueueFamilyProperties2KHR *); void (*p_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice, VkFormat, VkImageType, VkSampleCountFlagBits, VkImageUsageFlags, VkImageTiling, uint32_t *, VkSparseImageFormatProperties *); + void (*p_vkGetPhysicalDeviceSparseImageFormatProperties2KHR)(VkPhysicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *, uint32_t *, VkSparseImageFormatProperties2KHR *); };
#define ALL_VK_DEVICE_FUNCS() \ @@ -898,11 +938,18 @@ struct vulkan_instance_funcs USE_VK_FUNC(vkEnumerateDeviceLayerProperties)\ USE_VK_FUNC(vkEnumeratePhysicalDevices)\ USE_VK_FUNC(vkGetPhysicalDeviceFeatures)\ + USE_VK_FUNC(vkGetPhysicalDeviceFeatures2KHR)\ USE_VK_FUNC(vkGetPhysicalDeviceFormatProperties)\ + USE_VK_FUNC(vkGetPhysicalDeviceFormatProperties2KHR)\ USE_VK_FUNC(vkGetPhysicalDeviceImageFormatProperties)\ + USE_VK_FUNC(vkGetPhysicalDeviceImageFormatProperties2KHR)\ USE_VK_FUNC(vkGetPhysicalDeviceMemoryProperties)\ + USE_VK_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR)\ USE_VK_FUNC(vkGetPhysicalDeviceProperties)\ + USE_VK_FUNC(vkGetPhysicalDeviceProperties2KHR)\ USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyProperties)\ - USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties) + USE_VK_FUNC(vkGetPhysicalDeviceQueueFamilyProperties2KHR)\ + USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties)\ + USE_VK_FUNC(vkGetPhysicalDeviceSparseImageFormatProperties2KHR)
#endif /* __WINE_VULKAN_THUNKS_H */ diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h index 92dcb7d2b3..c75544774a 100644 --- a/include/wine/vulkan.h +++ b/include/wine/vulkan.h @@ -1077,6 +1077,15 @@ typedef enum VkStructureType VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001, + VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002, + VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004, + VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, + VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, VK_STRUCTURE_TYPE_MAX_ENUM = 0x7fffffff, } VkStructureType;
@@ -1452,17 +1461,34 @@ typedef struct VkPhysicalDeviceFeatures VkBool32 inheritedQueries; } VkPhysicalDeviceFeatures;
-typedef struct VkPipelineColorBlendAttachmentState +typedef struct VkPhysicalDeviceImageFormatInfo2KHR { - VkBool32 blendEnable; - VkBlendFactor srcColorBlendFactor; - VkBlendFactor dstColorBlendFactor; - VkBlendOp colorBlendOp; - VkBlendFactor srcAlphaBlendFactor; - VkBlendFactor dstAlphaBlendFactor; - VkBlendOp alphaBlendOp; - VkColorComponentFlags colorWriteMask; -} VkPipelineColorBlendAttachmentState; + VkStructureType sType; + const void *pNext; + VkFormat format; + VkImageType type; + VkImageTiling tiling; + VkImageUsageFlags usage; + VkImageCreateFlags flags; +} VkPhysicalDeviceImageFormatInfo2KHR; + +typedef struct VkPhysicalDeviceSparseProperties +{ + VkBool32 residencyStandard2DBlockShape; + VkBool32 residencyStandard2DMultisampleBlockShape; + VkBool32 residencyStandard3DBlockShape; + VkBool32 residencyAlignedMipSize; + VkBool32 residencyNonResidentStrict; +} VkPhysicalDeviceSparseProperties; + +typedef struct VkPipelineCacheCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineCacheCreateFlags flags; + size_t initialDataSize; + const void *pInitialData; +} VkPipelineCacheCreateInfo;
typedef struct VkPipelineInputAssemblyStateCreateInfo { @@ -1683,6 +1709,13 @@ typedef struct VkExtent2D uint32_t height; } VkExtent2D;
+typedef struct VkFormatProperties2KHR +{ + VkStructureType sType; + void *pNext; + VkFormatProperties formatProperties; +} VkFormatProperties2KHR; + typedef struct VkImageFormatProperties { VkExtent3D maxExtent; @@ -1692,6 +1725,20 @@ typedef struct VkImageFormatProperties VkDeviceSize WINE_VK_ALIGN(8) maxResourceSize; } VkImageFormatProperties;
+typedef struct VkImageMemoryBarrier +{ + VkStructureType sType; + const void *pNext; + VkAccessFlags srcAccessMask; + VkAccessFlags dstAccessMask; + VkImageLayout oldLayout; + VkImageLayout newLayout; + uint32_t srcQueueFamilyIndex; + uint32_t dstQueueFamilyIndex; + VkImage WINE_VK_ALIGN(8) image; + VkImageSubresourceRange subresourceRange; +} VkImageMemoryBarrier; + typedef struct VkImageSubresourceLayers { VkImageAspectFlags aspectMask; @@ -1714,14 +1761,28 @@ typedef struct VkMemoryType uint32_t heapIndex; } VkMemoryType;
-typedef struct VkPipelineCacheCreateInfo +typedef struct VkPhysicalDeviceSparseImageFormatInfo2KHR { VkStructureType sType; const void *pNext; - VkPipelineCacheCreateFlags flags; - size_t initialDataSize; - const void *pInitialData; -} VkPipelineCacheCreateInfo; + VkFormat format; + VkImageType type; + VkSampleCountFlagBits samples; + VkImageUsageFlags usage; + VkImageTiling tiling; +} VkPhysicalDeviceSparseImageFormatInfo2KHR; + +typedef struct VkPipelineColorBlendAttachmentState +{ + VkBool32 blendEnable; + VkBlendFactor srcColorBlendFactor; + VkBlendFactor dstColorBlendFactor; + VkBlendOp colorBlendOp; + VkBlendFactor srcAlphaBlendFactor; + VkBlendFactor dstAlphaBlendFactor; + VkBlendOp alphaBlendOp; + VkColorComponentFlags colorWriteMask; +} VkPipelineColorBlendAttachmentState;
typedef struct VkPipelineDynamicStateCreateInfo { @@ -1898,19 +1959,12 @@ typedef struct VkImageBlit VkOffset3D dstOffsets[2]; } VkImageBlit;
-typedef struct VkImageMemoryBarrier +typedef struct VkImageFormatProperties2KHR { VkStructureType sType; - const void *pNext; - VkAccessFlags srcAccessMask; - VkAccessFlags dstAccessMask; - VkImageLayout oldLayout; - VkImageLayout newLayout; - uint32_t srcQueueFamilyIndex; - uint32_t dstQueueFamilyIndex; - VkImage WINE_VK_ALIGN(8) image; - VkImageSubresourceRange subresourceRange; -} VkImageMemoryBarrier; + void *pNext; + VkImageFormatProperties WINE_VK_ALIGN(8) imageFormatProperties; +} VkImageFormatProperties2KHR;
typedef struct VkOffset2D { @@ -1918,14 +1972,12 @@ typedef struct VkOffset2D int32_t y; } VkOffset2D;
-typedef struct VkPhysicalDeviceSparseProperties +typedef struct VkPhysicalDeviceFeatures2KHR { - VkBool32 residencyStandard2DBlockShape; - VkBool32 residencyStandard2DMultisampleBlockShape; - VkBool32 residencyStandard3DBlockShape; - VkBool32 residencyAlignedMipSize; - VkBool32 residencyNonResidentStrict; -} VkPhysicalDeviceSparseProperties; + VkStructureType sType; + void *pNext; + VkPhysicalDeviceFeatures features; +} VkPhysicalDeviceFeatures2KHR;
typedef struct VkPipelineShaderStageCreateInfo { @@ -1938,11 +1990,12 @@ typedef struct VkPipelineShaderStageCreateInfo const VkSpecializationInfo *pSpecializationInfo; } VkPipelineShaderStageCreateInfo;
-typedef struct VkRect2D +typedef struct VkQueueFamilyProperties2KHR { - VkOffset2D offset; - VkExtent2D extent; -} VkRect2D; + VkStructureType sType; + void *pNext; + VkQueueFamilyProperties queueFamilyProperties; +} VkQueueFamilyProperties2KHR;
typedef struct VkShaderModuleCreateInfo { @@ -2060,50 +2113,43 @@ typedef struct VkPipelineColorBlendStateCreateInfo float blendConstants[4]; } VkPipelineColorBlendStateCreateInfo;
-typedef struct VkPipelineViewportStateCreateInfo +typedef struct VkPushConstantRange { - VkStructureType sType; - const void *pNext; - VkPipelineViewportStateCreateFlags flags; - uint32_t viewportCount; - const VkViewport *pViewports; - uint32_t scissorCount; - const VkRect2D *pScissors; -} VkPipelineViewportStateCreateInfo; + VkShaderStageFlags stageFlags; + uint32_t offset; + uint32_t size; +} VkPushConstantRange;
-typedef struct VkRenderPassBeginInfo +typedef struct VkRenderPassCreateInfo { VkStructureType sType; const void *pNext; - VkRenderPass WINE_VK_ALIGN(8) renderPass; - VkFramebuffer WINE_VK_ALIGN(8) framebuffer; - VkRect2D renderArea; - uint32_t clearValueCount; - const VkClearValue *pClearValues; -} VkRenderPassBeginInfo; + VkRenderPassCreateFlags flags; + uint32_t attachmentCount; + const VkAttachmentDescription *pAttachments; + uint32_t subpassCount; + const VkSubpassDescription *pSubpasses; + uint32_t dependencyCount; + const VkSubpassDependency *pDependencies; +} VkRenderPassCreateInfo;
-typedef struct VkSurfaceCapabilitiesKHR +typedef struct VkStencilOpState { - uint32_t minImageCount; - uint32_t maxImageCount; - VkExtent2D currentExtent; - VkExtent2D minImageExtent; - VkExtent2D maxImageExtent; - uint32_t maxImageArrayLayers; - VkSurfaceTransformFlagsKHR supportedTransforms; - VkSurfaceTransformFlagBitsKHR currentTransform; - VkCompositeAlphaFlagsKHR supportedCompositeAlpha; - VkImageUsageFlags supportedUsageFlags; -} VkSurfaceCapabilitiesKHR; + VkStencilOp failOp; + VkStencilOp passOp; + VkStencilOp depthFailOp; + VkCompareOp compareOp; + uint32_t compareMask; + uint32_t writeMask; + uint32_t reference; +} VkStencilOpState;
-typedef struct VkWin32SurfaceCreateInfoKHR +typedef struct VkVertexInputBindingDescription { - VkStructureType sType; - const void *pNext; - VkWin32SurfaceCreateFlagsKHR flags; - HINSTANCE hinstance; - HWND hwnd; -} VkWin32SurfaceCreateInfoKHR; + uint32_t binding; + uint32_t stride; + VkVertexInputRate inputRate; +} VkVertexInputBindingDescription;
typedef struct VkBindSparseInfo { @@ -2141,23 +2187,61 @@ typedef struct VkImageResolve VkExtent3D extent; } VkImageResolve;
-typedef struct VkPushConstantRange +typedef struct VkPhysicalDeviceMemoryProperties2KHR { - VkShaderStageFlags stageFlags; - uint32_t offset; - uint32_t size; -} VkPushConstantRange; + VkStructureType sType; + void *pNext; + VkPhysicalDeviceMemoryProperties WINE_VK_ALIGN(8) memoryProperties; +} VkPhysicalDeviceMemoryProperties2KHR;
-typedef struct VkStencilOpState +typedef struct VkPipelineDepthStencilStateCreateInfo { - VkStencilOp failOp; - VkStencilOp passOp; - VkStencilOp depthFailOp; - VkCompareOp compareOp; - uint32_t compareMask; - uint32_t writeMask; - uint32_t reference; -} VkStencilOpState; + VkStructureType sType; + const void *pNext; + VkPipelineDepthStencilStateCreateFlags flags; + VkBool32 depthTestEnable; + VkBool32 depthWriteEnable; + VkCompareOp depthCompareOp; + VkBool32 depthBoundsTestEnable; + VkBool32 stencilTestEnable; + VkStencilOpState front; + VkStencilOpState back; + float minDepthBounds; + float maxDepthBounds; +} VkPipelineDepthStencilStateCreateInfo; + +typedef struct VkPipelineVertexInputStateCreateInfo +{ + VkStructureType sType; + const void *pNext; + VkPipelineVertexInputStateCreateFlags flags; + uint32_t vertexBindingDescriptionCount; + const VkVertexInputBindingDescription *pVertexBindingDescriptions; + uint32_t vertexAttributeDescriptionCount; + const VkVertexInputAttributeDescription *pVertexAttributeDescriptions; +} VkPipelineVertexInputStateCreateInfo; + +typedef struct VkRect2D +{ + VkOffset2D offset; + VkExtent2D extent; +} VkRect2D; + +typedef struct VkSparseImageFormatProperties2KHR +{ + VkStructureType sType; + void *pNext; + VkSparseImageFormatProperties properties; +} VkSparseImageFormatProperties2KHR; + +typedef struct VkWin32SurfaceCreateInfoKHR +{ + VkStructureType sType; + const void *pNext; + VkWin32SurfaceCreateFlagsKHR flags; + HINSTANCE hinstance; + HWND hwnd; +} VkWin32SurfaceCreateInfoKHR;
typedef struct VkClearRect { @@ -2187,34 +2271,27 @@ typedef struct VkInstanceCreateInfo const char * const*ppEnabledExtensionNames; } VkInstanceCreateInfo;
-typedef struct VkPipelineDepthStencilStateCreateInfo +typedef struct VkPipelineLayoutCreateInfo { VkStructureType sType; const void *pNext; - VkPipelineDepthStencilStateCreateFlags flags; - VkBool32 depthTestEnable; - VkBool32 depthWriteEnable; - VkCompareOp depthCompareOp; - VkBool32 depthBoundsTestEnable; - VkBool32 stencilTestEnable; - VkStencilOpState front; - VkStencilOpState back; - float minDepthBounds; - float maxDepthBounds; -} VkPipelineDepthStencilStateCreateInfo; + VkPipelineLayoutCreateFlags flags; + uint32_t setLayoutCount; + const VkDescriptorSetLayout *pSetLayouts; + uint32_t pushConstantRangeCount; + const VkPushConstantRange *pPushConstantRanges; +} VkPipelineLayoutCreateInfo;
-typedef struct VkRenderPassCreateInfo +typedef struct VkRenderPassBeginInfo { VkStructureType sType; const void *pNext; - VkRenderPassCreateFlags flags; - uint32_t attachmentCount; - const VkAttachmentDescription *pAttachments; - uint32_t subpassCount; - const VkSubpassDescription *pSubpasses; - uint32_t dependencyCount; - const VkSubpassDependency *pDependencies; -} VkRenderPassCreateInfo; + VkRenderPass WINE_VK_ALIGN(8) renderPass; + VkFramebuffer WINE_VK_ALIGN(8) framebuffer; + VkRect2D renderArea; + uint32_t clearValueCount; + const VkClearValue *pClearValues; +} VkRenderPassBeginInfo;
typedef struct VkDescriptorSetLayoutCreateInfo { @@ -2335,47 +2412,16 @@ typedef struct VkPhysicalDeviceLimits VkDeviceSize WINE_VK_ALIGN(8) nonCoherentAtomSize; } VkPhysicalDeviceLimits;
-typedef struct VkPipelineLayoutCreateInfo -{ - VkStructureType sType; - const void *pNext; - VkPipelineLayoutCreateFlags flags; - uint32_t setLayoutCount; - const VkDescriptorSetLayout *pSetLayouts; - uint32_t pushConstantRangeCount; - const VkPushConstantRange *pPushConstantRanges; -} VkPipelineLayoutCreateInfo; - -typedef struct VkVertexInputBindingDescription -{ - uint32_t binding; - uint32_t stride; - VkVertexInputRate inputRate; -} VkVertexInputBindingDescription; - -typedef struct VkPhysicalDeviceProperties -{ - uint32_t apiVersion; - uint32_t driverVersion; - uint32_t vendorID; - uint32_t deviceID; - VkPhysicalDeviceType deviceType; - char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; - uint8_t pipelineCacheUUID[VK_UUID_SIZE]; - VkPhysicalDeviceLimits WINE_VK_ALIGN(8) limits; - VkPhysicalDeviceSparseProperties sparseProperties; -} VkPhysicalDeviceProperties; - -typedef struct VkPipelineVertexInputStateCreateInfo +typedef struct VkPipelineViewportStateCreateInfo { VkStructureType sType; const void *pNext; - VkPipelineVertexInputStateCreateFlags flags; - uint32_t vertexBindingDescriptionCount; - const VkVertexInputBindingDescription *pVertexBindingDescriptions; - uint32_t vertexAttributeDescriptionCount; - const VkVertexInputAttributeDescription *pVertexAttributeDescriptions; -} VkPipelineVertexInputStateCreateInfo; + VkPipelineViewportStateCreateFlags flags; + uint32_t viewportCount; + const VkViewport *pViewports; + uint32_t scissorCount; + const VkRect2D *pScissors; +} VkPipelineViewportStateCreateInfo;
typedef struct VkGraphicsPipelineCreateInfo { @@ -2400,6 +2446,40 @@ typedef struct VkGraphicsPipelineCreateInfo int32_t basePipelineIndex; } VkGraphicsPipelineCreateInfo;
+typedef struct VkSurfaceCapabilitiesKHR +{ + uint32_t minImageCount; + uint32_t maxImageCount; + VkExtent2D currentExtent; + VkExtent2D minImageExtent; + VkExtent2D maxImageExtent; + uint32_t maxImageArrayLayers; + VkSurfaceTransformFlagsKHR supportedTransforms; + VkSurfaceTransformFlagBitsKHR currentTransform; + VkCompositeAlphaFlagsKHR supportedCompositeAlpha; + VkImageUsageFlags supportedUsageFlags; +} VkSurfaceCapabilitiesKHR; + +typedef struct VkPhysicalDeviceProperties +{ + uint32_t apiVersion; + uint32_t driverVersion; + uint32_t vendorID; + uint32_t deviceID; + VkPhysicalDeviceType deviceType; + char deviceName[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE]; + uint8_t pipelineCacheUUID[VK_UUID_SIZE]; + VkPhysicalDeviceLimits WINE_VK_ALIGN(8) limits; + VkPhysicalDeviceSparseProperties sparseProperties; +} VkPhysicalDeviceProperties; + +typedef struct VkPhysicalDeviceProperties2KHR +{ + VkStructureType sType; + void *pNext; + VkPhysicalDeviceProperties WINE_VK_ALIGN(8) properties; +} VkPhysicalDeviceProperties2KHR; + VkResult VKAPI_CALL vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex); VkResult VKAPI_CALL vkAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo *pAllocateInfo, VkCommandBuffer *pCommandBuffers); VkResult VKAPI_CALL vkAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo *pAllocateInfo, VkDescriptorSet *pDescriptorSets); @@ -2518,12 +2598,19 @@ void VKAPI_CALL vkGetImageSparseMemoryRequirements(VkDevice device, VkImage imag void VKAPI_CALL vkGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource *pSubresource, VkSubresourceLayout *pLayout); PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(VkInstance instance, const char *pName); void VKAPI_CALL vkGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures *pFeatures); +void VKAPI_CALL vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2KHR *pFeatures); void VKAPI_CALL vkGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties); +void VKAPI_CALL vkGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2KHR *pFormatProperties); VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties *pImageFormatProperties); +VkResult VKAPI_CALL vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2KHR *pImageFormatInfo, VkImageFormatProperties2KHR *pImageFormatProperties); void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties); +void VKAPI_CALL vkGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2KHR *pMemoryProperties); void VKAPI_CALL vkGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties); +void VKAPI_CALL vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2KHR *pProperties); void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties *pQueueFamilyProperties); +void VKAPI_CALL vkGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t *pQueueFamilyPropertyCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties); void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t *pPropertyCount, VkSparseImageFormatProperties *pProperties); +void VKAPI_CALL vkGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2KHR *pFormatInfo, uint32_t *pPropertyCount, VkSparseImageFormatProperties2KHR *pProperties); VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities); VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats); VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t *pPresentModeCount, VkPresentModeKHR *pPresentModes);
Signed-off-by: Józef Kucia jkucia@codeweavers.com
Doom and Wolfenstein II use vkGetDeviceProcAddr to load all their function pointers, while they are supposed to use vkGetInstanceProcAddr for the instance ones. For now we need to allow this broken behavior.
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/vulkan.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index c0fc810a14..202761a1c6 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -902,6 +902,25 @@ PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char * if (func) return func;
+ /* vkGetDeviceProcAddr was intended for loading device and subdevice functions. + * idTech 6 titles such as Doom and Wolfenstein II, however use it also for + * loading of instance functions. This is undefined behavior as the specification + * disallows using any of the returned function pointers outside of device / + * subdevice objects. The games don't actually use the function pointers and if they + * did, they would crash as VkInstance / VkPhysicalDevice parameters need unwrapping. + * Khronos clarified behavior in the Vulkan spec and expects drivers to get updated, + * however it would require both driver and game fixes. Since it are major titles + * it is not clear what will happen. At least for now we need the hack below. + * https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/2323 + * https://github.com/KhronosGroup/Vulkan-Docs/issues/655 + */ + func = wine_vk_get_instance_proc_addr(name); + if (func) + { + WARN("Application relies on undefined behavior by requesting instance function '%s'!\n", name); + return func; + } + TRACE("Function %s not found\n", debugstr_a(name)); return NULL; }
Signed-off-by: Roderick Colenbrander thunderbird2k@gmail.com --- dlls/winevulkan/make_vulkan | 49 ++++++- dlls/winevulkan/vulkan_thunks.c | 313 ++++++++++++++++++++++++++++------------ dlls/winevulkan/vulkan_thunks.h | 98 +++++++++---- include/wine/vulkan.h | 81 +++++++++++ 4 files changed, 419 insertions(+), 122 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index b8eaafa4bd..579c38a56b 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -79,11 +79,31 @@ EXT_BLOCK_SIZE = 1000 # In general instance extensions can't be automatically generated # and need custom wrappers due to e.g. win32 / X11 specific code. # List of supported instance extensions. -SUPPORTED_EXTENSIONS = [ +SUPPORTED_INSTANCE_EXTENSIONS = [ "VK_KHR_get_physical_device_properties2", "VK_KHR_surface", "VK_KHR_win32_surface", - "VK_KHR_swapchain", +] + +BLACKLISTED_EXTENSIONS = [ + # Handling of VK_EXT_debug_report requires some consideration. The win32 + # loader already provides it for us and it is somewhat usable. . If we add + # plumbing down to the native layer, we will get each message twice as we + # use 2 loaders (win32+native), but we may get output from the driver. + # In any case callback conversion is required. + "VK_EXT_debug_report", + "VK_EXT_display_control", # Requires VK_EXT_display_surface_counter + "VK_EXT_hdr_metadata", # Needs WSI work. + "VK_GOOGLE_display_timing", + "VK_KHR_display", # Needs WSI work. + "VK_KHR_external_fence_fd", + "VK_KHR_external_fence_win32", + "VK_KHR_external_memory", + "VK_KHR_external_semaphore", + # Relates to external_semaphore and needs type conversions in bitflags. + "VK_KHR_external_semaphore_capabilities", + "VK_KHR_shared_presentable_image", # Needs WSI work. + "VK_NV_external_memory_win32" ]
# Functions part of our winevulkan graphics driver interface. @@ -2185,10 +2205,30 @@ class VkRegistry(object): LOGGER.debug("Skipping disabled extension: {0}".format(ext_name)) continue
- # We only support a handful of extensions for now through a whitelist. - if ext_name not in SUPPORTED_EXTENSIONS: + # Disable highly experimental extensions as the APIs are unstable and can + # change between minor Vulkan revisions until API is final and becomes KHR + # or NV. + if "KHX" in ext_name or "NVX" in ext_name: + LOGGER.debug("Skipping experimental extension: {0}".format(ext_name)) + continue + + # Instance extensions often require a custom implementation, so filter. + ext_type = ext.attrib["type"] + if ext_type == "instance" and not ext_name in SUPPORTED_INSTANCE_EXTENSIONS: + LOGGER.debug("Skipping instance extension: {0}".format(ext_name)) + continue + + # We disable some extensions as either we haven't implemented + # support yet or because they are for platforms other than win32. + if ext_name in BLACKLISTED_EXTENSIONS: LOGGER.debug("Skipping blacklisted extension: {0}".format(ext_name)) continue + elif "requires" in ext.attrib: + # Check if this extension builds on top of another blacklisted + # extension. + requires = ext.attrib["requires"].split(",") + if len(set(requires).intersection(BLACKLISTED_EXTENSIONS)) > 0: + continue
LOGGER.debug("Loading extension: {0}".format(ext_name))
@@ -2223,7 +2263,6 @@ class VkRegistry(object): continue
# Store a list with extensions. - ext_type = ext.attrib["type"] ext_info = {"name" : ext_name, "type" : ext_type} extensions.append(ext_info)
diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index cf1e9768b6..f7aa09bd49 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -218,6 +218,95 @@ static inline void free_VkImageMemoryBarrier_array(VkImageMemoryBarrier_host *in heap_free(in); }
+static inline VkDescriptorImageInfo_host *convert_VkDescriptorImageInfo_array_win_to_host(const VkDescriptorImageInfo *in, uint32_t count) +{ + VkDescriptorImageInfo_host *out; + unsigned int i; + + if (!in) return NULL; + + out = heap_alloc(count * sizeof(*out)); + for (i = 0; i < count; i++) + { + out[i].sampler = in[i].sampler; + out[i].imageView = in[i].imageView; + out[i].imageLayout = in[i].imageLayout; + } + + return out; +} + +static inline void free_VkDescriptorImageInfo_array(VkDescriptorImageInfo_host *in, uint32_t count) +{ + if (!in) return; + + heap_free(in); +} + +static inline VkDescriptorBufferInfo_host *convert_VkDescriptorBufferInfo_array_win_to_host(const VkDescriptorBufferInfo *in, uint32_t count) +{ + VkDescriptorBufferInfo_host *out; + unsigned int i; + + if (!in) return NULL; + + out = heap_alloc(count * sizeof(*out)); + for (i = 0; i < count; i++) + { + out[i].buffer = in[i].buffer; + out[i].offset = in[i].offset; + out[i].range = in[i].range; + } + + return out; +} + +static inline void free_VkDescriptorBufferInfo_array(VkDescriptorBufferInfo_host *in, uint32_t count) +{ + if (!in) return; + + heap_free(in); +} + +static inline VkWriteDescriptorSet_host *convert_VkWriteDescriptorSet_array_win_to_host(const VkWriteDescriptorSet *in, uint32_t count) +{ + VkWriteDescriptorSet_host *out; + unsigned int i; + + if (!in) return NULL; + + out = heap_alloc(count * sizeof(*out)); + for (i = 0; i < count; i++) + { + out[i].sType = in[i].sType; + out[i].pNext = in[i].pNext; + out[i].dstSet = in[i].dstSet; + out[i].dstBinding = in[i].dstBinding; + out[i].dstArrayElement = in[i].dstArrayElement; + out[i].descriptorCount = in[i].descriptorCount; + out[i].descriptorType = in[i].descriptorType; + out[i].pImageInfo = convert_VkDescriptorImageInfo_array_win_to_host(in[i].pImageInfo, in[i].descriptorCount); + out[i].pBufferInfo = convert_VkDescriptorBufferInfo_array_win_to_host(in[i].pBufferInfo, in[i].descriptorCount); + out[i].pTexelBufferView = in[i].pTexelBufferView; + } + + return out; +} + +static inline void free_VkWriteDescriptorSet_array(VkWriteDescriptorSet_host *in, uint32_t count) +{ + unsigned int i; + + if (!in) return; + + for (i = 0; i < count; i++) + { + free_VkDescriptorImageInfo_array((VkDescriptorImageInfo_host *)in[i].pImageInfo, in[i].descriptorCount); + free_VkDescriptorBufferInfo_array((VkDescriptorBufferInfo_host *)in[i].pBufferInfo, in[i].descriptorCount); + } + heap_free(in); +} + static inline void convert_VkBufferCreateInfo_win_to_host(const VkBufferCreateInfo *in, VkBufferCreateInfo_host *out) { if (!in) return; @@ -287,6 +376,22 @@ static inline void free_VkComputePipelineCreateInfo_array(VkComputePipelineCreat heap_free(in); }
+static inline void convert_VkDescriptorUpdateTemplateCreateInfoKHR_win_to_host(const VkDescriptorUpdateTemplateCreateInfoKHR *in, VkDescriptorUpdateTemplateCreateInfoKHR_host *out) +{ + if (!in) return; + + out->sType = in->sType; + out->pNext = in->pNext; + out->flags = in->flags; + out->descriptorUpdateEntryCount = in->descriptorUpdateEntryCount; + out->pDescriptorUpdateEntries = in->pDescriptorUpdateEntries; + out->templateType = in->templateType; + out->descriptorSetLayout = in->descriptorSetLayout; + out->pipelineBindPoint = in->pipelineBindPoint; + out->pipelineLayout = in->pipelineLayout; + out->set = in->set; +} + static inline void convert_VkFramebufferCreateInfo_win_to_host(const VkFramebufferCreateInfo *in, VkFramebufferCreateInfo_host *out) { if (!in) return; @@ -841,95 +946,6 @@ static inline void free_VkBindSparseInfo_array(VkBindSparseInfo_host *in, uint32 heap_free(in); }
-static inline VkDescriptorImageInfo_host *convert_VkDescriptorImageInfo_array_win_to_host(const VkDescriptorImageInfo *in, uint32_t count) -{ - VkDescriptorImageInfo_host *out; - unsigned int i; - - if (!in) return NULL; - - out = heap_alloc(count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i].sampler = in[i].sampler; - out[i].imageView = in[i].imageView; - out[i].imageLayout = in[i].imageLayout; - } - - return out; -} - -static inline void free_VkDescriptorImageInfo_array(VkDescriptorImageInfo_host *in, uint32_t count) -{ - if (!in) return; - - heap_free(in); -} - -static inline VkDescriptorBufferInfo_host *convert_VkDescriptorBufferInfo_array_win_to_host(const VkDescriptorBufferInfo *in, uint32_t count) -{ - VkDescriptorBufferInfo_host *out; - unsigned int i; - - if (!in) return NULL; - - out = heap_alloc(count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i].buffer = in[i].buffer; - out[i].offset = in[i].offset; - out[i].range = in[i].range; - } - - return out; -} - -static inline void free_VkDescriptorBufferInfo_array(VkDescriptorBufferInfo_host *in, uint32_t count) -{ - if (!in) return; - - heap_free(in); -} - -static inline VkWriteDescriptorSet_host *convert_VkWriteDescriptorSet_array_win_to_host(const VkWriteDescriptorSet *in, uint32_t count) -{ - VkWriteDescriptorSet_host *out; - unsigned int i; - - if (!in) return NULL; - - out = heap_alloc(count * sizeof(*out)); - for (i = 0; i < count; i++) - { - out[i].sType = in[i].sType; - out[i].pNext = in[i].pNext; - out[i].dstSet = in[i].dstSet; - out[i].dstBinding = in[i].dstBinding; - out[i].dstArrayElement = in[i].dstArrayElement; - out[i].descriptorCount = in[i].descriptorCount; - out[i].descriptorType = in[i].descriptorType; - out[i].pImageInfo = convert_VkDescriptorImageInfo_array_win_to_host(in[i].pImageInfo, in[i].descriptorCount); - out[i].pBufferInfo = convert_VkDescriptorBufferInfo_array_win_to_host(in[i].pBufferInfo, in[i].descriptorCount); - out[i].pTexelBufferView = in[i].pTexelBufferView; - } - - return out; -} - -static inline void free_VkWriteDescriptorSet_array(VkWriteDescriptorSet_host *in, uint32_t count) -{ - unsigned int i; - - if (!in) return; - - for (i = 0; i < count; i++) - { - free_VkDescriptorImageInfo_array((VkDescriptorImageInfo_host *)in[i].pImageInfo, in[i].descriptorCount); - free_VkDescriptorBufferInfo_array((VkDescriptorBufferInfo_host *)in[i].pBufferInfo, in[i].descriptorCount); - } - heap_free(in); -} - static inline VkCopyDescriptorSet_host *convert_VkCopyDescriptorSet_array_win_to_host(const VkCopyDescriptorSet *in, uint32_t count) { VkCopyDescriptorSet_host *out; @@ -1186,12 +1202,24 @@ static void WINAPI wine_vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, commandBuffer->device->funcs.p_vkCmdDrawIndexedIndirect(commandBuffer->command_buffer, buffer, offset, drawCount, stride); }
+static void WINAPI wine_vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) +{ + TRACE("%p, 0x%s, 0x%s, 0x%s, 0x%s, %u, %u\n", commandBuffer, wine_dbgstr_longlong(buffer), wine_dbgstr_longlong(offset), wine_dbgstr_longlong(countBuffer), wine_dbgstr_longlong(countBufferOffset), maxDrawCount, stride); + commandBuffer->device->funcs.p_vkCmdDrawIndexedIndirectCountAMD(commandBuffer->command_buffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); +} + static void WINAPI wine_vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) { TRACE("%p, 0x%s, 0x%s, %u, %u\n", commandBuffer, wine_dbgstr_longlong(buffer), wine_dbgstr_longlong(offset), drawCount, stride); commandBuffer->device->funcs.p_vkCmdDrawIndirect(commandBuffer->command_buffer, buffer, offset, drawCount, stride); }
+static void WINAPI wine_vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) +{ + TRACE("%p, 0x%s, 0x%s, 0x%s, 0x%s, %u, %u\n", commandBuffer, wine_dbgstr_longlong(buffer), wine_dbgstr_longlong(offset), wine_dbgstr_longlong(countBuffer), wine_dbgstr_longlong(countBufferOffset), maxDrawCount, stride); + commandBuffer->device->funcs.p_vkCmdDrawIndirectCountAMD(commandBuffer->command_buffer, buffer, offset, countBuffer, countBufferOffset, maxDrawCount, stride); +} + static void WINAPI wine_vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query) { TRACE("%p, 0x%s, %u\n", commandBuffer, wine_dbgstr_longlong(queryPool), query); @@ -1241,6 +1269,28 @@ static void WINAPI wine_vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipe commandBuffer->device->funcs.p_vkCmdPushConstants(commandBuffer->command_buffer, layout, stageFlags, offset, size, pValues); }
+static void WINAPI wine_vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites) +{ +#if defined(USE_STRUCT_CONVERSION) + VkWriteDescriptorSet_host *pDescriptorWrites_host; + TRACE("%p, %d, 0x%s, %u, %u, %p\n", commandBuffer, pipelineBindPoint, wine_dbgstr_longlong(layout), set, descriptorWriteCount, pDescriptorWrites); + + pDescriptorWrites_host = convert_VkWriteDescriptorSet_array_win_to_host(pDescriptorWrites, descriptorWriteCount); + commandBuffer->device->funcs.p_vkCmdPushDescriptorSetKHR(commandBuffer->command_buffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites_host); + + free_VkWriteDescriptorSet_array(pDescriptorWrites_host, descriptorWriteCount); +#else + TRACE("%p, %d, 0x%s, %u, %u, %p\n", commandBuffer, pipelineBindPoint, wine_dbgstr_longlong(layout), set, descriptorWriteCount, pDescriptorWrites); + commandBuffer->device->funcs.p_vkCmdPushDescriptorSetKHR(commandBuffer->command_buffer, pipelineBindPoint, layout, set, descriptorWriteCount, pDescriptorWrites); +#endif +} + +static void WINAPI wine_vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData) +{ + TRACE("%p, 0x%s, 0x%s, %u, %p\n", commandBuffer, wine_dbgstr_longlong(descriptorUpdateTemplate), wine_dbgstr_longlong(layout), set, pData); + commandBuffer->device->funcs.p_vkCmdPushDescriptorSetWithTemplateKHR(commandBuffer->command_buffer, descriptorUpdateTemplate, layout, set, pData); +} + static void WINAPI wine_vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { TRACE("%p, 0x%s, %#x\n", commandBuffer, wine_dbgstr_longlong(event), stageMask); @@ -1277,6 +1327,12 @@ static void WINAPI wine_vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float commandBuffer->device->funcs.p_vkCmdSetDepthBounds(commandBuffer->command_buffer, minDepthBounds, maxDepthBounds); }
+static void WINAPI wine_vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles) +{ + TRACE("%p, %u, %u, %p\n", commandBuffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles); + commandBuffer->device->funcs.p_vkCmdSetDiscardRectangleEXT(commandBuffer->command_buffer, firstDiscardRectangle, discardRectangleCount, pDiscardRectangles); +} + static void WINAPI wine_vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) { TRACE("%p, 0x%s, %#x\n", commandBuffer, wine_dbgstr_longlong(event), stageMask); @@ -1319,6 +1375,12 @@ static void WINAPI wine_vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t commandBuffer->device->funcs.p_vkCmdSetViewport(commandBuffer->command_buffer, firstViewport, viewportCount, pViewports); }
+static void WINAPI wine_vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings) +{ + TRACE("%p, %u, %u, %p\n", commandBuffer, firstViewport, viewportCount, pViewportWScalings); + commandBuffer->device->funcs.p_vkCmdSetViewportWScalingNV(commandBuffer->command_buffer, firstViewport, viewportCount, pViewportWScalings); +} + static void WINAPI wine_vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData) { TRACE("%p, 0x%s, 0x%s, 0x%s, %p\n", commandBuffer, wine_dbgstr_longlong(dstBuffer), wine_dbgstr_longlong(dstOffset), wine_dbgstr_longlong(dataSize), pData); @@ -1420,6 +1482,23 @@ static VkResult WINAPI wine_vkCreateDescriptorSetLayout(VkDevice device, const V return device->funcs.p_vkCreateDescriptorSetLayout(device->device, pCreateInfo, NULL, pSetLayout); }
+static VkResult WINAPI wine_vkCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate) +{ +#if defined(USE_STRUCT_CONVERSION) + VkResult result; + VkDescriptorUpdateTemplateCreateInfoKHR_host pCreateInfo_host; + TRACE("%p, %p, %p, %p\n", device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); + + convert_VkDescriptorUpdateTemplateCreateInfoKHR_win_to_host(pCreateInfo, &pCreateInfo_host); + result = device->funcs.p_vkCreateDescriptorUpdateTemplateKHR(device->device, &pCreateInfo_host, NULL, pDescriptorUpdateTemplate); + + return result; +#else + TRACE("%p, %p, %p, %p\n", device, pCreateInfo, pAllocator, pDescriptorUpdateTemplate); + return device->funcs.p_vkCreateDescriptorUpdateTemplateKHR(device->device, pCreateInfo, NULL, pDescriptorUpdateTemplate); +#endif +} + static VkResult WINAPI wine_vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent) { TRACE("%p, %p, %p, %p\n", device, pCreateInfo, pAllocator, pEvent); @@ -1562,6 +1641,12 @@ static void WINAPI wine_vkDestroyDescriptorSetLayout(VkDevice device, VkDescript device->funcs.p_vkDestroyDescriptorSetLayout(device->device, descriptorSetLayout, NULL); }
+static void WINAPI wine_vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator) +{ + TRACE("%p, 0x%s, %p\n", device, wine_dbgstr_longlong(descriptorUpdateTemplate), pAllocator); + device->funcs.p_vkDestroyDescriptorUpdateTemplateKHR(device->device, descriptorUpdateTemplate, NULL); +} + static void WINAPI wine_vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator) { TRACE("%p, 0x%s, %p\n", device, wine_dbgstr_longlong(event), pAllocator); @@ -2010,12 +2095,24 @@ static VkResult WINAPI wine_vkSetEvent(VkDevice device, VkEvent event) return device->funcs.p_vkSetEvent(device->device, event); }
+static void WINAPI wine_vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags) +{ + TRACE("%p, 0x%s, %#x\n", device, wine_dbgstr_longlong(commandPool), flags); + device->funcs.p_vkTrimCommandPoolKHR(device->device, commandPool, flags); +} + static void WINAPI wine_vkUnmapMemory(VkDevice device, VkDeviceMemory memory) { TRACE("%p, 0x%s\n", device, wine_dbgstr_longlong(memory)); device->funcs.p_vkUnmapMemory(device->device, memory); }
+static void WINAPI wine_vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void *pData) +{ + TRACE("%p, 0x%s, 0x%s, %p\n", device, wine_dbgstr_longlong(descriptorSet), wine_dbgstr_longlong(descriptorUpdateTemplate), pData); + device->funcs.p_vkUpdateDescriptorSetWithTemplateKHR(device->device, descriptorSet, descriptorUpdateTemplate, pData); +} + static void WINAPI wine_vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies) { #if defined(USE_STRUCT_CONVERSION) @@ -2070,7 +2167,9 @@ static const struct vulkan_func vk_device_dispatch_table[] = {"vkCmdDraw", &wine_vkCmdDraw}, {"vkCmdDrawIndexed", &wine_vkCmdDrawIndexed}, {"vkCmdDrawIndexedIndirect", &wine_vkCmdDrawIndexedIndirect}, + {"vkCmdDrawIndexedIndirectCountAMD", &wine_vkCmdDrawIndexedIndirectCountAMD}, {"vkCmdDrawIndirect", &wine_vkCmdDrawIndirect}, + {"vkCmdDrawIndirectCountAMD", &wine_vkCmdDrawIndirectCountAMD}, {"vkCmdEndQuery", &wine_vkCmdEndQuery}, {"vkCmdEndRenderPass", &wine_vkCmdEndRenderPass}, {"vkCmdExecuteCommands", &wine_vkCmdExecuteCommands}, @@ -2078,12 +2177,15 @@ static const struct vulkan_func vk_device_dispatch_table[] = {"vkCmdNextSubpass", &wine_vkCmdNextSubpass}, {"vkCmdPipelineBarrier", &wine_vkCmdPipelineBarrier}, {"vkCmdPushConstants", &wine_vkCmdPushConstants}, + {"vkCmdPushDescriptorSetKHR", &wine_vkCmdPushDescriptorSetKHR}, + {"vkCmdPushDescriptorSetWithTemplateKHR", &wine_vkCmdPushDescriptorSetWithTemplateKHR}, {"vkCmdResetEvent", &wine_vkCmdResetEvent}, {"vkCmdResetQueryPool", &wine_vkCmdResetQueryPool}, {"vkCmdResolveImage", &wine_vkCmdResolveImage}, {"vkCmdSetBlendConstants", &wine_vkCmdSetBlendConstants}, {"vkCmdSetDepthBias", &wine_vkCmdSetDepthBias}, {"vkCmdSetDepthBounds", &wine_vkCmdSetDepthBounds}, + {"vkCmdSetDiscardRectangleEXT", &wine_vkCmdSetDiscardRectangleEXT}, {"vkCmdSetEvent", &wine_vkCmdSetEvent}, {"vkCmdSetLineWidth", &wine_vkCmdSetLineWidth}, {"vkCmdSetScissor", &wine_vkCmdSetScissor}, @@ -2091,6 +2193,7 @@ static const struct vulkan_func vk_device_dispatch_table[] = {"vkCmdSetStencilReference", &wine_vkCmdSetStencilReference}, {"vkCmdSetStencilWriteMask", &wine_vkCmdSetStencilWriteMask}, {"vkCmdSetViewport", &wine_vkCmdSetViewport}, + {"vkCmdSetViewportWScalingNV", &wine_vkCmdSetViewportWScalingNV}, {"vkCmdUpdateBuffer", &wine_vkCmdUpdateBuffer}, {"vkCmdWaitEvents", &wine_vkCmdWaitEvents}, {"vkCmdWriteTimestamp", &wine_vkCmdWriteTimestamp}, @@ -2100,6 +2203,7 @@ static const struct vulkan_func vk_device_dispatch_table[] = {"vkCreateComputePipelines", &wine_vkCreateComputePipelines}, {"vkCreateDescriptorPool", &wine_vkCreateDescriptorPool}, {"vkCreateDescriptorSetLayout", &wine_vkCreateDescriptorSetLayout}, + {"vkCreateDescriptorUpdateTemplateKHR", &wine_vkCreateDescriptorUpdateTemplateKHR}, {"vkCreateEvent", &wine_vkCreateEvent}, {"vkCreateFence", &wine_vkCreateFence}, {"vkCreateFramebuffer", &wine_vkCreateFramebuffer}, @@ -2119,6 +2223,7 @@ static const struct vulkan_func vk_device_dispatch_table[] = {"vkDestroyCommandPool", &wine_vkDestroyCommandPool}, {"vkDestroyDescriptorPool", &wine_vkDestroyDescriptorPool}, {"vkDestroyDescriptorSetLayout", &wine_vkDestroyDescriptorSetLayout}, + {"vkDestroyDescriptorUpdateTemplateKHR", &wine_vkDestroyDescriptorUpdateTemplateKHR}, {"vkDestroyDevice", &wine_vkDestroyDevice}, {"vkDestroyEvent", &wine_vkDestroyEvent}, {"vkDestroyFence", &wine_vkDestroyFence}, @@ -2166,7 +2271,9 @@ static const struct vulkan_func vk_device_dispatch_table[] = {"vkResetEvent", &wine_vkResetEvent}, {"vkResetFences", &wine_vkResetFences}, {"vkSetEvent", &wine_vkSetEvent}, + {"vkTrimCommandPoolKHR", &wine_vkTrimCommandPoolKHR}, {"vkUnmapMemory", &wine_vkUnmapMemory}, + {"vkUpdateDescriptorSetWithTemplateKHR", &wine_vkUpdateDescriptorSetWithTemplateKHR}, {"vkUpdateDescriptorSets", &wine_vkUpdateDescriptorSets}, {"vkWaitForFences", &wine_vkWaitForFences}, }; @@ -2231,7 +2338,35 @@ void *wine_vk_get_instance_proc_addr(const char *name)
static const char * const vk_device_extensions[] = { + "VK_AMD_draw_indirect_count", + "VK_AMD_gcn_shader", + "VK_AMD_gpu_shader_half_float", + "VK_AMD_negative_viewport_height", + "VK_AMD_rasterization_order", + "VK_AMD_shader_ballot", + "VK_AMD_shader_explicit_vertex_parameter", + "VK_AMD_shader_trinary_minmax", + "VK_AMD_texture_gather_bias_lod", + "VK_EXT_discard_rectangles", + "VK_EXT_shader_subgroup_ballot", + "VK_EXT_shader_subgroup_vote", + "VK_IMG_filter_cubic", + "VK_IMG_format_pvrtc", + "VK_KHR_descriptor_update_template", + "VK_KHR_incremental_present", + "VK_KHR_maintenance1", + "VK_KHR_push_descriptor", + "VK_KHR_sampler_mirror_clamp_to_edge", + "VK_KHR_shader_draw_parameters", "VK_KHR_swapchain", + "VK_NV_clip_space_w_scaling", + "VK_NV_dedicated_allocation", + "VK_NV_external_memory", + "VK_NV_geometry_shader_passthrough", + "VK_NV_glsl_shader", + "VK_NV_sample_mask_override_coverage", + "VK_NV_viewport_array2", + "VK_NV_viewport_swizzle", };
static const char *vk_instance_extensions[] = diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h index 221f48bb98..803d621019 100644 --- a/dlls/winevulkan/vulkan_thunks.h +++ b/dlls/winevulkan/vulkan_thunks.h @@ -141,6 +141,34 @@ typedef struct VkImageMemoryBarrier_host VkImageSubresourceRange subresourceRange; } VkImageMemoryBarrier_host;
+typedef struct VkDescriptorImageInfo_host +{ + VkSampler sampler; + VkImageView imageView; + VkImageLayout imageLayout; +} VkDescriptorImageInfo_host; + +typedef struct VkDescriptorBufferInfo_host +{ + VkBuffer buffer; + VkDeviceSize offset; + VkDeviceSize range; +} VkDescriptorBufferInfo_host; + +typedef struct VkWriteDescriptorSet_host +{ + VkStructureType sType; + const void *pNext; + VkDescriptorSet dstSet; + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + const VkDescriptorImageInfo_host *pImageInfo; + const VkDescriptorBufferInfo_host *pBufferInfo; + const VkBufferView *pTexelBufferView; +} VkWriteDescriptorSet_host; + typedef struct VkBufferCreateInfo_host { VkStructureType sType; @@ -186,6 +214,20 @@ typedef struct VkComputePipelineCreateInfo_host int32_t basePipelineIndex; } VkComputePipelineCreateInfo_host;
+typedef struct VkDescriptorUpdateTemplateCreateInfoKHR_host +{ + VkStructureType sType; + void *pNext; + VkDescriptorUpdateTemplateCreateFlagsKHR flags; + uint32_t descriptorUpdateEntryCount; + const VkDescriptorUpdateTemplateEntryKHR *pDescriptorUpdateEntries; + VkDescriptorUpdateTemplateTypeKHR templateType; + VkDescriptorSetLayout descriptorSetLayout; + VkPipelineBindPoint pipelineBindPoint; + VkPipelineLayout pipelineLayout; + uint32_t set; +} VkDescriptorUpdateTemplateCreateInfoKHR_host; + typedef struct VkFramebufferCreateInfo_host { VkStructureType sType; @@ -504,34 +546,6 @@ typedef struct VkBindSparseInfo_host const VkSemaphore *pSignalSemaphores; } VkBindSparseInfo_host;
-typedef struct VkDescriptorImageInfo_host -{ - VkSampler sampler; - VkImageView imageView; - VkImageLayout imageLayout; -} VkDescriptorImageInfo_host; - -typedef struct VkDescriptorBufferInfo_host -{ - VkBuffer buffer; - VkDeviceSize offset; - VkDeviceSize range; -} VkDescriptorBufferInfo_host; - -typedef struct VkWriteDescriptorSet_host -{ - VkStructureType sType; - const void *pNext; - VkDescriptorSet dstSet; - uint32_t dstBinding; - uint32_t dstArrayElement; - uint32_t descriptorCount; - VkDescriptorType descriptorType; - const VkDescriptorImageInfo_host *pImageInfo; - const VkDescriptorBufferInfo_host *pBufferInfo; - const VkBufferView *pTexelBufferView; -} VkWriteDescriptorSet_host; - typedef struct VkCopyDescriptorSet_host { VkStructureType sType; @@ -607,7 +621,9 @@ struct vulkan_device_funcs void (*p_vkCmdDraw)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, uint32_t); void (*p_vkCmdDrawIndexed)(VkCommandBuffer, uint32_t, uint32_t, uint32_t, int32_t, uint32_t); void (*p_vkCmdDrawIndexedIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); + void (*p_vkCmdDrawIndexedIndirectCountAMD)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); void (*p_vkCmdDrawIndirect)(VkCommandBuffer, VkBuffer, VkDeviceSize, uint32_t, uint32_t); + void (*p_vkCmdDrawIndirectCountAMD)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkBuffer, VkDeviceSize, uint32_t, uint32_t); void (*p_vkCmdEndQuery)(VkCommandBuffer, VkQueryPool, uint32_t); void (*p_vkCmdEndRenderPass)(VkCommandBuffer); void (*p_vkCmdExecuteCommands)(VkCommandBuffer, uint32_t, const VkCommandBuffer *); @@ -619,12 +635,19 @@ struct vulkan_device_funcs void (*p_vkCmdPipelineBarrier)(VkCommandBuffer, VkPipelineStageFlags, VkPipelineStageFlags, VkDependencyFlags, uint32_t, const VkMemoryBarrier *, uint32_t, const VkBufferMemoryBarrier *, uint32_t, const VkImageMemoryBarrier *); #endif void (*p_vkCmdPushConstants)(VkCommandBuffer, VkPipelineLayout, VkShaderStageFlags, uint32_t, uint32_t, const void *); +#if defined(USE_STRUCT_CONVERSION) + void (*p_vkCmdPushDescriptorSetKHR)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkWriteDescriptorSet_host *); +#else + void (*p_vkCmdPushDescriptorSetKHR)(VkCommandBuffer, VkPipelineBindPoint, VkPipelineLayout, uint32_t, uint32_t, const VkWriteDescriptorSet *); +#endif + void (*p_vkCmdPushDescriptorSetWithTemplateKHR)(VkCommandBuffer, VkDescriptorUpdateTemplateKHR, VkPipelineLayout, uint32_t, const void *); void (*p_vkCmdResetEvent)(VkCommandBuffer, VkEvent, VkPipelineStageFlags); void (*p_vkCmdResetQueryPool)(VkCommandBuffer, VkQueryPool, uint32_t, uint32_t); void (*p_vkCmdResolveImage)(VkCommandBuffer, VkImage, VkImageLayout, VkImage, VkImageLayout, uint32_t, const VkImageResolve *); void (*p_vkCmdSetBlendConstants)(VkCommandBuffer, const float[4]); void (*p_vkCmdSetDepthBias)(VkCommandBuffer, float, float, float); void (*p_vkCmdSetDepthBounds)(VkCommandBuffer, float, float); + void (*p_vkCmdSetDiscardRectangleEXT)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); void (*p_vkCmdSetEvent)(VkCommandBuffer, VkEvent, VkPipelineStageFlags); void (*p_vkCmdSetLineWidth)(VkCommandBuffer, float); void (*p_vkCmdSetScissor)(VkCommandBuffer, uint32_t, uint32_t, const VkRect2D *); @@ -632,6 +655,7 @@ struct vulkan_device_funcs void (*p_vkCmdSetStencilReference)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); void (*p_vkCmdSetStencilWriteMask)(VkCommandBuffer, VkStencilFaceFlags, uint32_t); void (*p_vkCmdSetViewport)(VkCommandBuffer, uint32_t, uint32_t, const VkViewport *); + void (*p_vkCmdSetViewportWScalingNV)(VkCommandBuffer, uint32_t, uint32_t, const VkViewportWScalingNV *); void (*p_vkCmdUpdateBuffer)(VkCommandBuffer, VkBuffer, VkDeviceSize, VkDeviceSize, const void *); #if defined(USE_STRUCT_CONVERSION) void (*p_vkCmdWaitEvents)(VkCommandBuffer, uint32_t, const VkEvent *, VkPipelineStageFlags, VkPipelineStageFlags, uint32_t, const VkMemoryBarrier *, uint32_t, const VkBufferMemoryBarrier_host *, uint32_t, const VkImageMemoryBarrier_host *); @@ -657,6 +681,11 @@ struct vulkan_device_funcs #endif VkResult (*p_vkCreateDescriptorPool)(VkDevice, const VkDescriptorPoolCreateInfo *, const VkAllocationCallbacks *, VkDescriptorPool *); VkResult (*p_vkCreateDescriptorSetLayout)(VkDevice, const VkDescriptorSetLayoutCreateInfo *, const VkAllocationCallbacks *, VkDescriptorSetLayout *); +#if defined(USE_STRUCT_CONVERSION) + VkResult (*p_vkCreateDescriptorUpdateTemplateKHR)(VkDevice, const VkDescriptorUpdateTemplateCreateInfoKHR_host *, const VkAllocationCallbacks *, VkDescriptorUpdateTemplateKHR *); +#else + VkResult (*p_vkCreateDescriptorUpdateTemplateKHR)(VkDevice, const VkDescriptorUpdateTemplateCreateInfoKHR *, const VkAllocationCallbacks *, VkDescriptorUpdateTemplateKHR *); +#endif VkResult (*p_vkCreateEvent)(VkDevice, const VkEventCreateInfo *, const VkAllocationCallbacks *, VkEvent *); VkResult (*p_vkCreateFence)(VkDevice, const VkFenceCreateInfo *, const VkAllocationCallbacks *, VkFence *); #if defined(USE_STRUCT_CONVERSION) @@ -687,6 +716,7 @@ struct vulkan_device_funcs void (*p_vkDestroyCommandPool)(VkDevice, VkCommandPool, const VkAllocationCallbacks *); void (*p_vkDestroyDescriptorPool)(VkDevice, VkDescriptorPool, const VkAllocationCallbacks *); void (*p_vkDestroyDescriptorSetLayout)(VkDevice, VkDescriptorSetLayout, const VkAllocationCallbacks *); + void (*p_vkDestroyDescriptorUpdateTemplateKHR)(VkDevice, VkDescriptorUpdateTemplateKHR, const VkAllocationCallbacks *); void (*p_vkDestroyDevice)(VkDevice, const VkAllocationCallbacks *); void (*p_vkDestroyEvent)(VkDevice, VkEvent, const VkAllocationCallbacks *); void (*p_vkDestroyFence)(VkDevice, VkFence, const VkAllocationCallbacks *); @@ -754,7 +784,9 @@ struct vulkan_device_funcs VkResult (*p_vkResetEvent)(VkDevice, VkEvent); VkResult (*p_vkResetFences)(VkDevice, uint32_t, const VkFence *); VkResult (*p_vkSetEvent)(VkDevice, VkEvent); + void (*p_vkTrimCommandPoolKHR)(VkDevice, VkCommandPool, VkCommandPoolTrimFlagsKHR); void (*p_vkUnmapMemory)(VkDevice, VkDeviceMemory); + void (*p_vkUpdateDescriptorSetWithTemplateKHR)(VkDevice, VkDescriptorSet, VkDescriptorUpdateTemplateKHR, const void *); #if defined(USE_STRUCT_CONVERSION) void (*p_vkUpdateDescriptorSets)(VkDevice, uint32_t, const VkWriteDescriptorSet_host *, uint32_t, const VkCopyDescriptorSet_host *); #else @@ -837,7 +869,9 @@ struct vulkan_instance_funcs USE_VK_FUNC(vkCmdDraw) \ USE_VK_FUNC(vkCmdDrawIndexed) \ USE_VK_FUNC(vkCmdDrawIndexedIndirect) \ + USE_VK_FUNC(vkCmdDrawIndexedIndirectCountAMD) \ USE_VK_FUNC(vkCmdDrawIndirect) \ + USE_VK_FUNC(vkCmdDrawIndirectCountAMD) \ USE_VK_FUNC(vkCmdEndQuery) \ USE_VK_FUNC(vkCmdEndRenderPass) \ USE_VK_FUNC(vkCmdExecuteCommands) \ @@ -845,12 +879,15 @@ struct vulkan_instance_funcs USE_VK_FUNC(vkCmdNextSubpass) \ USE_VK_FUNC(vkCmdPipelineBarrier) \ USE_VK_FUNC(vkCmdPushConstants) \ + USE_VK_FUNC(vkCmdPushDescriptorSetKHR) \ + USE_VK_FUNC(vkCmdPushDescriptorSetWithTemplateKHR) \ USE_VK_FUNC(vkCmdResetEvent) \ USE_VK_FUNC(vkCmdResetQueryPool) \ USE_VK_FUNC(vkCmdResolveImage) \ USE_VK_FUNC(vkCmdSetBlendConstants) \ USE_VK_FUNC(vkCmdSetDepthBias) \ USE_VK_FUNC(vkCmdSetDepthBounds) \ + USE_VK_FUNC(vkCmdSetDiscardRectangleEXT) \ USE_VK_FUNC(vkCmdSetEvent) \ USE_VK_FUNC(vkCmdSetLineWidth) \ USE_VK_FUNC(vkCmdSetScissor) \ @@ -858,6 +895,7 @@ struct vulkan_instance_funcs USE_VK_FUNC(vkCmdSetStencilReference) \ USE_VK_FUNC(vkCmdSetStencilWriteMask) \ USE_VK_FUNC(vkCmdSetViewport) \ + USE_VK_FUNC(vkCmdSetViewportWScalingNV) \ USE_VK_FUNC(vkCmdUpdateBuffer) \ USE_VK_FUNC(vkCmdWaitEvents) \ USE_VK_FUNC(vkCmdWriteTimestamp) \ @@ -867,6 +905,7 @@ struct vulkan_instance_funcs USE_VK_FUNC(vkCreateComputePipelines) \ USE_VK_FUNC(vkCreateDescriptorPool) \ USE_VK_FUNC(vkCreateDescriptorSetLayout) \ + USE_VK_FUNC(vkCreateDescriptorUpdateTemplateKHR) \ USE_VK_FUNC(vkCreateEvent) \ USE_VK_FUNC(vkCreateFence) \ USE_VK_FUNC(vkCreateFramebuffer) \ @@ -885,6 +924,7 @@ struct vulkan_instance_funcs USE_VK_FUNC(vkDestroyCommandPool) \ USE_VK_FUNC(vkDestroyDescriptorPool) \ USE_VK_FUNC(vkDestroyDescriptorSetLayout) \ + USE_VK_FUNC(vkDestroyDescriptorUpdateTemplateKHR) \ USE_VK_FUNC(vkDestroyDevice) \ USE_VK_FUNC(vkDestroyEvent) \ USE_VK_FUNC(vkDestroyFence) \ @@ -928,7 +968,9 @@ struct vulkan_instance_funcs USE_VK_FUNC(vkResetEvent) \ USE_VK_FUNC(vkResetFences) \ USE_VK_FUNC(vkSetEvent) \ + USE_VK_FUNC(vkTrimCommandPoolKHR) \ USE_VK_FUNC(vkUnmapMemory) \ + USE_VK_FUNC(vkUpdateDescriptorSetWithTemplateKHR) \ USE_VK_FUNC(vkUpdateDescriptorSets) \ USE_VK_FUNC(vkWaitForFences)
diff --git a/include/wine/vulkan.h b/include/wine/vulkan.h index c75544774a..fcc31bc3c9 100644 --- a/include/wine/vulkan.h +++ b/include/wine/vulkan.h @@ -57,6 +57,7 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout) +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplateKHR) VK_DEFINE_HANDLE(VkDevice) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent) @@ -378,6 +379,7 @@ typedef enum VkDescriptorPoolCreateFlagBits
typedef enum VkDescriptorSetLayoutCreateFlagBits { + VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001, VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, } VkDescriptorSetLayoutCreateFlagBits;
@@ -397,6 +399,13 @@ typedef enum VkDescriptorType VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7fffffff, } VkDescriptorType;
+typedef enum VkDescriptorUpdateTemplateTypeKHR +{ + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET_KHR = 0, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR = 1, + VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_KHR_MAX_ENUM = 0x7fffffff, +} VkDescriptorUpdateTemplateTypeKHR; + typedef enum VkDynamicState { VK_DYNAMIC_STATE_VIEWPORT = 0, @@ -408,6 +417,8 @@ typedef enum VkDynamicState VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6, VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7, VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8, + VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_NV = 1000087000, + VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT = 1000099000, VK_DYNAMIC_STATE_MAX_ENUM = 0x7fffffff, } VkDynamicState;
@@ -421,6 +432,7 @@ typedef enum VkFilter { VK_FILTER_NEAREST = 0, VK_FILTER_LINEAR = 1, + VK_FILTER_CUBIC_IMG = 1000015000, VK_FILTER_MAX_ENUM = 0x7fffffff, } VkFilter;
@@ -611,6 +623,14 @@ typedef enum VkFormat VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, + VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, + VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, + VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, + VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, + VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, + VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, + VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, + VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, VK_FORMAT_MAX_ENUM = 0x7fffffff, } VkFormat;
@@ -629,6 +649,9 @@ typedef enum VkFormatFeatureFlagBits VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000, + VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000, + VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000, + VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000, VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7fffffff, } VkFormatFeatureFlagBits;
@@ -655,6 +678,7 @@ typedef enum VkImageCreateFlagBits VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, + VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020, VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7fffffff, } VkImageCreateFlagBits;
@@ -793,6 +817,7 @@ typedef enum VkObjectType VK_OBJECT_TYPE_COMMAND_POOL = 25, VK_OBJECT_TYPE_SURFACE_KHR = 1000000000, VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000, + VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR = 1000085000, VK_OBJECT_TYPE_MAX_ENUM = 0x7fffffff, } VkObjectType;
@@ -923,6 +948,8 @@ typedef enum VkQueueFlagBits
typedef enum VkResult { + VK_ERROR_OUT_OF_POOL_MEMORY_KHR = -1000069000, + VK_ERROR_INVALID_SHADER_NV = -1000012000, VK_ERROR_OUT_OF_DATE_KHR = -1000001004, VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001, VK_ERROR_SURFACE_LOST_KHR = -1000000000, @@ -1077,6 +1104,13 @@ typedef enum VkStructureType VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, + VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001, + VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002, + VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD = 1000041000, + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000, + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001, VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002, @@ -1086,6 +1120,13 @@ typedef enum VkStructureType VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006, VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PUSH_DESCRIPTOR_PROPERTIES_KHR = 1000080000, + VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000, + VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO_KHR = 1000085000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_W_SCALING_STATE_CREATE_INFO_NV = 1000087000, + VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_SWIZZLE_STATE_CREATE_INFO_NV = 1000098000, + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DISCARD_RECTANGLE_PROPERTIES_EXT = 1000099000, + VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT = 1000099001, VK_STRUCTURE_TYPE_MAX_ENUM = 0x7fffffff, } VkStructureType;
@@ -1268,6 +1309,16 @@ typedef struct VkDescriptorSetLayoutBinding const VkSampler *pImmutableSamplers; } VkDescriptorSetLayoutBinding;
+typedef struct VkDescriptorUpdateTemplateEntryKHR +{ + uint32_t dstBinding; + uint32_t dstArrayElement; + uint32_t descriptorCount; + VkDescriptorType descriptorType; + size_t offset; + size_t stride; +} VkDescriptorUpdateTemplateEntryKHR; + typedef struct VkDispatchIndirectCommand { uint32_t x; @@ -1696,6 +1747,20 @@ typedef struct VkDescriptorSetAllocateInfo const VkDescriptorSetLayout *pSetLayouts; } VkDescriptorSetAllocateInfo;
+typedef struct VkDescriptorUpdateTemplateCreateInfoKHR +{ + VkStructureType sType; + void *pNext; + VkDescriptorUpdateTemplateCreateFlagsKHR flags; + uint32_t descriptorUpdateEntryCount; + const VkDescriptorUpdateTemplateEntryKHR *pDescriptorUpdateEntries; + VkDescriptorUpdateTemplateTypeKHR templateType; + VkDescriptorSetLayout WINE_VK_ALIGN(8) descriptorSetLayout; + VkPipelineBindPoint pipelineBindPoint; + VkPipelineLayout WINE_VK_ALIGN(8) pipelineLayout; + uint32_t set; +} VkDescriptorUpdateTemplateCreateInfoKHR; + typedef struct VkEventCreateInfo { VkStructureType sType; @@ -2049,6 +2114,12 @@ typedef struct VkSwapchainCreateInfoKHR VkSwapchainKHR WINE_VK_ALIGN(8) oldSwapchain; } VkSwapchainCreateInfoKHR;
+typedef struct VkViewportWScalingNV +{ + float xcoeff; + float ycoeff; +} VkViewportWScalingNV; + typedef struct VkClearAttachment { VkImageAspectFlags aspectMask; @@ -2507,7 +2578,9 @@ void VKAPI_CALL vkCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer bu void VKAPI_CALL vkCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); void VKAPI_CALL vkCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); void VKAPI_CALL vkCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +void VKAPI_CALL vkCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); void VKAPI_CALL vkCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); +void VKAPI_CALL vkCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); void VKAPI_CALL vkCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); void VKAPI_CALL vkCmdEndRenderPass(VkCommandBuffer commandBuffer); void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer *pCommandBuffers); @@ -2515,12 +2588,15 @@ void VKAPI_CALL vkCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffe void VKAPI_CALL vkCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents); void VKAPI_CALL vkCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers); void VKAPI_CALL vkCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void *pValues); +void VKAPI_CALL vkCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites); +void VKAPI_CALL vkCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void *pData); void VKAPI_CALL vkCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); void VKAPI_CALL vkCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); void VKAPI_CALL vkCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve *pRegions); void VKAPI_CALL vkCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]); void VKAPI_CALL vkCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); void VKAPI_CALL vkCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); +void VKAPI_CALL vkCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D *pDiscardRectangles); void VKAPI_CALL vkCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); void VKAPI_CALL vkCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth); void VKAPI_CALL vkCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D *pScissors); @@ -2528,6 +2604,7 @@ void VKAPI_CALL vkCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkSten void VKAPI_CALL vkCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); void VKAPI_CALL vkCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); void VKAPI_CALL vkCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport *pViewports); +void VKAPI_CALL vkCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV *pViewportWScalings); void VKAPI_CALL vkCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void *pData); void VKAPI_CALL vkCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent *pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier *pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier *pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier *pImageMemoryBarriers); void VKAPI_CALL vkCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); @@ -2537,6 +2614,7 @@ VkResult VKAPI_CALL vkCreateCommandPool(VkDevice device, const VkCommandPoolCrea VkResult VKAPI_CALL vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines); VkResult VKAPI_CALL vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorPool *pDescriptorPool); VkResult VKAPI_CALL vkCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorSetLayout *pSetLayout); +VkResult VKAPI_CALL vkCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDescriptorUpdateTemplateKHR *pDescriptorUpdateTemplate); VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDevice *pDevice); VkResult VKAPI_CALL vkCreateEvent(VkDevice device, const VkEventCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkEvent *pEvent); VkResult VKAPI_CALL vkCreateFence(VkDevice device, const VkFenceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkFence *pFence); @@ -2559,6 +2637,7 @@ void VKAPI_CALL vkDestroyBufferView(VkDevice device, VkBufferView bufferView, co void VKAPI_CALL vkDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks *pAllocator); void VKAPI_CALL vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks *pAllocator); void VKAPI_CALL vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks *pAllocator); +void VKAPI_CALL vkDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const VkAllocationCallbacks *pAllocator); void VKAPI_CALL vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *pAllocator); void VKAPI_CALL vkDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks *pAllocator); void VKAPI_CALL vkDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks *pAllocator); @@ -2633,7 +2712,9 @@ VkResult VKAPI_CALL vkResetDescriptorPool(VkDevice device, VkDescriptorPool desc VkResult VKAPI_CALL vkResetEvent(VkDevice device, VkEvent event); VkResult VKAPI_CALL vkResetFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences); VkResult VKAPI_CALL vkSetEvent(VkDevice device, VkEvent event); +void VKAPI_CALL vkTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlagsKHR flags); void VKAPI_CALL vkUnmapMemory(VkDevice device, VkDeviceMemory memory); +void VKAPI_CALL vkUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, const void *pData); void VKAPI_CALL vkUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet *pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet *pDescriptorCopies); VkResult VKAPI_CALL vkWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence *pFences, VkBool32 waitAll, uint64_t timeout);
Signed-off-by: Józef Kucia jkucia@codeweavers.com