Quick Reference
Chrome Flags
| Flag | Purpose |
|---|---|
chrome://flags/#enable-unsafe-webgpu | Enable WebGPU on unsupported platforms |
chrome://flags/#enable-webgpu-developer-features | Unlock dev-only features (timestamps, adapter info, strict math) |
chrome://flags/#enable-vulkan | Enable Vulkan backend on Linux |
chrome://flags/#ignore-gpu-blocklist | Override GPU hardware blocklist |
chrome://flags/#force-high-performance-gpu | Force discrete GPU on Windows laptops |
chrome://flags/#unsafely-treat-insecure-origin-as-secure | Test on HTTP origins |
Diagnostic URLs
| URL | What to Check |
|---|---|
chrome://gpu | WebGPU status, driver info, feature flags |
chrome://settings/system | "Use graphics acceleration when available" |
chrome://version | Chrome version number |
Dev Server Commands
bash
# Quick HTTP server for local testing
npx http-server
# Python alternative
python3 -m http.server
# HTTPS with fake cert (needed for some APIs)
npx servez --sslKey API Methods
javascript
// Adapter & Device
const adapter = await navigator.gpu.requestAdapter({ powerPreference: 'high-performance' });
const device = await adapter.requestDevice({ requiredLimits: { ... } });
// Canvas
const context = canvas.getContext('webgpu');
const format = navigator.gpu.getPreferredCanvasFormat();
context.configure({ device, format });
// Shader
const module = device.createShaderModule({ code: wgslString });
// Render pipeline
const pipeline = device.createRenderPipeline({ layout: 'auto', vertex: {...}, fragment: {...} });
// Compute pipeline
const cpipeline = device.createComputePipeline({ layout: 'auto', compute: { module, entryPoint: 'main' } });
// Buffer
const buffer = device.createBuffer({ size, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC });
// Bind group
const bindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), entries: [...] });
// Command encoding
const enc = device.createCommandEncoder();
const pass = enc.beginRenderPass({ colorAttachments: [...] });
pass.setPipeline(pipeline);
pass.draw(vertexCount);
pass.end();
device.queue.submit([enc.finish()]);GPUBufferUsage Flags
| Flag | Use |
|---|---|
VERTEX | Vertex data |
INDEX | Index data |
UNIFORM | Uniform data (read-only, 64KB max) |
STORAGE | Storage data (read/write, 128MB+) |
COPY_SRC | Can be source of copy operations |
COPY_DST | Can be destination of copy operations |
MAP_READ | CPU can read (staging/readback) |
MAP_WRITE | CPU can write (upload) |
INDIRECT | Indirect draw/dispatch arguments |
GPUTextureUsage Flags
| Flag | Use |
|---|---|
TEXTURE_BINDING | Use as texture in shader |
STORAGE_BINDING | Use as storage texture in shader |
RENDER_ATTACHMENT | Render target / depth attachment |
COPY_SRC | Copy from |
COPY_DST | Copy to |
Common Limits
| Limit | Default Minimum |
|---|---|
maxUniformBufferBindingSize | 64KB |
maxStorageBufferBindingSize | 128MB |
maxComputeInvocationsPerWorkgroup | 256 |
maxComputeWorkgroupSizeX/Y/Z | 256 |
maxBindGroups | 4 |
maxVertexAttributes | 16 |
maxTextureArrayLayers | 256 |