glslang/Test/spv.subgroupExtendedTypesRotateNeg.comp
Sven van Haastregt b1f7affe94 Add GL_KHR_shader_subgroup_rotate support
Co-authored-by: Neil Hickey <neil.hickey@arm.com>
Co-authored-by: Stuart Brady <stuart.brady@arm.com>
Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
2024-02-06 11:04:16 -08:00

101 lines
4.6 KiB
Plaintext

#version 450
#extension GL_KHR_shader_subgroup_rotate: enable
#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable
#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable
#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable
#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable
layout (local_size_x = 8) in;
readonly buffer roblock
{
uint delta;
} ro;
layout(binding = 0) buffer Buffers
{
i8vec4 i8;
u8vec4 u8;
i16vec4 i16;
u16vec4 u16;
i64vec4 i64;
u64vec4 u64;
f16vec4 f16;
} data[4];
void main()
{
uint delta = ro.delta;
data[delta].i8.x = subgroupRotate(data[0].i8.x, delta);
data[delta].i8.xy = subgroupRotate(data[1].i8.xy, delta);
data[delta].i8.xyz = subgroupRotate(data[2].i8.xyz, delta);
data[delta].i8 = subgroupRotate(data[3].i8, delta);
data[delta].i8.x = subgroupClusteredRotate(data[0].i8.x, delta, 1);
data[delta].i8.xy = subgroupClusteredRotate(data[1].i8.xy, delta, 1);
data[delta].i8.xyz = subgroupClusteredRotate(data[2].i8.xyz, delta, 1);
data[delta].i8 = subgroupClusteredRotate(data[3].i8, delta, 1);
data[delta].u8.x = subgroupRotate(data[0].u8.x, delta);
data[delta].u8.xy = subgroupRotate(data[1].u8.xy, delta);
data[delta].u8.xyz = subgroupRotate(data[2].u8.xyz, delta);
data[delta].u8 = subgroupRotate(data[3].u8, delta);
data[delta].u8.x = subgroupClusteredRotate(data[0].u8.x, delta, 1);
data[delta].u8.xy = subgroupClusteredRotate(data[1].u8.xy, delta, 1);
data[delta].u8.xyz = subgroupClusteredRotate(data[2].u8.xyz, delta, 1);
data[delta].u8 = subgroupClusteredRotate(data[3].u8, delta, 1);
data[delta].i16.x = subgroupRotate(data[0].i16.x, delta);
data[delta].i16.xy = subgroupRotate(data[1].i16.xy, delta);
data[delta].i16.xyz = subgroupRotate(data[2].i16.xyz, delta);
data[delta].i16 = subgroupRotate(data[3].i16, delta);
data[delta].i16.x = subgroupClusteredRotate(data[0].i16.x, delta, 1);
data[delta].i16.xy = subgroupClusteredRotate(data[1].i16.xy, delta, 1);
data[delta].i16.xyz = subgroupClusteredRotate(data[2].i16.xyz, delta, 1);
data[delta].i16 = subgroupClusteredRotate(data[3].i16, delta, 1);
data[delta].u16.x = subgroupRotate(data[0].u16.x, delta);
data[delta].u16.xy = subgroupRotate(data[1].u16.xy, delta);
data[delta].u16.xyz = subgroupRotate(data[2].u16.xyz, delta);
data[delta].u16 = subgroupRotate(data[3].u16, delta);
data[delta].u16.x = subgroupClusteredRotate(data[0].u16.x, delta, 1);
data[delta].u16.xy = subgroupClusteredRotate(data[1].u16.xy, delta, 1);
data[delta].u16.xyz = subgroupClusteredRotate(data[2].u16.xyz, delta, 1);
data[delta].u16 = subgroupClusteredRotate(data[3].u16, delta, 1);
data[delta].i64.x = subgroupRotate(data[0].i64.x, delta);
data[delta].i64.xy = subgroupRotate(data[1].i64.xy, delta);
data[delta].i64.xyz = subgroupRotate(data[2].i64.xyz, delta);
data[delta].i64 = subgroupRotate(data[3].i64, delta);
data[delta].i64.x = subgroupClusteredRotate(data[0].i64.x, delta, 1);
data[delta].i64.xy = subgroupClusteredRotate(data[1].i64.xy, delta, 1);
data[delta].i64.xyz = subgroupClusteredRotate(data[2].i64.xyz, delta, 1);
data[delta].i64 = subgroupClusteredRotate(data[3].i64, delta, 1);
data[delta].u64.x = subgroupRotate(data[0].u64.x, delta);
data[delta].u64.xy = subgroupRotate(data[1].u64.xy, delta);
data[delta].u64.xyz = subgroupRotate(data[2].u64.xyz, delta);
data[delta].u64 = subgroupRotate(data[3].u64, delta);
data[delta].u64.x = subgroupClusteredRotate(data[0].u64.x, delta, 1);
data[delta].u64.xy = subgroupClusteredRotate(data[1].u64.xy, delta, 1);
data[delta].u64.xyz = subgroupClusteredRotate(data[2].u64.xyz, delta, 1);
data[delta].u64 = subgroupClusteredRotate(data[3].u64, delta, 1);
data[delta].f16.x = subgroupRotate(data[0].f16.x, delta);
data[delta].f16.xy = subgroupRotate(data[1].f16.xy, delta);
data[delta].f16.xyz = subgroupRotate(data[2].f16.xyz, delta);
data[delta].f16 = subgroupRotate(data[3].f16, delta);
data[delta].f16.x = subgroupClusteredRotate(data[0].f16.x, delta, 1);
data[delta].f16.xy = subgroupClusteredRotate(data[1].f16.xy, delta, 1);
data[delta].f16.xyz = subgroupClusteredRotate(data[2].f16.xyz, delta, 1);
data[delta].f16 = subgroupClusteredRotate(data[3].f16, delta, 1);
}