From c6dc2df9e53e9ac818a0495c64979fd8627ef9a9 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 8 Apr 2026 23:54:27 +0300 Subject: [PATCH] vulkan: add pipeline helper to retrieve scratch-size/ray-queries Signed-off-by: Lionel Landwerlin Reviewed-by: Alyssa Rosenzweig Part-of: --- src/vulkan/runtime/vk_pipeline.c | 14 ++++++++++++++ src/vulkan/runtime/vk_pipeline.h | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/src/vulkan/runtime/vk_pipeline.c b/src/vulkan/runtime/vk_pipeline.c index d29043bf014..c60edb7c535 100644 --- a/src/vulkan/runtime/vk_pipeline.c +++ b/src/vulkan/runtime/vk_pipeline.c @@ -2726,6 +2726,20 @@ struct vk_rt_pipeline { uint8_t dynamic_descriptor_offsets[MESA_VK_MAX_DESCRIPTOR_SETS]; }; +uint32_t +vk_pipeline_get_rt_scratch_size(struct vk_pipeline *pipeline) +{ + assert(pipeline->bind_point == VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR); + return container_of(pipeline, struct vk_rt_pipeline, base)->scratch_size; +} + +uint32_t +vk_pipeline_get_rt_ray_queries(struct vk_pipeline *pipeline) +{ + assert(pipeline->bind_point == VK_PIPELINE_BIND_POINT_RAY_TRACING_KHR); + return container_of(pipeline, struct vk_rt_pipeline, base)->ray_queries; +} + static struct vk_rt_stage vk_rt_stage_ref(struct vk_rt_stage *stage) { diff --git a/src/vulkan/runtime/vk_pipeline.h b/src/vulkan/runtime/vk_pipeline.h index 776b72a6074..3c7cafd74de 100644 --- a/src/vulkan/runtime/vk_pipeline.h +++ b/src/vulkan/runtime/vk_pipeline.h @@ -230,6 +230,12 @@ void vk_cmd_unbind_pipelines_for_stages(struct vk_command_buffer *cmd_buffer, VkShaderStageFlags stages); +uint32_t +vk_pipeline_get_rt_scratch_size(struct vk_pipeline *pipeline); + +uint32_t +vk_pipeline_get_rt_ray_queries(struct vk_pipeline *pipeline); + #ifdef __cplusplus } #endif