-
Notifications
You must be signed in to change notification settings - Fork 345
Open
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues
Milestone
Description
Proposal currently limits reinterpretation to always from the base variable and only once.
Would more extensive reinterpretation be better? This seems it would imply taking any pointer type and reinterpreting it. That would mean implementations would have to track through more expressions. For example:
var<storage, read_write> buf : buffer;
struct T {
u : vec4,
v : vec2i,
}
struct S {
a : array<T, 4>,
b : f32
}
fn foo() {
let p1 : ptr<storage, S, read_write> = bufferView<S>(&buf, offset1);
let p2 : ptr<storage, f32, read_write> = &(p1.a[2].u[1]);
let p3 : ptr<storage, vec4u, read_write> = bufferView<vec4u>(p2, offset2); // real potential for unaligned memory access
}
The current restrictions avoid some footguns like unaligned memory access.
Metadata
Metadata
Assignees
Labels
wgslWebGPU Shading Language IssuesWebGPU Shading Language Issues