SPIRV-Cross/shaders-msl-no-opt/packing/isolated-scalar-access.comp
Hans-Kristian Arntzen fa5b206d97 MSL: Workaround broken vector -> scalar access chain in MSL.
On MSL, the compiler refuses to allow access chains into a normal vector type.
What happens in practice instead is a read-modify-write where a vector type is
loaded, modified and written back.

The workaround is to convert a vector into a pointer-to-scalar before
the access chain continues to add the scalar index.
2020-07-06 10:03:44 +02:00

26 lines
305 B
Plaintext

#version 450
layout(set = 0, binding = 0) buffer SSBO
{
vec4 v;
mat4 cm;
layout(row_major) mat4 rm;
vec3 v3;
float f;
};
shared vec4 shared_vec4;
shared vec3 shared_vec3;
void main()
{
v.x = 10.0;
v3.y = 40.0;
cm[1][2] = 20.0;
rm[3][1] = 30.0;
shared_vec4.z = 40.0;
shared_vec3.y = 1.0;
}