From 1c87c79893e8ec74e260fc6815f2e968ea0631d0 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 4 Sep 2025 10:35:37 +0200 Subject: [PATCH] llvmpipe: advertise support for subgroups in all stages Works on CL and also in use by lavapipe. However it needs the shader_subgroup_size cap to be set to be actually advertized in OpenGL. Also support subgroup rotate while at it. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_nir.c | 1 + src/gallium/drivers/llvmpipe/lp_screen.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_nir.c b/src/gallium/auxiliary/gallivm/lp_bld_nir.c index 7c4658ff2bb..d0437bac32e 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_nir.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_nir.c @@ -77,6 +77,7 @@ lp_build_opt_nir(struct nir_shader *nir) .lower_subgroup_masks = true, .lower_relative_shuffle = true, .lower_inverse_ballot = true, + .lower_rotate_to_shuffle = true, }; NIR_PASS(progress, nir, nir_lower_subgroups, &subgroups_options); } while (progress); diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index aaf9308dbe7..8b6ab50db00 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -391,6 +391,9 @@ llvmpipe_init_screen_caps(struct pipe_screen *screen) caps->max_point_size_aa = LP_MAX_POINT_WIDTH; /* arbitrary */ caps->max_texture_anisotropy = 16.0; /* not actually signficant at this time */ caps->max_texture_lod_bias = 16.0; /* arbitrary */ + + caps->shader_subgroup_supported_stages = BITFIELD_MASK(MESA_SHADER_MESH_STAGES); + caps->shader_subgroup_supported_features = PIPE_SHADER_SUBGROUP_FEATURE_MASK; }