[PATCH 1/6] wined3d: Separate a helper to update Vulkan CBV bindings.

Zebediah Figura (she/her) zfigura at codeweavers.com
Thu Jul 22 11:24:30 CDT 2021


On 7/22/21 7:49 AM, Henri Verbeet wrote:
> On Thu, 22 Jul 2021 at 03:46, Zebediah Figura <zfigura at 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?
> 

I did have a hard time naming this function :-/

That one seems reasonable enough to me, though.



More information about the wine-devel mailing list