GPUExternalTexture
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is available in Web Workers.
Giao diện GPUExternalTexture của WebGPU API đại diện cho một đối tượng bao bọc chứa ảnh chụp nhanh HTMLVideoElement có thể được sử dụng như kết cấu trong các thao tác kết xuất GPU.
Đối tượng GPUExternalTexture được tạo bằng GPUDevice.importExternalTexture().
Thuộc tính phiên bản
Ví dụ
Trong ví dụ Video Uploading của WebGPU Samples, một đối tượng GPUExternalTexture (được tạo qua lệnh gọi GPUDevice.importExternalTexture()) được sử dụng như giá trị resource trong mục nhập nhóm liên kết, được chỉ định khi tạo GPUBindGroup qua lệnh gọi GPUDevice.createBindGroup():
// …
const uniformBindGroup = device.createBindGroup({
layout: pipeline.getBindGroupLayout(0),
entries: [
{
binding: 1,
resource: sampler,
},
{
binding: 2,
resource: device.importExternalTexture({
source: video,
}),
},
],
});
// …
Thông số kỹ thuật
| Specification |
|---|
| WebGPU> # gpuexternaltexture> |