wined3d: Implement Vulkan NULL cube array image shader resource view descriptors.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d869f4a8bc
commit
1ebe7e8b0e
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue