fa5b206d97
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.
26 lines
305 B
Plaintext
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;
|
|
}
|