Files
wgpu/tests/out/glsl/access.assign_through_ptr.Compute.glsl
T
Teodor Tanasoaia 9742f1616c fix zero initialization of workgroup memory (#2259)
Use the local (not global) invocation id to decide which invocation should do the initialization, so that every workgroup gets initialized, not just the first.
2023-02-20 19:56:24 -08:00

57 lines
958 B
GLSL

#version 310 es
precision highp float;
precision highp int;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
struct GlobalConst {
uint a;
uvec3 b;
int c;
};
struct AlignedWrapper {
int value;
};
struct Baz {
mat3x2 m;
};
struct MatCx2InArray {
mat4x2 am[2];
};
shared uint val;
float read_from_private(inout float foo_1) {
float _e1 = foo_1;
return _e1;
}
float test_arr_as_arg(float a[5][10]) {
return a[4][9];
}
void assign_through_ptr_fn(inout uint p) {
p = 42u;
return;
}
void assign_array_through_ptr_fn(inout vec4 foo_2[2]) {
foo_2 = vec4[2](vec4(1.0), vec4(2.0));
return;
}
void main() {
if (gl_LocalInvocationID == uvec3(0u)) {
val = 0u;
}
memoryBarrierShared();
barrier();
vec4 arr[2] = vec4[2](vec4(0.0), vec4(0.0));
arr = vec4[2](vec4(6.0), vec4(7.0));
assign_through_ptr_fn(val);
assign_array_through_ptr_fn(arr);
return;
}