Signed-off-by: Zebediah Figura zfigura@codeweavers.com --- dlls/wined3d/context_vk.c | 4 ++++ dlls/wined3d/device.c | 15 +++++++++++++++ dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 20 insertions(+)
diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index aeaeca322ff..bb6c0bfd706 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -2678,6 +2678,10 @@ static bool wined3d_shader_resource_bindings_add_null_srv_binding(struct wined3d return wined3d_shader_descriptor_writes_vk_add_write(writes, vk_descriptor_set, binding_idx, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, NULL, &v->vk_info_2dms_array, NULL);
+ case WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY: + return wined3d_shader_descriptor_writes_vk_add_write(writes, vk_descriptor_set, + binding_idx, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, NULL, &v->vk_info_cube_array, NULL); + default: FIXME("Unhandled resource type %#x.\n", type); return false; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 07bd7c65ad7..71b1e3c3f88 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -855,9 +855,23 @@ bool wined3d_device_vk_create_null_views(struct wined3d_device_vk *device_vk, st v->vk_info_2dms_array.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; TRACE("Created 2D MSAA array image view 0x%s.\n", wine_dbgstr_longlong(v->vk_info_2dms_array.imageView));
+ view_desc.image = r->image_2d.vk_image; + view_desc.subresourceRange.layerCount = 6; + view_desc.viewType = VK_IMAGE_VIEW_TYPE_CUBE_ARRAY; + if ((vr = VK_CALL(vkCreateImageView(device_vk->vk_device, &view_desc, NULL, &v->vk_info_cube_array.imageView))) < 0) + { + ERR("Failed to create cube array image view, vr %s.\n", wined3d_debug_vkresult(vr)); + goto fail; + } + v->vk_info_cube_array.sampler = VK_NULL_HANDLE; + v->vk_info_cube_array.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; + TRACE("Created cube array image view 0x%s.\n", wine_dbgstr_longlong(v->vk_info_cube_array.imageView)); + return true;
fail: + if (v->vk_info_cube_array.imageView) + VK_CALL(vkDestroyImageView(device_vk->vk_device, v->vk_info_cube_array.imageView, NULL)); if (v->vk_info_2d_array.imageView) VK_CALL(vkDestroyImageView(device_vk->vk_device, v->vk_info_2d_array.imageView, NULL)); if (v->vk_info_cube.imageView) @@ -883,6 +897,7 @@ void wined3d_device_vk_destroy_null_views(struct wined3d_device_vk *device_vk, s struct wined3d_null_views_vk *v = &device_vk->null_views_vk; uint64_t id = context_vk->current_command_buffer.id;
+ wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_cube_array.imageView, id); wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_2dms_array.imageView, id); wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_2d_array.imageView, id); wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_cube.imageView, id); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 97be4bd5e2a..8c49e694fa9 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3942,6 +3942,7 @@ struct wined3d_null_views_vk VkDescriptorImageInfo vk_info_1d_array; VkDescriptorImageInfo vk_info_2d_array; VkDescriptorImageInfo vk_info_2dms_array; + VkDescriptorImageInfo vk_info_cube_array; };
#define WINED3D_ALLOCATOR_CHUNK_SIZE (64 * 1024 * 1024)