files/en-us/web/api/gpuexternaltexture/index.md
{{APIRef("WebGPU API")}}{{SecureContext_Header}}{{AvailableInWorkers}}
The GPUExternalTexture interface of the {{domxref("WebGPU API", "WebGPU API", "", "nocode")}} represents a wrapper object containing an {{domxref("HTMLVideoElement")}} snapshot that can be used as a texture in GPU rendering operations.
A GPUExternalTexture object instance is created using {{domxref("GPUDevice.importExternalTexture()")}}.
{{InheritanceDiagram}}
In the WebGPU samples Video Uploading sample, a GPUExternalTexture object (created via a {{domxref("GPUDevice.importExternalTexture()")}} call) is used as the value of a bind group entry resource, specified when creating a {{domxref("GPUBindGroup")}} via a {{domxref("GPUDevice.createBindGroup()")}} call:
// …
const uniformBindGroup = device.createBindGroup({
layout: pipeline.getBindGroupLayout(0),
entries: [
{
binding: 1,
resource: sampler,
},
{
binding: 2,
resource: device.importExternalTexture({
source: video,
}),
},
],
});
// …
{{Specifications}}
{{Compat}}