demo · v136
external texture view
A normal GPUTextureView now satisfies externalTexture bind-group slots. Cache one texture per source frame and reuse the view — cheaper than calling importExternalTexture every frame.
Probing…
device.createBindGroupLayout—
device.createBindGroup—
resulting layout—
the code
const bgl = device.createBindGroupLayout({
entries: [{
binding: 0,
visibility: GPUShaderStage.FRAGMENT,
externalTexture: {},
}],
});
// Pre-136: only an actual external texture allowed.
// 136+: a regular GPUTextureView is accepted too — useful for caching.
const view = myTexture.createView();
const bg = device.createBindGroup({
layout: bgl,
entries: [{ binding: 0, resource: view }],
});
see also
- WebGPU external texture view binding — feature index
- ChromeStatus entry
- WebGPU spec