Commit 50a90dcb authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent ff19c3e6
......@@ -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);
......
......@@ -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))
{
......
......@@ -3875,6 +3875,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;
......
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