2021-08-25 01:26:22 +00:00
|
|
|
// Tests that the index, buffer, and texture bounds checks policies are
|
|
|
|
// implemented separately.
|
|
|
|
|
|
|
|
// Storage and Uniform storage classes
|
|
|
|
struct InStorage {
|
2022-03-12 21:48:10 +00:00
|
|
|
a: array<vec4<f32>, 10>
|
2022-03-27 05:35:08 +00:00
|
|
|
}
|
2022-01-19 15:33:06 +00:00
|
|
|
@group(0) @binding(0) var<storage> in_storage: InStorage;
|
2021-08-25 01:26:22 +00:00
|
|
|
|
|
|
|
struct InUniform {
|
2022-03-12 21:48:10 +00:00
|
|
|
a: array<vec4<f32>, 20>
|
2022-03-27 05:35:08 +00:00
|
|
|
}
|
2022-01-19 15:33:06 +00:00
|
|
|
@group(0) @binding(1) var<uniform> in_uniform: InUniform;
|
2021-08-25 01:26:22 +00:00
|
|
|
|
|
|
|
// Textures automatically land in the `handle` storage class.
|
2022-01-19 15:33:06 +00:00
|
|
|
@group(0) @binding(2) var image_2d_array: texture_2d_array<f32>;
|
2021-08-25 01:26:22 +00:00
|
|
|
|
|
|
|
// None of the above.
|
|
|
|
var<workgroup> in_workgroup: array<f32, 30>;
|
|
|
|
var<private> in_private: array<f32, 40>;
|
|
|
|
|
|
|
|
fn mock_function(c: vec2<i32>, i: i32, l: i32) -> vec4<f32> {
|
|
|
|
var in_function: array<vec4<f32>, 2> =
|
|
|
|
array<vec4<f32>, 2>(vec4<f32>(0.707, 0.0, 0.0, 1.0),
|
|
|
|
vec4<f32>(0.0, 0.707, 0.0, 1.0));
|
|
|
|
|
|
|
|
return (in_storage.a[i] +
|
|
|
|
in_uniform.a[i] +
|
|
|
|
textureLoad(image_2d_array, c, i, l) +
|
|
|
|
in_workgroup[i] +
|
|
|
|
in_private[i] +
|
|
|
|
in_function[i]);
|
|
|
|
}
|