mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-08 11:30:06 +00:00
b1f7affe94
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>
63 lines
2.6 KiB
Plaintext
63 lines
2.6 KiB
Plaintext
#version 320 es
|
|
|
|
#extension GL_KHR_shader_subgroup_rotate: enable
|
|
|
|
layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
|
|
|
|
readonly buffer roblock
|
|
{
|
|
uint delta;
|
|
} ro;
|
|
|
|
layout(binding = 0) buffer Buffers
|
|
{
|
|
vec4 f4;
|
|
ivec4 i4;
|
|
uvec4 u4;
|
|
} data[4];
|
|
|
|
void main()
|
|
{
|
|
uint delta = ro.delta;
|
|
|
|
data[0].f4.x = subgroupRotate(data[0].f4.x, delta);
|
|
data[0].f4.xy = subgroupRotate(data[1].f4.xy, delta);
|
|
data[0].f4.xyz = subgroupRotate(data[2].f4.xyz, delta);
|
|
data[0].f4 = subgroupRotate(data[3].f4, delta);
|
|
|
|
data[0].i4.x = subgroupRotate(data[0].i4.x, delta);
|
|
data[0].i4.xy = subgroupRotate(data[1].i4.xy, delta);
|
|
data[0].i4.xyz = subgroupRotate(data[2].i4.xyz, delta);
|
|
data[0].i4 = subgroupRotate(data[3].i4, delta);
|
|
|
|
data[1].u4.x = subgroupRotate(data[0].u4.x, delta);
|
|
data[1].u4.xy = subgroupRotate(data[1].u4.xy, delta);
|
|
data[1].u4.xyz = subgroupRotate(data[2].u4.xyz, delta);
|
|
data[1].u4 = subgroupRotate(data[3].u4, delta);
|
|
|
|
data[1].i4.x = int(subgroupRotate(data[0].i4.x < 0, delta));
|
|
data[1].i4.xy = ivec2(subgroupRotate(lessThan(data[1].i4.xy, ivec2(0)), delta));
|
|
data[1].i4.xyz = ivec3(subgroupRotate(lessThan(data[1].i4.xyz, ivec3(0)), delta));
|
|
data[1].i4 = ivec4(subgroupRotate(lessThan(data[1].i4, ivec4(0)), delta));
|
|
|
|
data[2].f4.x = subgroupClusteredRotate(data[0].f4.x, delta, 1u);
|
|
data[2].f4.xy = subgroupClusteredRotate(data[1].f4.xy, delta, 1u);
|
|
data[2].f4.xyz = subgroupClusteredRotate(data[2].f4.xyz, delta, 1u);
|
|
data[2].f4 = subgroupClusteredRotate(data[3].f4, delta, 1u);
|
|
|
|
data[2].i4.x = subgroupClusteredRotate(data[0].i4.x, delta, 1u);
|
|
data[2].i4.xy = subgroupClusteredRotate(data[1].i4.xy, delta, 1u);
|
|
data[2].i4.xyz = subgroupClusteredRotate(data[2].i4.xyz, delta, 1u);
|
|
data[2].i4 = subgroupClusteredRotate(data[3].i4, delta, 1u);
|
|
|
|
data[3].u4.x = subgroupClusteredRotate(data[0].u4.x, delta, 1u);
|
|
data[3].u4.xy = subgroupClusteredRotate(data[1].u4.xy, delta, 1u);
|
|
data[3].u4.xyz = subgroupClusteredRotate(data[2].u4.xyz, delta, 1u);
|
|
data[3].u4 = subgroupClusteredRotate(data[3].u4, delta, 1u);
|
|
|
|
data[3].i4.x = int(subgroupClusteredRotate(data[0].i4.x < 0, delta, 1u));
|
|
data[3].i4.xy = ivec2(subgroupClusteredRotate(lessThan(data[1].i4.xy, ivec2(0)), delta, 1u));
|
|
data[3].i4.xyz = ivec3(subgroupClusteredRotate(lessThan(data[1].i4.xyz, ivec3(0)), delta, 1u));
|
|
data[3].i4 = ivec4(subgroupClusteredRotate(lessThan(data[1].i4, ivec4(0)), delta, 1u));
|
|
}
|