MDN self-hosted library · e01.org
Bitwise flags / notebook

Bitwise flags

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const descriptor = {
  usage: GPUBufferUsage.COPY_SRC | GPUBufferUsage.MAP_WRITE,
};
js
if (buffer.usage & GPUBufferUsage.MAP_WRITE) {
  // Buffer has MAP_WRITE usage
}