gpuweb / cts

WebGPU Conformance Test Suite
https://gpuweb.github.io/cts/
BSD 3-Clause "New" or "Revised" License
130 stars 82 forks source link

wgsl: test unrestricted_pointer_parameters feature #3056

Closed dneto0 closed 6 months ago

dneto0 commented 1 year ago

https://github.com/gpuweb/gpuweb/pull/4312

Example code:

// enable chromium_experimental_full_ptr_parameters;  // needed for Chrome.

@group(0) @binding(0) var<storage,read_write> a: f32;
@group(0) @binding(0) var<storage> b: f32;

const count: u32 = 12;
var<workgroup> w: array<atomic<u32>,count>;

fn mutf(p: ptr<storage,f32>) -> f32 {
  return *p; 
}

fn getw(p: ptr<workgroup,atomic<u32>>) -> u32 {
  return atomicLoad(p);
}

@compute @workgroup_size(64)
fn main() {
  // _ = mutf(&a); // invalide due to read_write access mode
  _ = mutf(&b);
  let u: u32 = getw(&w[8]);
}
dneto0 commented 6 months ago

Is this done @ben-clayton ?

ben-clayton commented 6 months ago

Yup