Skip to content

Commit e5e17d8

Browse files
petermcneeleychromiumPeter McNeeley
andauthored
Pipeline error for out of bounds array with dynamic and offset (#4384)
* Pipeline error for out of bounds array with dynamic and offset * change 'tested' to 'type_checked' --------- Co-authored-by: Peter McNeeley <petermcneeley@google.com>
1 parent f42b4e6 commit e5e17d8

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

src/webgpu/shader/validation/expression/access/array.spec.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,45 @@ const kOutOfBoundsCases: Record<string, OutOfBoundsCase> = {
378378
pipeline: true,
379379
value: 1,
380380
},
381+
override_array_dynamic_type_checked_oob_pos: {
382+
code: `@group(0) @binding(0) var<storage> v : array<array<array<u32, 3>, 4>, 5>;
383+
override x : i32;
384+
override w = 0u;
385+
fn y() -> u32 {
386+
var u = 0;
387+
let tmp = v[w][u][x];
388+
return 0;
389+
}`,
390+
result: false,
391+
pipeline: true,
392+
value: 3,
393+
},
394+
override_array_dynamic_type_checked_oob_neg: {
395+
code: `@group(0) @binding(0) var<storage> v : array<array<array<u32, 3>, 4>, 5>;
396+
override x : i32;
397+
override w = 0u;
398+
fn y() -> u32 {
399+
var u = 0;
400+
let tmp = v[w][u][x];
401+
return 0;
402+
}`,
403+
result: false,
404+
pipeline: true,
405+
value: -1,
406+
},
407+
override_array_dynamic_type_checked_bounds: {
408+
code: `@group(0) @binding(0) var<storage> v : array<array<array<u32, 3>, 4>, 5>;
409+
override x : i32;
410+
override w = 0u;
411+
fn y() -> u32 {
412+
var u = 0;
413+
let tmp = v[w][u][x];
414+
return 0;
415+
}`,
416+
result: true,
417+
pipeline: true,
418+
value: 1,
419+
},
381420
};
382421

383422
g.test('early_eval_errors')

0 commit comments

Comments
 (0)