Skip to content

hchiam/learning-webgpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learning WebGPU

Just one of the things I'm learning. https://github.com/hchiam/learning

(Compare with the older WebGL: https://github.com/hchiam/learning-webgl)

To enable WebGPU in Chrome now: chrome://flags/#enable-webgpu-developer-features

https://caniuse.com/webgpu

https://codelabs.developers.google.com/your-first-webgpu-app#0

https://glitch.com/edit/#!/your-first-webgpu-app

https://your-first-webgpu-app.glitch.me/

WebGPU Shading Language (WGSL): https://gpuweb.github.io/gpuweb/wgsl/

gpu --> adapter --> device --> canvas format and context config --> encoder --> ...

const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
const canvasFormat = navigator.gpu?.getPreferredCanvasFormat();
canvas.getContext("...").configure({
  device: device,
  format: canvasFormat,
});
const encoder = device?.createCommandEncoder();
// encoder.beginRenderPass
// context.getCurrentTexture
// ... see index.html

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages