Open Bug 1827116 (webgpu-external-textures) Opened 3 years ago Updated 1 month ago

[meta] External texture API missing in WebGPU (`GPUDevice.importExternalTexture`, `GPUExternalTexture`, `texture_external`)

Categories

(Core :: Graphics: WebGPU, defect, P1)

Firefox 113
defect

Tracking

()

People

(Reporter: bugz, Assigned: jnicol, NeedInfo)

References

(Depends on 2 open bugs, Blocks 4 open bugs)

Details

(Keywords: meta, parity-chrome, parity-safari, Whiteboard: [platform-feature])

User Story

webcompat-risk:moderate

Attachments

(1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/113.0

Steps to reproduce:

visit thimbleberry.dev and click the webcam button, or the sample media and then the 'jump' video

Actual results:

The video path processing path fails because:
importExternalTexture is undefined

src here: https://github.com/mighdoll/thimbleberry/blob/main/image-demo/src/ImageProcessing.ts

Assignee: nobody → egubler
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: importExternalTexture not defined → External texture APIs missing in WebGPU

This bug happens because GPUDevice.importExternalTexture (orig. spec PR, current spec) is part of the current v1 draft of the WebGPU API spec, but not yet implemented. The effort involved to resolve this is not yet clear. Assigning this bug to myself to figure it out.

Summary: External texture APIs missing in WebGPU → `GPUQueue.copyExternalImageToTexture` missing in WebGPU
Summary: `GPUQueue.copyExternalImageToTexture` missing in WebGPU → `GPUDevice.importExternalTexture` missing in WebGPU
Attachment #9329590 - Attachment is obsolete: true

This API is definitely necessary for webgpu-v1-samples' videoUploading and videoUploadingCodecs demos, which is a relatively high priority for us to resolve in Firefox's WebGPU implementation. However, we believe we should unblock some other bugs that block that specific issue before attending to this one specifically. I'm going to unassign myself for now, since I'm not giving any active attention to this bug.

Assignee: egubler → nobody

For reference of the future assignee to this bug, here's what I was able to find relevant to this set of APIs; we basically need to implement these pieces of the current drafts of the v1 spec.:

  • Section 6.4 of the v1 WebGPU API spec. (GPUExternalTexture).
  • Section 5.4.4 of the v1 WGSL spec. (External sampled texture types).
Summary: `GPUDevice.importExternalTexture` missing in WebGPU → External texture API missing in WebGPU `GPUDevice.importExternalTexture` missing in WebGPU
Summary: External texture API missing in WebGPU `GPUDevice.importExternalTexture` missing in WebGPU → External texture API missing in WebGPU (`GPUDevice.importExternalTexture`, `GPUExternalTexture`, `texture_external`)

VideoFrame blocks the videoUploadingWebCodecs demo specifically.

Alias: webgpu-external-textures

I'll take this, up to but excluding VideoFrame for now.

Assignee: nobody → jgilbert
Severity: -- → S3
Priority: -- → P3
See Also: → 1843891
Assignee: jgilbert → nobody
Whiteboard: webcompat:risk-moderate
Assignee: nobody → ttanasoaia
Status: NEW → ASSIGNED
Priority: P3 → P1
Assignee: ttanasoaia → nobody
Status: ASSIGNED → NEW
See Also: 1880601 →
Assignee: nobody → jnicol

Jamie says that his work will be supporting both HTMLVideoElement and VideoFrame. I think this is everything the spec requires.

The GPUDevice.importExternalTexture method takes a GPUExternalTextureDescriptor to describe what's being imported. The WebIDL for that is:

dictionary GPUExternalTextureDescriptor
         : GPUObjectDescriptorBase {
    required (HTMLVideoElement or VideoFrame) source;
    PredefinedColorSpace colorSpace = "srgb";
};
Depends on: 1968882
Depends on: 1975457
Depends on: 1975498
Blocks: 1978201

I've been using this as a meta for all external texture work. Updating the title to make that clear, as the specific error message indicated in the title will be fixed soon but there will be remaining work to do

Summary: External texture API missing in WebGPU (`GPUDevice.importExternalTexture`, `GPUExternalTexture`, `texture_external`) → [meta] WebGPU External Textures

ugh ignore me I had misread the title

Summary: [meta] WebGPU External Textures → [meta] External texture API missing in WebGPU (`GPUDevice.importExternalTexture`, `GPUExternalTexture`, `texture_external`)
Depends on: 1979100
Depends on: 1979101
Depends on: 1979108
Depends on: 1979110
Depends on: 1982866
Depends on: 1983593
Depends on: 1983594
Depends on: 1984688
Depends on: 1985586
Depends on: 1986246

Jamie, since we've shipped this on Windows and macOS, can we close this bug?

Flags: needinfo?(jnicol)

If you think shipping on Windows and macOS counts as "done", since we're not yet shipping WebGPU on Linux or Android, then sure.

I've filed bug 2008705 and bug 2008706 for the remaining Linux and Android implementations. We can either make them block this bug and leave it open, or close this bug and perhaps link them elsewhere?. What do you think?

Flags: needinfo?(jnicol) → needinfo?(jimb)
Whiteboard: webcompat:risk-moderate → [platform-feature][webcompat:risk-moderate]
User Story: (updated)
Whiteboard: [platform-feature][webcompat:risk-moderate] → [platform-feature]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: