Skip to content

Quick Reference

Chrome Flags

FlagPurpose
chrome://flags/#enable-unsafe-webgpuEnable WebGPU on unsupported platforms
chrome://flags/#enable-webgpu-developer-featuresUnlock dev-only features (timestamps, adapter info, strict math)
chrome://flags/#enable-vulkanEnable Vulkan backend on Linux
chrome://flags/#ignore-gpu-blocklistOverride GPU hardware blocklist
chrome://flags/#force-high-performance-gpuForce discrete GPU on Windows laptops
chrome://flags/#unsafely-treat-insecure-origin-as-secureTest on HTTP origins

Diagnostic URLs

URLWhat to Check
chrome://gpuWebGPU status, driver info, feature flags
chrome://settings/system"Use graphics acceleration when available"
chrome://versionChrome 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 --ssl

Key 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

FlagUse
VERTEXVertex data
INDEXIndex data
UNIFORMUniform data (read-only, 64KB max)
STORAGEStorage data (read/write, 128MB+)
COPY_SRCCan be source of copy operations
COPY_DSTCan be destination of copy operations
MAP_READCPU can read (staging/readback)
MAP_WRITECPU can write (upload)
INDIRECTIndirect draw/dispatch arguments

GPUTextureUsage Flags

FlagUse
TEXTURE_BINDINGUse as texture in shader
STORAGE_BINDINGUse as storage texture in shader
RENDER_ATTACHMENTRender target / depth attachment
COPY_SRCCopy from
COPY_DSTCopy to

Common Limits

LimitDefault Minimum
maxUniformBufferBindingSize64KB
maxStorageBufferBindingSize128MB
maxComputeInvocationsPerWorkgroup256
maxComputeWorkgroupSizeX/Y/Z256
maxBindGroups4
maxVertexAttributes16
maxTextureArrayLayers256

Based on Chrome for Developers WebGPU Documentation