SPIRV-Cross/shaders-msl/comp/threadgroup-boolean-workaround.comp
Hans-Kristian Arntzen edf247fb1c MSL: Workaround compiler crashes when using threadgroup bool.
Promote to short instead and do simple casts on load/store instead.

Not 100% complete fix since structs can contain booleans, but this is
getting into pretty ridiculously complicated territory.
2021-10-25 10:55:11 +02:00

22 lines
372 B
Plaintext

#version 450
layout(local_size_x = 4) in;
shared bvec4 foo[4];
layout(binding = 0) buffer SSBO
{
vec4 values[];
};
void in_function()
{
foo[gl_LocalInvocationIndex] = notEqual(values[gl_GlobalInvocationID.x], vec4(10.0));
barrier();
values[gl_GlobalInvocationID.x] = mix(vec4(40.0), vec4(30.0), foo[gl_LocalInvocationIndex ^ 3]);
}
void main()
{
in_function();
}