Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/adapter_vk.c | 7 +++++-- dlls/wined3d/view.c | 14 +++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 5a5b51da501..a0f503edbe5 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -1392,6 +1392,7 @@ static void adapter_vk_destroy_unordered_access_view(struct wined3d_unordered_ac struct wined3d_device *device = uav_vk->v.resource->device; unsigned int swapchain_count = device->swapchain_count; struct wined3d_view_vk *view_vk = &uav_vk->view_vk; + VkBufferView *vk_buffer_view = NULL; VkImageView *vk_image_view = NULL;
TRACE("uav_vk %p.\n", uav_vk); @@ -1402,10 +1403,12 @@ static void adapter_vk_destroy_unordered_access_view(struct wined3d_unordered_ac * the refcount on a device that's in the process of being destroyed. */ if (swapchain_count) wined3d_device_incref(device); - if (uav_vk->v.resource->type != WINED3D_RTYPE_BUFFER) + if (uav_vk->v.resource->type == WINED3D_RTYPE_BUFFER) + vk_buffer_view = &view_vk->u.vk_buffer_view; + else vk_image_view = &view_vk->u.vk_image_info.imageView; wined3d_unordered_access_view_cleanup(&uav_vk->v); - wined3d_view_vk_destroy(device, NULL, vk_image_view, &view_vk->command_buffer_id, uav_vk); + wined3d_view_vk_destroy(device, vk_buffer_view, vk_image_view, &view_vk->command_buffer_id, uav_vk); if (swapchain_count) wined3d_device_decref(device); } diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 1e9a2052ecf..d87a94023d2 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -1463,6 +1463,7 @@ static void wined3d_unordered_access_view_vk_cs_init(void *object) struct wined3d_context_vk *context_vk; struct wined3d_device_vk *device_vk; struct wined3d_resource *resource; + VkBufferView vk_buffer_view; uint32_t default_flags = 0; VkImageView vk_image_view;
@@ -1472,7 +1473,18 @@ static void wined3d_unordered_access_view_vk_cs_init(void *object)
if (resource->type == WINED3D_RTYPE_BUFFER) { - FIXME("Buffer views not implemented.\n"); + context_vk = wined3d_context_vk(context_acquire(&device_vk->d, NULL, 0)); + vk_buffer_view = wined3d_view_vk_create_buffer_view(context_vk, + desc, wined3d_buffer_vk(buffer_from_resource(resource)), format_vk); + context_release(&context_vk->c); + + if (!vk_buffer_view) + return; + + TRACE("Created buffer view 0x%s.\n", wine_dbgstr_longlong(vk_buffer_view)); + + uav_vk->view_vk.u.vk_buffer_view = vk_buffer_view; + return; }