From a8449171d389634f6dca9e807abd322c5834f107 Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Mon, 30 Jun 2025 11:37:11 -0700 Subject: [PATCH] iris: Enable GL_KHR_shader_subgroup_* extensions for Gfx >= 9 when possible For platforms that don't have native float64 support, skip the arithmetic and clustered ops. While they would work, the lowering for float64 for those increase significantly the shader for some of those operations. Reviewed-by: Kenneth Graunke Reviewed-by: Ian Romanick Part-of: --- docs/features.txt | 2 +- src/gallium/drivers/iris/iris_screen.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/features.txt b/docs/features.txt index b40b3c15b02..1a6605afed3 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -344,7 +344,7 @@ Khronos, ARB, and OES extensions that are not part of any OpenGL or OpenGL ES ve GL_EXT_texture_view DONE (all drivers that support GL_OES_texture_view) GL_KHR_blend_equation_advanced_coherent DONE (freedreno/a6xx, llvmpipe, panfrost, zink, asahi, iris/gen9+, v3d) GL_KHR_robust_buffer_access_behavior DONE (panfrost, llvmpipe, virgl) - GL_KHR_shader_subgroup DONE (radeonsi, zink, asahi) + GL_KHR_shader_subgroup DONE (radeonsi, zink, asahi, iris/gen9+) GL_KHR_texture_compression_astc_hdr DONE (panfrost, asahi) GL_KHR_texture_compression_astc_sliced_3d DONE (freedreno/a4xx+, r600, radeonsi, panfrost, softpipe, llvmpipe, v3d, virgl, zink, lima, asahi, iris/gen9+) GL_OES_depth_texture_cube_map DONE (all drivers that support GLSL 1.30+) diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index 89b5a1fcf04..4ec026dea6f 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -499,6 +499,20 @@ iris_init_screen_caps(struct iris_screen *screen) * shift it right by one, so the highest valid address bit gets unset. */ caps->max_vma = intel_48b_address(UINT64_MAX) >> 1; + + if (devinfo->ver >= 9) { + caps->shader_subgroup_size = 32; + caps->shader_subgroup_supported_stages = BITFIELD_MASK(MESA_SHADER_STAGES); + caps->shader_subgroup_supported_features = + devinfo->has_64bit_float ? BITFIELD_MASK(PIPE_SHADER_SUBGROUP_NUM_FEATURES) + : (PIPE_SHADER_SUBGROUP_FEATURE_BASIC | + PIPE_SHADER_SUBGROUP_FEATURE_VOTE | + PIPE_SHADER_SUBGROUP_FEATURE_BALLOT | + PIPE_SHADER_SUBGROUP_FEATURE_SHUFFLE | + PIPE_SHADER_SUBGROUP_FEATURE_SHUFFLE_RELATIVE | + PIPE_SHADER_SUBGROUP_FEATURE_QUAD); + caps->shader_subgroup_quad_all_stages = true; + } } static uint64_t