GPURenderBundleEncoder: label property - Web APIs | MDN

Value

A string. If no label value has previously been set, getting the label returns an empty string.

Examples

Setting and getting a label via GPURenderBundleEncoder.label:

js

const renderBundleEncoder = device.createRenderBundleEncoder({
  colorFormats: [presentationFormat],
});

renderBundleEncoder.label = "my_render_bundle_encoder";
console.log(renderBundleEncoder.label); // "my_render_bundle_encoder"

Setting a label via the originating GPUDevice.createRenderBundleEncoder() call, and then getting it via GPURenderBundleEncoder.label:

js

const renderBundleEncoder = device.createRenderBundleEncoder({
  colorFormats: [presentationFormat],
  label: "my_render_bundle_encoder",
});

console.log(renderBundleEncoder.label); // "my_render_bundle_encoder"

Specifications

Specification
WebGPU
# dom-gpuobjectbase-label

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.