diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index c401349b..0532ec0d 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -2539,8 +2539,8 @@ static void d3d12_command_list_prepare_descriptors(struct d3d12_command_list *li root_signature->vk_set_layout); bindings->in_use = false; - bindings->descriptor_table_dirty_mask |= bindings->descriptor_table_active_mask; - bindings->push_descriptor_dirty_mask |= bindings->push_descriptor_active_mask; + bindings->descriptor_table_dirty_mask |= bindings->descriptor_table_active_mask & root_signature->descriptor_table_mask; + bindings->push_descriptor_dirty_mask |= bindings->push_descriptor_active_mask & root_signature->push_descriptor_mask; } static bool vk_write_descriptor_set_from_d3d12_desc(VkWriteDescriptorSet *vk_descriptor_write, @@ -4030,10 +4030,8 @@ static void d3d12_command_list_set_root_signature(struct d3d12_command_list *lis bindings->root_signature = root_signature; bindings->descriptor_set = VK_NULL_HANDLE; - bindings->descriptor_table_dirty_mask = 0; - bindings->descriptor_table_active_mask = 0; - bindings->push_descriptor_dirty_mask = 0; - bindings->push_descriptor_active_mask = 0; + bindings->descriptor_table_dirty_mask = bindings->descriptor_table_active_mask & root_signature->descriptor_table_mask; + bindings->push_descriptor_dirty_mask = bindings->push_descriptor_active_mask & root_signature->push_descriptor_mask; } static void STDMETHODCALLTYPE d3d12_command_list_SetComputeRootSignature(ID3D12GraphicsCommandList1 *iface, diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index 9dc5cffa..a321fa47 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -600,12 +600,16 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo unsigned int i, j, k, range_count; uint32_t vk_binding; + root_signature->descriptor_table_mask = 0; + for (i = 0; i < desc->NumParameters; ++i) { const D3D12_ROOT_PARAMETER *p = &desc->pParameters[i]; if (p->ParameterType != D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE) continue; + root_signature->descriptor_table_mask |= 1ull << i; + table = &root_signature->parameters[i].u.descriptor_table; range_count = p->u.DescriptorTable.NumDescriptorRanges; @@ -666,6 +670,8 @@ static HRESULT d3d12_root_signature_init_root_descriptors(struct d3d12_root_sign VkDescriptorSetLayoutBinding *cur_binding = context->current_binding; unsigned int i; + root_signature->push_descriptor_mask = 0; + for (i = 0; i < desc->NumParameters; ++i) { const D3D12_ROOT_PARAMETER *p = &desc->pParameters[i]; @@ -674,6 +680,8 @@ static HRESULT d3d12_root_signature_init_root_descriptors(struct d3d12_root_sign && p->ParameterType != D3D12_ROOT_PARAMETER_TYPE_UAV) continue; + root_signature->push_descriptor_mask |= 1u << i; + if (p->u.Descriptor.RegisterSpace) { FIXME("Unhandled register space %u for parameter %u.\n", p->u.Descriptor.RegisterSpace, i); diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 1cb40f28..2d62fdaa 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -678,6 +678,9 @@ struct d3d12_root_signature unsigned int parameter_count; uint32_t main_set; + uint64_t descriptor_table_mask; + uint32_t push_descriptor_mask; + D3D12_ROOT_SIGNATURE_FLAGS flags; unsigned int descriptor_count;