mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-23 15:23:33 +00:00
0e3fbc8166
The original pointer access test used SPIR-V for its input because WGSL didn't have a working pointer indirection operator at the time. Now that it does, we can just write this test in WGSL directly. Fixes #1432.
17 lines
271 B
WebGPU Shading Language
17 lines
271 B
WebGPU Shading Language
fn f() {
|
|
var v: vec2<i32>;
|
|
let px = &v.x;
|
|
*px = 10;
|
|
}
|
|
|
|
[[block]]
|
|
struct DynamicArray {
|
|
array: array<u32>;
|
|
};
|
|
|
|
fn index_dynamic_array(p: ptr<workgroup, DynamicArray>, i: i32, v: u32) -> u32 {
|
|
let old = (*p).array[i];
|
|
(*p).array[i] = v;
|
|
return old;
|
|
}
|