Commit 6eaf494f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent 93077d4b
......@@ -2620,6 +2620,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_cube, NULL);
case WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY:
return wined3d_shader_descriptor_writes_vk_add_write(writes, vk_descriptor_set,
binding_idx, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, NULL, &v->vk_info_1d_array, NULL);
case WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY:
return wined3d_shader_descriptor_writes_vk_add_write(writes, vk_descriptor_set,
binding_idx, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, NULL, &v->vk_info_2d_array, NULL);
......
......@@ -778,6 +778,16 @@ bool wined3d_device_vk_create_null_views(struct wined3d_device_vk *device_vk, st
v->vk_info_1d.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
TRACE("Created 1D image view 0x%s.\n", wine_dbgstr_longlong(v->vk_info_1d.imageView));
view_desc.viewType = VK_IMAGE_VIEW_TYPE_1D_ARRAY;
if ((vr = VK_CALL(vkCreateImageView(device_vk->vk_device, &view_desc, NULL, &v->vk_info_1d_array.imageView))) < 0)
{
ERR("Failed to create 1D image view, vr %s.\n", wined3d_debug_vkresult(vr));
goto fail;
}
v->vk_info_1d_array.sampler = VK_NULL_HANDLE;
v->vk_info_1d_array.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
TRACE("Created 1D array image view 0x%s.\n", wine_dbgstr_longlong(v->vk_info_1d_array.imageView));
view_desc.image = r->image_2d.vk_image;
view_desc.viewType = VK_IMAGE_VIEW_TYPE_2D;
if ((vr = VK_CALL(vkCreateImageView(device_vk->vk_device, &view_desc, NULL, &v->vk_info_2d.imageView))) < 0)
......@@ -858,6 +868,8 @@ fail:
VK_CALL(vkDestroyImageView(device_vk->vk_device, v->vk_info_2dms.imageView, NULL));
if (v->vk_info_2d.imageView)
VK_CALL(vkDestroyImageView(device_vk->vk_device, v->vk_info_2d.imageView, NULL));
if (v->vk_info_1d_array.imageView)
VK_CALL(vkDestroyImageView(device_vk->vk_device, v->vk_info_1d_array.imageView, NULL));
if (v->vk_info_1d.imageView)
VK_CALL(vkDestroyImageView(device_vk->vk_device, v->vk_info_1d.imageView, NULL));
if (v->vk_view_buffer_float)
......@@ -877,6 +889,7 @@ void wined3d_device_vk_destroy_null_views(struct wined3d_device_vk *device_vk, s
wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_3d.imageView, id);
wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_2dms.imageView, id);
wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_2d.imageView, id);
wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_1d_array.imageView, id);
wined3d_context_vk_destroy_vk_image_view(context_vk, v->vk_info_1d.imageView, id);
wined3d_context_vk_destroy_vk_buffer_view(context_vk, v->vk_view_buffer_float, id);
......
......@@ -3914,6 +3914,7 @@ struct wined3d_null_views_vk
VkDescriptorImageInfo vk_info_2dms;
VkDescriptorImageInfo vk_info_3d;
VkDescriptorImageInfo vk_info_cube;
VkDescriptorImageInfo vk_info_1d_array;
VkDescriptorImageInfo vk_info_2d_array;
VkDescriptorImageInfo vk_info_2dms_array;
};
......
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