libs/vkd3d: Create push descriptor set only if needed.

This commit is contained in:
Józef Kucia 2017-08-18 17:08:56 +02:00
parent b3d2b36afb
commit 92bb7969a5
3 changed files with 4 additions and 5 deletions

View File

@ -1638,17 +1638,14 @@ static void d3d12_command_list_update_descriptors(struct d3d12_command_list *lis
{
struct vkd3d_pipeline_bindings *bindings = &list->pipeline_bindings[bind_point];
const struct vkd3d_vk_device_procs *vk_procs = &list->device->vk_procs;
const struct vkd3d_vulkan_info *vk_info = &list->device->vk_info;
struct d3d12_root_signature *rs = bindings->root_signature;
uint32_t set;
if (!rs || !rs->pool_size_count || !rs->vk_set_layout)
return;
bindings->in_use = true;
set = vk_info->KHR_push_descriptor ? 1 : 0;
VK_CALL(vkCmdBindDescriptorSets(list->vk_command_buffer, bind_point,
rs->vk_pipeline_layout, set, 1, &bindings->descriptor_set, 0, NULL));
rs->vk_pipeline_layout, rs->main_set, 1, &bindings->descriptor_set, 0, NULL));
}
static bool d3d12_command_list_begin_render_pass(struct d3d12_command_list *list,

View File

@ -881,7 +881,7 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
goto fail;
/* We use KHR_push_descriptor for root descriptor parameters. */
if (vk_info->KHR_push_descriptor)
if (vk_info->KHR_push_descriptor && context.descriptor_binding)
{
set_desc[context.set_index].sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
set_desc[context.set_index].pNext = NULL;
@ -910,6 +910,7 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
if (FAILED(hr = d3d12_root_signature_init_static_samplers(root_signature, device, desc, &context)))
goto fail;
root_signature->main_set = context.set_index;
if (context.descriptor_binding)
{
set_desc[context.set_index].sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;

View File

@ -315,6 +315,7 @@ struct d3d12_root_signature
struct d3d12_root_parameter *parameters;
unsigned int parameter_count;
uint32_t main_set;
unsigned int descriptor_count;
struct vkd3d_shader_resource_binding *descriptor_mapping;