vkd3d: Change USE_PUSH_DESCRIPTORS to USE_ROOT_DESCRIPTOR_SET for clarity.

USE_PUSH_DESCRIPTORS may be misleading since it would be set even when
we're not using push descriptors at all due to root descriptors being
passed in via VAs. Instead, make the flag represent whether or not we
use a regular descriptor set for root parameters.

Signed-off-by: Philip Rebohle <philip.rebohle@tu-dortmund.de>
This commit is contained in:
Philip Rebohle 2020-11-12 14:01:34 +01:00 committed by Hans-Kristian Arntzen
parent baf265c666
commit 3da44beb5d
3 changed files with 15 additions and 14 deletions

View File

@ -3319,7 +3319,7 @@ static void d3d12_command_list_update_root_descriptors(struct d3d12_command_list
unsigned int root_parameter_index, va_count;
unsigned int descriptor_write_count = 0;
if (!(root_signature->flags & VKD3D_ROOT_SIGNATURE_USE_PUSH_DESCRIPTORS))
if (root_signature->flags & VKD3D_ROOT_SIGNATURE_USE_ROOT_DESCRIPTOR_SET)
{
/* Ensure that we populate all descriptors if push descriptors cannot be used */
bindings->root_descriptor_dirty_mask |= bindings->root_descriptor_active_mask & root_signature->root_descriptor_mask;
@ -3369,13 +3369,7 @@ static void d3d12_command_list_update_root_descriptors(struct d3d12_command_list
if (!descriptor_write_count)
return;
if (root_signature->flags & VKD3D_ROOT_SIGNATURE_USE_PUSH_DESCRIPTORS)
{
VK_CALL(vkCmdPushDescriptorSetKHR(list->vk_command_buffer, bind_point,
root_signature->vk_pipeline_layout, root_signature->root_descriptor_set,
descriptor_write_count, descriptor_writes));
}
else
if (root_signature->flags & VKD3D_ROOT_SIGNATURE_USE_ROOT_DESCRIPTOR_SET)
{
VK_CALL(vkUpdateDescriptorSets(list->device->vk_device,
descriptor_write_count, descriptor_writes, 0, NULL));
@ -3383,6 +3377,12 @@ static void d3d12_command_list_update_root_descriptors(struct d3d12_command_list
root_signature->vk_pipeline_layout, root_signature->root_descriptor_set,
1, &descriptor_set, 0, NULL));
}
else
{
VK_CALL(vkCmdPushDescriptorSetKHR(list->vk_command_buffer, bind_point,
root_signature->vk_pipeline_layout, root_signature->root_descriptor_set,
descriptor_write_count, descriptor_writes));
}
}
static void d3d12_command_list_update_descriptors(struct d3d12_command_list *list,

View File

@ -715,8 +715,8 @@ static HRESULT d3d12_root_signature_init_root_descriptors(struct d3d12_root_sign
if (j)
{
vk_flags = root_signature->flags & VKD3D_ROOT_SIGNATURE_USE_PUSH_DESCRIPTORS
? VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR : 0;
vk_flags = root_signature->flags & VKD3D_ROOT_SIGNATURE_USE_ROOT_DESCRIPTOR_SET
? 0 : VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR;
hr = vkd3d_create_descriptor_set_layout(root_signature->device, vk_flags,
j, vk_binding_info, vk_set_layout);
@ -860,14 +860,15 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
if (root_signature->push_constant_range.size <= vk_device_properties->limits.maxPushConstantsSize)
{
if (info.push_descriptor_count <= device->device_info.push_descriptor_properties.maxPushDescriptors)
root_signature->flags |= VKD3D_ROOT_SIGNATURE_USE_PUSH_DESCRIPTORS;
if (info.push_descriptor_count > device->device_info.push_descriptor_properties.maxPushDescriptors)
root_signature->flags |= VKD3D_ROOT_SIGNATURE_USE_ROOT_DESCRIPTOR_SET;
}
else if (device->device_info.inline_uniform_block_features.inlineUniformBlock)
{
/* Stores push constant data with the root descriptor set,
* so we can't use push descriptors in this case. */
root_signature->flags |= VKD3D_ROOT_SIGNATURE_USE_INLINE_UNIFORM_BLOCK;
root_signature->flags |= VKD3D_ROOT_SIGNATURE_USE_INLINE_UNIFORM_BLOCK |
VKD3D_ROOT_SIGNATURE_USE_ROOT_DESCRIPTOR_SET;
}
else
{

View File

@ -795,7 +795,7 @@ static inline void d3d12_query_heap_mark_result_as_available(struct d3d12_query_
enum vkd3d_root_signature_flag
{
VKD3D_ROOT_SIGNATURE_USE_PUSH_DESCRIPTORS = 0x00000001u,
VKD3D_ROOT_SIGNATURE_USE_ROOT_DESCRIPTOR_SET = 0x00000001u,
VKD3D_ROOT_SIGNATURE_USE_INLINE_UNIFORM_BLOCK = 0x00000002u,
VKD3D_ROOT_SIGNATURE_USE_RAW_VA_UAV_COUNTERS = 0x00000004u,
VKD3D_ROOT_SIGNATURE_USE_SSBO_OFFSET_BUFFER = 0x00000008u,