From 35c40c64c8fb9808590fa83c89425839594fa821 Mon Sep 17 00:00:00 2001 From: Rajnesh Kanwal Date: Thu, 22 Sep 2022 15:39:32 +0100 Subject: [PATCH] pvr: Handle indirect buffer address in pvr_setup_descriptor_mappings. Signed-off-by: Rajnesh Kanwal Reviewed-by: Karmjit Mahil Part-of: --- src/imagination/vulkan/pvr_cmd_buffer.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/imagination/vulkan/pvr_cmd_buffer.c b/src/imagination/vulkan/pvr_cmd_buffer.c index 07cd326..e163fbc 100644 --- a/src/imagination/vulkan/pvr_cmd_buffer.c +++ b/src/imagination/vulkan/pvr_cmd_buffer.c @@ -2868,7 +2868,7 @@ static VkResult pvr_setup_descriptor_mappings( struct pvr_cmd_buffer *const cmd_buffer, enum pvr_stage_allocation stage, const struct pvr_stage_allocation_descriptor_state *descriptor_state, - UNUSED const pvr_dev_addr_t *const num_worgroups_buff_addr, + const pvr_dev_addr_t *const num_worgroups_buff_addr, uint32_t *const descriptor_data_offset_out) { const struct pvr_pds_info *const pds_info = &descriptor_state->pds_info; @@ -2879,8 +2879,6 @@ static VkResult pvr_setup_descriptor_mappings( struct pvr_bo *pvr_bo; VkResult result; - pvr_finishme("Handle num_worgroups_buff_addr"); - if (!pds_info->data_size_in_dwords) return VK_SUCCESS; @@ -3061,6 +3059,22 @@ static VkResult pvr_setup_descriptor_mappings( break; } + case PVR_BUFFER_TYPE_BLEND_CONSTS: + if (stage == PVR_STAGE_ALLOCATION_COMPUTE) { + assert(num_worgroups_buff_addr->addr); + + /* TODO: Check if we need to offset this (e.g. for just y and z), + * or cope with any reordering? + */ + PVR_WRITE(qword_buffer, + num_worgroups_buff_addr->addr, + special_buff_entry->const_offset, + pds_info->data_size_in_dwords); + } else { + pvr_finishme("Add blend constants support."); + } + break; + default: unreachable("Unsupported special buffer type."); } -- 2.7.4