From 98d6edc6ad87e63bbac90e33869b98293c3250b1 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sat, 6 May 2023 21:04:18 +0200 Subject: [PATCH] gallium: add get_compute_state_subgroup_size This will be required by drivers supporting multiple subgroup sizes with a given CSO to properly implement OpenCL subgroups. Signed-off-by: Karol Herbst Reviewed-by: Alyssa Rosenzweig Part-of: --- docs/gallium/context.rst | 10 ++++++++++ src/gallium/include/pipe/p_context.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/docs/gallium/context.rst b/docs/gallium/context.rst index e88cdc99eb7..e30c9594acd 100644 --- a/docs/gallium/context.rst +++ b/docs/gallium/context.rst @@ -888,6 +888,16 @@ get_compute_state_info This function allows frontends to query kernel information defined inside ``pipe_compute_state_object_info``. +.. _get_compute_state_subgroup_size: + +get_compute_state_subgroup_size +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +This function returns the choosen subgroup size when `launch_grid` is +called with the given block size. This doesn't need to be implemented when +only one size is reported through ``PIPE_COMPUTE_CAP_SUBGROUP_SIZES`` or +``pipe_compute_state_object_info::simd_sizes``. + Mipmap generation ^^^^^^^^^^^^^^^^^ diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 590a00bda4b..8f93d94eaef 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -946,6 +946,9 @@ struct pipe_context { void (*get_compute_state_info)(struct pipe_context *, void *, struct pipe_compute_state_object_info *); + uint32_t (*get_compute_state_subgroup_size)(struct pipe_context *, void *, + const uint32_t block[3]); + /** * Bind an array of shader resources that will be used by the * compute program. Any resources that were previously bound to