GPUExternalTexture: label property - Web APIs | MDN

Value

A string. If this has not been previously set as described above, it will be an empty string.

Examples

Setting and getting a label via GPUExternalTexture.label:

js

// …

const externalTexture = device.importExternalTexture({
  source: video,
});

externalTexture.label = "my_ext_texture";

console.log(externalTexture.label); // "my_ext_texture"

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

js

// …

const externalTexture = device.importExternalTexture({
  source: video,
  label: "my_ext_texture",
});

console.log(externalTexture.label); //  "my_ext_texture"

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.