From dc48313d7001bd6e6b51f87555b871c4fca32663 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Fri, 6 May 2022 10:56:49 +0200 Subject: [PATCH] v3dv: implement vkGetPipelineExecutablePropertiesKHR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/vulkan/v3dv_pipeline.c | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index f727fb20cb8..8ef618431ee 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -3604,3 +3604,38 @@ v3dv_GetPipelineExecutableInternalRepresentationsKHR( return incomplete ? VK_INCOMPLETE : vk_outarray_status(&out); } + +VKAPI_ATTR VkResult VKAPI_CALL +v3dv_GetPipelineExecutablePropertiesKHR( + VkDevice device, + const VkPipelineInfoKHR *pPipelineInfo, + uint32_t *pExecutableCount, + VkPipelineExecutablePropertiesKHR *pProperties) +{ + V3DV_FROM_HANDLE(v3dv_pipeline, pipeline, pPipelineInfo->pipeline); + + pipeline_collect_executable_data(pipeline); + + VK_OUTARRAY_MAKE_TYPED(VkPipelineExecutablePropertiesKHR, out, + pProperties, pExecutableCount); + + util_dynarray_foreach(&pipeline->executables.data, + struct v3dv_pipeline_executable_data, exe) { + vk_outarray_append_typed(VkPipelineExecutablePropertiesKHR, &out, props) { + gl_shader_stage mesa_stage = broadcom_shader_stage_to_gl(exe->stage); + props->stages = mesa_to_vk_shader_stage(mesa_stage); + + WRITE_STR(props->name, "%s (%s)", + _mesa_shader_stage_to_abbrev(mesa_stage), + broadcom_shader_stage_is_binning(exe->stage) ? + "Binning" : "Render"); + + WRITE_STR(props->description, "%s", + _mesa_shader_stage_to_string(mesa_stage)); + + props->subgroupSize = V3D_CHANNELS; + } + } + + return vk_outarray_status(&out); +}