vkd3d: Support null address for CBV root descriptors.

This commit is contained in:
Conor McCarthy 2023-04-17 15:04:27 +10:00 committed by Alexandre Julliard
parent 827a359b45
commit 963e5e26dc
Notes: Alexandre Julliard 2023-04-19 22:11:46 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/163

View File

@ -4481,11 +4481,20 @@ static void d3d12_command_list_set_root_cbv(struct d3d12_command_list *list,
root_parameter = root_signature_get_root_descriptor(root_signature, index);
assert(root_parameter->parameter_type == D3D12_ROOT_PARAMETER_TYPE_CBV);
resource = vkd3d_gpu_va_allocator_dereference(&list->device->gpu_va_allocator, gpu_address);
buffer_info.buffer = resource->u.vk_buffer;
buffer_info.offset = gpu_address - resource->gpu_address;
buffer_info.range = resource->desc.Width - buffer_info.offset;
buffer_info.range = min(buffer_info.range, vk_info->device_limits.maxUniformBufferRange);
if (gpu_address)
{
resource = vkd3d_gpu_va_allocator_dereference(&list->device->gpu_va_allocator, gpu_address);
buffer_info.buffer = resource->u.vk_buffer;
buffer_info.offset = gpu_address - resource->gpu_address;
buffer_info.range = resource->desc.Width - buffer_info.offset;
buffer_info.range = min(buffer_info.range, vk_info->device_limits.maxUniformBufferRange);
}
else
{
buffer_info.buffer = list->device->null_resources.vk_buffer;
buffer_info.offset = 0;
buffer_info.range = VK_WHOLE_SIZE;
}
if (vk_info->KHR_push_descriptor)
{