wined3d: Implement NULL constant buffer views for the Vulkan backend.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 50a90dcb32)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Henri Verbeet 2021-01-22 10:45:22 +01:00 committed by Michael Stefaniuc
parent 129baec9ba
commit 53bbcc789e
3 changed files with 12 additions and 3 deletions

View File

@ -2527,8 +2527,11 @@ static bool wined3d_context_vk_update_descriptors(struct wined3d_context_vk *con
case WINED3D_SHADER_DESCRIPTOR_TYPE_CBV:
if (!(buffer = state->cb[binding->shader_type][binding->resource_idx]))
{
FIXME("NULL constant buffer views not implemented.\n");
return false;
if (!wined3d_shader_descriptor_writes_vk_add_write(writes, vk_descriptor_set,
binding->binding_idx, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
&device_vk->null_resources_vk.buffer_info, NULL, NULL))
return false;
break;
}
buffer_vk = wined3d_buffer_vk(buffer);
buffer_info = wined3d_buffer_vk_get_buffer_info(buffer_vk);

View File

@ -717,11 +717,15 @@ bool wined3d_device_vk_create_null_resources(struct wined3d_device_vk *device_vk
vk_info = context_vk->vk_info;
usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT;
usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
| VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
memory_type = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
if (!wined3d_context_vk_create_bo(context_vk, 16, usage, memory_type, &r->bo))
return false;
VK_CALL(vkCmdFillBuffer(vk_command_buffer, r->bo.vk_buffer, r->bo.buffer_offset, r->bo.size, 0x00000000u));
r->buffer_info.buffer = r->bo.vk_buffer;
r->buffer_info.offset = r->bo.buffer_offset;
r->buffer_info.range = r->bo.size;
if (!wined3d_null_image_vk_init(&r->image_1d, context_vk, vk_command_buffer, VK_IMAGE_TYPE_1D, 1, 1))
{

View File

@ -3881,6 +3881,8 @@ struct wined3d_null_image_vk
struct wined3d_null_resources_vk
{
struct wined3d_bo_vk bo;
VkDescriptorBufferInfo buffer_info;
struct wined3d_null_image_vk image_1d;
struct wined3d_null_image_vk image_2d;
struct wined3d_null_image_vk image_2dms;