Commit 1ebe7e8b authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Implement Vulkan NULL cube array image shader resource view descriptors.

parent d869f4a8
...@@ -2678,6 +2678,10 @@ static bool wined3d_shader_resource_bindings_add_null_srv_binding(struct wined3d ...@@ -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, 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); 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: default:
FIXME("Unhandled resource type %#x.\n", type); FIXME("Unhandled resource type %#x.\n", type);
return false; return false;
......
...@@ -855,9 +855,23 @@ bool wined3d_device_vk_create_null_views(struct wined3d_device_vk *device_vk, st ...@@ -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; 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)); 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; return true;
fail: 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) if (v->vk_info_2d_array.imageView)
VK_CALL(vkDestroyImageView(device_vk->vk_device, v->vk_info_2d_array.imageView, NULL)); VK_CALL(vkDestroyImageView(device_vk->vk_device, v->vk_info_2d_array.imageView, NULL));
if (v->vk_info_cube.imageView) if (v->vk_info_cube.imageView)
...@@ -883,6 +897,7 @@ void wined3d_device_vk_destroy_null_views(struct wined3d_device_vk *device_vk, s ...@@ -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; struct wined3d_null_views_vk *v = &device_vk->null_views_vk;
uint64_t id = context_vk->current_command_buffer.id; 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_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_2d_array.imageView, id);
wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_cube.imageView, id); wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_cube.imageView, id);
......
...@@ -3942,6 +3942,7 @@ struct wined3d_null_views_vk ...@@ -3942,6 +3942,7 @@ struct wined3d_null_views_vk
VkDescriptorImageInfo vk_info_1d_array; VkDescriptorImageInfo vk_info_1d_array;
VkDescriptorImageInfo vk_info_2d_array; VkDescriptorImageInfo vk_info_2d_array;
VkDescriptorImageInfo vk_info_2dms_array; VkDescriptorImageInfo vk_info_2dms_array;
VkDescriptorImageInfo vk_info_cube_array;
}; };
#define WINED3D_ALLOCATOR_CHUNK_SIZE (64 * 1024 * 1024) #define WINED3D_ALLOCATOR_CHUNK_SIZE (64 * 1024 * 1024)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment