wgpu-compute-toy icon indicating copy to clipboard operation
wgpu-compute-toy copied to clipboard

Add optional extensions

Open munrocket opened this issue 1 year ago • 3 comments

How to use extensions:

enable chromium_experimental_subgroups;
#define PI 3.14

@compute @workgroup_size(256)
#workgroup_count main 256 1 1
fn main(
  @builtin(global_invocation_id) global_id : vec3u,
  @builtin(subgroup_size) sg_size : u32,
  @builtin(subgroup_invocation_id) sg_id : u32
) {
      // TODO: Use subgroupBallot() and subgroupBroadcast()
}

The problem that wgpu not supporting chromium extension yet, but maybe we create device with web_sys?

Also it seems some errors introduced to wasm build after 79ad98d commit, @stefnotch can you please fix it? It is visible only with compute.toy website.

munrocket avatar May 09 '24 21:05 munrocket

@munrocket Sure, how do I best locally reproduce the errors?

stefnotch avatar May 10 '24 04:05 stefnotch

@stefnotch you can replace wgpu-compute-toy folder in compute.toys than git checkout <some_hash> in this folder, yarn install & yarn dev

munrocket avatar May 10 '24 09:05 munrocket

Btw #23 also opened error in web with timestamps that was fixed here in de75501 by commenting it. So we should merge this PR for fixing web too. Timestamps need more general solution, I hope someday we will find it.

munrocket avatar May 10 '24 09:05 munrocket

Thanks, I merged it manually with some minor changes, and also fixed wasm panicking over undefined canvas

davidar avatar May 19 '24 08:05 davidar