Module: Mesa Branch: main Commit: dc48313d7001bd6e6b51f87555b871c4fca32663 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dc48313d7001bd6e6b51f87555b871c4fca32663
Author: Iago Toral Quiroga <[email protected]> Date: Fri May 6 10:56:49 2022 +0200 v3dv: implement vkGetPipelineExecutablePropertiesKHR Reviewed-by: Alejandro PiƱeiro <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16370> --- 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); +}
