From 128852200a7219a74bcce78dccc6e9da13610cae Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Wed, 24 Nov 2021 16:50:27 +0100 Subject: [PATCH] vkd3d: Store the raw VA index in root signature for root descriptors. Needed when building device generated commands later. Signed-off-by: Hans-Kristian Arntzen --- include/vkd3d_shader.h | 1 + libs/vkd3d/state.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index eb8d66a8..7f7e893c 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -241,6 +241,7 @@ struct vkd3d_shader_root_constant struct vkd3d_shader_root_descriptor { struct vkd3d_shader_resource_binding *binding; + uint32_t raw_va_root_descriptor_index; }; struct vkd3d_shader_root_parameter diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index cafcba9b..631adf79 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -945,6 +945,7 @@ static HRESULT d3d12_root_signature_init_root_descriptors(struct d3d12_root_sign struct vkd3d_shader_resource_binding *binding; VkDescriptorSetLayoutCreateFlags vk_flags; struct vkd3d_shader_root_parameter *param; + uint32_t raw_va_root_descriptor_count = 0; unsigned int hoisted_parameter_index; const D3D12_DESCRIPTOR_RANGE1 *range; unsigned int i, j, k; @@ -1061,10 +1062,13 @@ static HRESULT d3d12_root_signature_init_root_descriptors(struct d3d12_root_sign param = &root_signature->parameters[i]; param->parameter_type = p->ParameterType; param->descriptor.binding = binding; + param->descriptor.raw_va_root_descriptor_index = raw_va_root_descriptor_count; context->binding_index += 1; - if (!raw_va) + if (raw_va) + raw_va_root_descriptor_count += 1; + else context->vk_binding += 1; }