From ed5940a629ae05e9571bfe355d22f0728347dcb4 Mon Sep 17 00:00:00 2001 From: Darren Wihandi <65404740+fairywreath@users.noreply.github.com> Date: Tue, 22 Apr 2025 14:04:56 -0600 Subject: Implement shader subgroup rotate intrinsics (#6878) * Initial implementation for SPIRV, GLSL and Metal * test add bool test * Fix and improve subgroup rotate tests * Add proper GLSL extensions and proper Metal type checking * Clean up tests and add diagnostics test for subgroup type for Metal * Update wave-intrinsics docs --- docs/wave-intrinsics.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'docs/wave-intrinsics.md') diff --git a/docs/wave-intrinsics.md b/docs/wave-intrinsics.md index aa46f72a1..7f6fb7b77 100644 --- a/docs/wave-intrinsics.md +++ b/docs/wave-intrinsics.md @@ -236,6 +236,20 @@ void GroupMemoryBarrierWithWaveSync(); Synchronizes all lanes to the same GroupMemoryBarrierWithWaveSync in program flow. Orders group shared memory accesses such that accesses after the barrier can be seen by writes before. +Wave Rotate Intrinsics +====================== + +These intrinsics are specific to Slang and were added to support the subgroup rotate functionalities provided by SPIRV (through the `GroupNonUniformRotateKHR` capability), GLSL (through the `GL_KHR_shader_subgroup_rotate +` extension), and Metal. + +``` +// Supported on SPIRV, GLSL, and Metal targets. +T WaveRotate(T value, uint delta); + +// Supported on SPIRV and GLSL targets. +T WaveClusteredRotate(T value, uint delta, constexpr uint clusterSize); +``` + Wave Mask Intrinsics ==================== -- cgit v1.2.3