Published
Edited
Feb 11, 2020
1 star
Insert cell
Insert cell
Insert cell
Insert cell
md`
- Dogfood🐾: WebGPU is available for now in Chrome 78 for macOS behind an experimental flag. You can enable it at chrome://flags/#enable-unsafe-webgpu.

- Should use this version to get visit on navigator.gpu [Google Chrome Canary]https://github.com/yyc-git/MyData/blob/master/3d/googlechrome(canary).dmg

- [WebGPU Official Doc](https://gpuweb.github.io/gpuweb/#enumdef-gpubindingtype) link will guide you know about GPUBindingType, explain why we use storage-buffer instead of readonly-storage-buffer although doc says the two both fine to use but actually readonly-storage-buffer not work.`
Insert cell
Insert cell
Insert cell
runBasicSample = () => {
const gpu = new GPU.GPU({ mode: 'gpu' });
const render = gpu.createKernel(
function(frame) {
const pixel = frame[this.thread.y][this.thread.x];
this.color(pixel.b, pixel.g, pixel.r, pixel.a);
},
{
output: [337, 599],
graphical: true
}
);

return render;
}
Insert cell
{
const render = runBasicSample();

while (true) {
render(video);
yield render.getCanvas();
}
}
Insert cell
Insert cell
GPU = require('gpu.js@latest/dist/gpu-browser.min.js')
Insert cell
md`## Bonus
[Feature Extraction](https://en.wikipedia.org/wiki/Feature_extraction)`
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more