On Thu, 22 Jul 2021 at 03:46, Zebediah Figura zfigura@codeweavers.com wrote:
+static bool wined3d_context_vk_update_cbv_binding(struct wined3d_context_vk *context_vk,
struct wined3d_shader_descriptor_writes_vk *writes, VkDescriptorSet vk_descriptor_set,
const struct wined3d_state *state, const struct wined3d_shader_resource_binding *binding)
+{
- struct wined3d_device_vk *device_vk = wined3d_device_vk(context_vk->c.device);
- const VkDescriptorBufferInfo *buffer_info;
- struct wined3d_buffer_vk *buffer_vk;
- struct wined3d_buffer *buffer;
- if (!(buffer = state->cb[binding->shader_type][binding->resource_idx].buffer))
return 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);
- buffer_vk = wined3d_buffer_vk(buffer);
- buffer_info = wined3d_buffer_vk_get_buffer_info(buffer_vk);
- if (!wined3d_shader_descriptor_writes_vk_add_write(writes, vk_descriptor_set,
binding->binding_idx, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, buffer_info, NULL, NULL))
return false;
- wined3d_context_vk_reference_bo(context_vk, &buffer_vk->bo);
- return true;
+}
This doesn't actually update "binding" though; the main thing it does is appending a descriptor write to "writes". Would a name like "wined3d_shader_descriptor_writes_vk_add_cbv_write()" make sense to you?