diff options
author | Fredrik Höglund <[email protected]> | 2017-03-29 19:19:47 +0200 |
---|---|---|
committer | Fredrik Höglund <[email protected]> | 2017-04-07 00:54:46 +0200 |
commit | c1f8c83cb66b765f496b7f41259109d0d546bf5c (patch) | |
tree | 73877c23f42ba4890966bb85fbef9e1dfda4c599 /src/amd/vulkan/radv_cmd_buffer.c | |
parent | c6487bc48bb084ec3d4a3c331239d690dfc94436 (diff) |
radv: implement VK_KHR_descriptor_update_template
All offsets and strides are precomputed by
radv_CreateDescriptorUpdateTemplateKHR and stored in the template.
v2: Move the new struct declarations from radv_descriptor_set.h
to radv_private.h (Bas)
Signed-off-by: Fredrik Höglund <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_cmd_buffer.c')
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 46c139a8fcb..992dc123a21 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -1988,6 +1988,30 @@ void radv_CmdPushDescriptorSetKHR( cmd_buffer->state.push_descriptors_dirty = true; } +void radv_CmdPushDescriptorSetWithTemplateKHR( + VkCommandBuffer commandBuffer, + VkDescriptorUpdateTemplateKHR descriptorUpdateTemplate, + VkPipelineLayout _layout, + uint32_t set, + const void* pData) +{ + RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer); + RADV_FROM_HANDLE(radv_pipeline_layout, layout, _layout); + struct radv_descriptor_set *push_set = &cmd_buffer->push_descriptors.set; + + assert(layout->set[set].layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR); + + if (!radv_init_push_descriptor_set(cmd_buffer, push_set, layout->set[set].layout)) + return; + + radv_update_descriptor_set_with_template(cmd_buffer->device, cmd_buffer, push_set, + descriptorUpdateTemplate, pData); + + cmd_buffer->state.descriptors[set] = push_set; + cmd_buffer->state.descriptors_dirty |= (1 << set); + cmd_buffer->state.push_descriptors_dirty = true; +} + void radv_CmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, |