Closed Bug 1983593 Opened 1 year ago Closed 1 year ago

Import Direct3D video frames directly into wgpu for external textures

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
144 Branch
Tracking Status
firefox144 --- fixed

People

(Reporter: jnicol, Assigned: jnicol)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

No description provided.

When importing an external texture in the content process, call
BuildSurfaceDescriptorGPUVideoOrBuffer() instead of
BuildSurfaceDescriptorBuffer(), in order to avoid a readback of GPUVideo
images into a shmem.

In the GPU process, handle GPUVideo surface descriptors. For Tnull_t, if
the remote texture host is a BufferTextureHost we can use the existing
CreateFromBufferDesc() path to create the required wgpu textures. For
TSurfaceDescriptorD3D10 and TSurfaceDescriptorDXGIYCbCr we add new paths
to import the textures directly into wgpu via their shared
handles. SurfaceDescriptorDXGIYCbCr always requires 3 textures and
views: for Y, Cb, and Cr planes respectively. SurfaceDescriptorD3D10 can
come in a variety of formats, which we attempt to handle.

If available, we request wgpu's TEXTURE_FORMAT_NV12,
TEXTURE_FORMAT_P010, and TEXTURE_FORMAT_16BIT_NORM features. The first
is required for NV12 format textures, and the latter 2 are required for
P010. If unavailable, we will gracefully fail to create these textures
but other content will continue to work. It would be surprising,
however, if the decoder were to provide us with textures in these
formats when they are not supported.

Assignee: nobody → jnicol
Status: NEW → ASSIGNED
Type: defect → enhancement
Priority: -- → P1
Pushed by jnicol@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/83147dd2e20d https://hg.mozilla.org/integration/autoland/rev/a9c6daf18dd8 Import direct3d video frames directly into wgpu for external textures. r=webgpu-reviewers,teoxoy
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/f76adaf46c3c https://hg.mozilla.org/integration/autoland/rev/4f7cbf775c9d Revert "Bug 1983593 - Import direct3d video frames directly into wgpu for external textures. r=webgpu-reviewers,teoxoy" for causing build bustages @ExternalTexture.cpp.

Backed out for causing build bustages @ExternalTexture.cpp.

Flags: needinfo?(jnicol)
Flags: needinfo?(jnicol)
Pushed by jnicol@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c6206cdfd874 https://hg.mozilla.org/integration/autoland/rev/00606ae0ae68 Import direct3d video frames directly into wgpu for external textures. r=webgpu-reviewers,teoxoy
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 144 Branch
QA Whiteboard: [qa-triage-done-c145/b144]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: