Commit Graph
71 Commits
Author SHA1 Message Date
Emilio Cobos Álvarez 1bd0da8bf7 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 22:04:17 +00:00
iulian moraru 480fc572da Revert "Bug 2036439, Bug 2033243 - Deal with ownerGlobal -> documentGlobal rename in extensions. r=robwu,home-newtab-reviewers,mconley" for causing newtab failures.
This reverts commit 4f62279d01.

Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug"

This reverts commit 91a4ece356.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 5a95a889e1.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 7177a68e67.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 5263254690.
2026-05-02 16:43:35 +00:00
Emilio Cobos Álvarez 7177a68e67 Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-02 15:33:23 +00:00
rperta d4cc71008d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" on developer request
This reverts commit e58e122135.

This reverts commit 84ca206f3e.

This reverts commit a7945292ed.

This reverts commit 367d83d299.
2026-05-02 06:20:30 +00:00
Emilio Cobos Álvarez a7945292ed Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-05-01 11:58:14 +00:00
agoloman c814da612d Revert "Bug 2033243 - Other miscellaneous ownerGlobal-related naming removal. r=dom-core,smaug" for causing multiple failures.
This reverts commit c7246654bc.

Revert "Bug 2033243 - BindToOwner -> BindToGlobal. r=dom-core,smaug"

This reverts commit 8873ddf33c.

Revert "Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug"

This reverts commit 8bf999e03c.

Revert "Bug 2033243 - Replace ownerGlobal with documentGlobal, and stop exposing ownerGlobal to JS. r=firefox-desktop-core-reviewers ,webidl,joschmidt,perftest-reviewers,sparky,smaug,mossop"

This reverts commit 7dea1af2e0.
2026-04-30 20:13:14 +00:00
Emilio Cobos Álvarez 8bf999e03c Bug 2033243 - Rename GetOwnerGlobal to GetRelevantGlobal. r=dom-core,media-playback-reviewers,credential-management-reviewers,webrtc-reviewers,dom-storage-reviewers,firefox-style-system-reviewers,dimi,janv,dshin,aosmond,smaug
As per the HTML terminology (https://html.spec.whatwg.org/#relevant)

Automatic rename using sed + lints.

Differential Revision: https://phabricator.services.mozilla.com/D297184
2026-04-30 17:47:11 +00:00
Ashley Hale 14c6697842 Bug 2012850 - Add TransferFunction to TextureHost and PiecewiseGamma to support HLG transfer function r=tnikkel,bradwerth,gfx-reviewers,media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D287078
2026-03-31 21:37:23 +00:00
rperta 2edb44ad27 Revert "Bug 2012850 - Add TransferFunction to TextureHost and PiecewiseGamma to support HLG transfer function r=tnikkel,bradwerth,gfx-reviewers,media-playback-reviewers,alwu" for causing build bustages at DCLayerTree.cpp
This reverts commit 2550eb5e9b.
2026-03-31 01:46:47 +00:00
Ashley Hale 2550eb5e9b Bug 2012850 - Add TransferFunction to TextureHost and PiecewiseGamma to support HLG transfer function r=tnikkel,bradwerth,gfx-reviewers,media-playback-reviewers,alwu
Differential Revision: https://phabricator.services.mozilla.com/D287078
2026-03-31 00:24:42 +00:00
Sylvestre Ledru 9eb1a31a98 Bug 2023419 - Remove Emacs/Vim modelines from dom/ r=emilio,media-playback-reviewers,webidl,padenot
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287843
2026-03-16 21:02:32 +00:00
Tom Schuster 601fafa65b Bug 2021178 - Return Maybe<int32_t> from Get*Stride. r=tnikkel,media-playback-reviewers,webrtc-reviewers,webgpu-reviewers,bradwerth,ErichDonGubler,pehrsons,padenot
Differential Revision: https://phabricator.services.mozilla.com/D287396
2026-03-16 20:26:11 +00:00
Teodor Tanasoaia 2f8a8fdd43 Bug 2018451 - Compute presentation buffer sizes early. r=webgpu-reviewers,aleiserson
Differential Revision: https://phabricator.services.mozilla.com/D284500
2026-03-03 14:50:15 +00:00
Jamie Nicol 73966626d3 Bug 1994441 - Build ExternalTextureSourceHost from TextureHost instead of RemoteDecoderVideoSubDescriptor. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D269238
2025-10-23 17:33:07 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
Jamie Nicol e4bf0c007d Bug 1994022 - Use Span for ExternalTextureSourceHost::CreateFromBufferDesc. r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D268567
2025-10-18 17:24:31 +00:00
Cosmin Sabou e3cddd698c Revert "Bug 1994022 - Use Span for ExternalTextureSourceHost::CreateFromBufferDesc. r=webgpu-reviewers,jimb" for causing mda failures on test_standalone.
This reverts commit 109489f1e1.
2025-10-17 21:39:23 +00:00
Jamie Nicol 109489f1e1 Bug 1994022 - Use Span for ExternalTextureSourceHost::CreateFromBufferDesc. r=webgpu-reviewers,jimb
Differential Revision: https://phabricator.services.mozilla.com/D268567
2025-10-17 15:56:14 +00:00
Jim Blandy 9b1a02828c Bug 1992032: Build WebGPU external textures directly from the shmem. r=webgpu-reviewers,teoxoy
In `mozilla::webgpu::ExternalTextureSourceHost::Create`, when the data
is received as a `SurfaceDescriptorBuffer`, simply fetch the address
directly from the `Shmem`; don't call `GetAddressFromDescriptor`.

Differential Revision: https://phabricator.services.mozilla.com/D268286
2025-10-15 23:32:01 +00:00
Jamie Nicol d91d4df004 Bug 1984688 - Import external textures directly into wgpu from Mac IOSurfaces. r=webgpu-reviewers,teoxoy
Differential Revision: https://phabricator.services.mozilla.com/D262561
2025-08-29 16:42:45 +00:00
Teodor Tanasoaia 03a627fbce Bug 1981225 - Consolidate ID-related logic in ObjectBase. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D261942
2025-08-27 11:22:00 +00:00
agoloman db150f25f2 Revert (Bug 1981187, Bug 1981225) - for causing build bustages RenderBundle.cpp.
This reverts commit cb3f1a84bb.

Revert "Bug 1981225 - Consolidate ID-related logic in `ObjectBase`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit 793a7e81db.
2025-08-26 14:12:22 +00:00
Teodor Tanasoaia 793a7e81db Bug 1981225 - Consolidate ID-related logic in ObjectBase. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D261942
2025-08-26 13:23:27 +00:00
agoloman 167b30ae21 Revert (Bug 1981187, Bug 1981225)- for causing build bustages @RefPtr.h.
This reverts commit 5fb5283ac4.

Revert "Bug 1981225 - Consolidate ID-related logic in `ObjectBase`. r=webgpu-reviewers,ErichDonGubler"

This reverts commit 2d0cd2975f.
2025-08-26 11:18:12 +00:00
Teodor Tanasoaia 2d0cd2975f Bug 1981225 - Consolidate ID-related logic in ObjectBase. r=webgpu-reviewers,ErichDonGubler
Differential Revision: https://phabricator.services.mozilla.com/D261942
2025-08-26 10:07:28 +00:00
Jamie Nicol c6206cdfd8 Bug 1983593 - Import direct3d video frames directly into wgpu for external textures. r=webgpu-reviewers,teoxoy
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 a CompositeProcessFencesHolderId is provided we must ensure we wait
on the appropriate write fence prior to reading from the texture. To
ensure this occurs, we make the ExternalTextureSourceHost hold on to its
fences holder ID. When submitting command buffers, we pass the list of
used external texture sources to the host side, then on the host side
for each source we call OnBeforeQueueSubmit(). This obtains the write
fence's shared handle and the value which must be waited for from the
CompositeProcessD3D11FencesHolderMap, then imports the fence from the
shared handle and inserts a wait for the specified value into the
command queue.

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.

Differential Revision: https://phabricator.services.mozilla.com/D261424
2025-08-21 23:32:55 +00:00
agoloman f76adaf46c Revert "Bug 1983593 - Import direct3d video frames directly into wgpu for external textures. r=webgpu-reviewers,teoxoy" for causing build bustages @ExternalTexture.cpp.
This reverts commit 83147dd2e2.
2025-08-21 14:59:23 +00:00
Jamie Nicol 83147dd2e2 Bug 1983593 - Import direct3d video frames directly into wgpu for external textures. r=webgpu-reviewers,teoxoy
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 a CompositeProcessFencesHolderId is provided we must ensure we wait
on the appropriate write fence prior to reading from the texture. To
ensure this occurs, we make the ExternalTextureSourceHost hold on to its
fences holder ID. When submitting command buffers, we pass the list of
used external texture sources to the host side, then on the host side
for each source we call OnBeforeQueueSubmit(). This obtains the write
fence's shared handle and the value which must be waited for from the
CompositeProcessD3D11FencesHolderMap, then imports the fence from the
shared handle and inserts a wait for the specified value into the
command queue.

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.

Differential Revision: https://phabricator.services.mozilla.com/D261424
2025-08-21 13:27:18 +00:00
Jamie Nicol 95a29549cc Bug 1979110 - Allow reusing previously imported external textures. r=webgpu-reviewers,teoxoy
The WebGPU spec allows us to return a previously imported external
texture from `importExternalTexture()` when provided with the same
descriptor (ignoring the label), as long as the current image contents
of the source is the same. For applications that import a large number
of external textures from the same source, this can be a significant
performance improvement.

This implementation maintains a cache of imported external texture
sources, keyed by the "serial" of the layers::Image they were imported
from. Additionally, each source maintains a cache of external textures
that have been created from it. This is keyed by the contents of their
descriptor, ignoring the label (as per the spec) and the "source" (as
the cache is owned by the source) leaving just the color space.

Using these two separate levels of cache means that we not only create
a single single external texture for multiple imports with the same
descriptor, but when importing from the same source with an otherwise
different descriptor we are still able to share the underlying plane
textures.

Differential Revision: https://phabricator.services.mozilla.com/D260827
2025-08-13 10:12:02 +00:00
Jamie Nicol 361fefaf48 Bug 1979110 - Hold reference to layers::Image until all external texture work using it is done. r=webgpu-reviewers,teoxoy
And then eagerly destroy external textures and external texture sources
when possible.

We must retain a reference to the layers::Image from which an external
texture source was imported as long as any work involving external
textures created from that source is outstanding. This prevents the
decoder from attempting to recycle the underlying resource too early,
e.g. decoding a future video frame into the texture while wgpu is still
to render the previous frame.

On the other hand, we don't want to hold on to resources longer than
required in order to prevent excess memory usage.

For each external texture, keep track of submission index at which work
involving the external texture was last submitted, and the index of the
last such submission whose work has since completed. When all submitted
work for an external texture has completed, and the external texture
has been expired, eagerly destroy the external texture.

Additionally, when the external texture is destroyed also release its
reference to the external texture source. This means the source will
itself be destroyed as soon as there are no more live external textures
that were created from it. When the source is destroyed the last
reference to the layes::Image will be dropped, indicating to the
decoder that it can reuse the underlying resources.

Differential Revision: https://phabricator.services.mozilla.com/D260826
2025-08-13 10:11:58 +00:00
Jamie Nicol fb77729315 Bug 1979108 - Implement ExternalTexture expiration. r=webgpu-reviewers,media-playback-reviewers,teoxoy,alwu
ExternalTextures imported from HTMLVideoElements get "expired" in the
"automatic expiry task source", which is implemented by scheduling a
stable state task. ExternalTextures imported from VideoFrames get
expired when the VideoFrame is closed.

Keep track of each external texture used by any used bind group when
encoding compute and render passes. When submitting, if any passes
contain expired external textures then raise a validation error.

Currently we always create a new ExternalTexture when
importExternalTexture() is called. When support for reusing previously
imported textures is added, we must ensure they are correctly
"unexpired".

Differential Revision: https://phabricator.services.mozilla.com/D260295
2025-08-12 08:49:36 +00:00
Jamie Nicol 2326fa335e Bug 1979100 - Implement WebGPU Device.importExternalTexture(). r=webgpu-reviewers,webidl,smaug,teoxoy
First we create an ExternalTextureSource using the infrastructure added
in the previous patch, and from that we create an ExternalTexture.

In order to create the external texture the client side passes an
`ExternalTextureDescriptor` to the host side, which encodes the
source as a optional ID. On the host side additional information is
queried from the ExternalTextureSourceHost, which is combined with the
`ExternalTextureDescriptor` provided by the client in order to call
wgpu's create_external_texture().

If there was an error importing the source on the client side the
source ID will be `None`. If there was an error importing the source
on the host side, it will return an empty slice of texture views as its
planes. In either case this indicates we should propagate the error
state to the external texture.

Subsequent patches will allow for creating multiple external textures
from the same source, and returning previously imported external
textures rather than always creating a new one.

Note that for now we have not requested Features::EXTERNAL_TEXTURE when
creating the wgpu device, meaning that any attempts to actually create
an external texture will result in an error.

Differential Revision: https://phabricator.services.mozilla.com/D259820
2025-08-11 12:34:31 +00:00
Jamie Nicol 07684da9a2 Bug 1979100 - Add infrastructure for importing video frames into wgpu textures. r=webgpu-reviewers,webidl,teoxoy,smaug
In order to support webgpu's GPUExternalTexture we must first be able
to import video frames into wgpu. To do so we introduce the concept of
an external texture "source". This consists of between 1 and 3
textures and texture views, in order to support single-plane RGBA or
multiplanar YCbCr data. The source is implemented as a distinct
concept from the external texture itself so that multiple external
textures can be created from the same source.

An external texture source has both a client-side and host-side
representation. The client side is responsible for managing the
lifecycle of the host side. It obtains a SurfaceDescriptor from the
current layers::Image of the video element or frame it was imported
from, and sends this to the host side. The host side is responsible
for creating the wgpu Textures and TextureViews it needs from the
SurfaceDescriptor. It also holds various pieces of information derived
from the imported frames that will be required to construct the
wgpu::ExternalTextureDescriptor required to create a
wgpu::ExternalTexture.

For now, we always call Image::BuildSurfaceDescriptorBuffer to obtain
the surface descriptor, and therefore only have to handle
SurfaceDescriptorBuffers. In subsequent patches we will handle
GPUVideo surface descriptors to directly import hardware decoded video
frames without requiring a readback.

Differential Revision: https://phabricator.services.mozilla.com/D259819
2025-08-11 12:34:27 +00:00
Cosmin Sabou 8fbe756648 Revert "Bug 1979100 - Add infrastructure for importing video frames into wgpu textures. r=webgpu-reviewers,webidl,teoxoy,smaug" for causing build bustages on ExternalTexture.h
This reverts commit 8c62114465.

Revert "Bug 1979100 - Move ErrorBuffer declaration to WebGPUParent.h. r=webgpu-reviewers,teoxoy"

This reverts commit 02e5b2a7d7.
2025-08-09 21:23:24 +00:00
Narcis Beleuzu b5c83e2ac1 Revert "Bug 1979100 - Implement WebGPU Device.importExternalTexture(). r=webgpu-reviewers,webidl,smaug,teoxoy" for causing bustages on Utility.cpp
This reverts commit 0bb8155417.
2025-08-09 14:06:24 +00:00
Jamie Nicol 0bb8155417 Bug 1979100 - Implement WebGPU Device.importExternalTexture(). r=webgpu-reviewers,webidl,smaug,teoxoy
First we create an ExternalTextureSource using the infrastructure added
in the previous patch, and from that we create an ExternalTexture.

In order to create the external texture the client side passes an
`ExternalTextureDescriptor` to the host side, which encodes the
source as a optional ID. On the host side additional information is
queried from the ExternalTextureSourceHost, which is combined with the
`ExternalTextureDescriptor` provided by the client in order to call
wgpu's create_external_texture().

If there was an error importing the source on the client side the
source ID will be `None`. If there was an error importing the source
on the host side, it will return an empty slice of texture views as its
planes. In either case this indicates we should propagate the error
state to the external texture.

Subsequent patches will allow for creating multiple external textures
from the same source, and returning previously imported external
textures rather than always creating a new one.

Note that for now we have not requested Features::EXTERNAL_TEXTURE when
creating the wgpu device, meaning that any attempts to actually create
an external texture will result in an error.

Differential Revision: https://phabricator.services.mozilla.com/D259820
2025-08-09 09:45:04 +00:00
Jamie Nicol 8c62114465 Bug 1979100 - Add infrastructure for importing video frames into wgpu textures. r=webgpu-reviewers,webidl,teoxoy,smaug
In order to support webgpu's GPUExternalTexture we must first be able
to import video frames into wgpu. To do so we introduce the concept of
an external texture "source". This consists of between 1 and 3
textures and texture views, in order to support single-plane RGBA or
multiplanar YCbCr data. The source is implemented as a distinct
concept from the external texture itself so that multiple external
textures can be created from the same source.

An external texture source has both a client-side and host-side
representation. The client side is responsible for managing the
lifecycle of the host side. It obtains a SurfaceDescriptor from the
current layers::Image of the video element or frame it was imported
from, and sends this to the host side. The host side is responsible
for creating the wgpu Textures and TextureViews it needs from the
SurfaceDescriptor. It also holds various pieces of information derived
from the imported frames that will be required to construct the
wgpu::ExternalTextureDescriptor required to create a
wgpu::ExternalTexture.

For now, we always call Image::BuildSurfaceDescriptorBuffer to obtain
the surface descriptor, and therefore only have to handle
SurfaceDescriptorBuffers. In subsequent patches we will handle
GPUVideo surface descriptors to directly import hardware decoded video
frames without requiring a readback.

Differential Revision: https://phabricator.services.mozilla.com/D259819
2025-08-09 09:45:00 +00:00
Jamie Nicol 1860371905 Bug 1975457 - Rename webgpu::ExtTex to ExternalTexture. r=webgpu-reviewers,nical
Now that the previous patch has renamed ExternalTexture to
SharedTexture, we can rename our (currently just a stub)
implementation of webgpu's GPUExternalTexture to ExternalTexture.

Differential Revision: https://phabricator.services.mozilla.com/D255977
2025-07-03 19:02:27 +00:00
Jamie Nicol b20a20439a Bug 1975457 - Rename webgpu::ExternalTexture to SharedTexture. r=webgpu-reviewers,nical
An ExternalTexture is a texture that is created and owned by gecko,
but shared with the webgpu implementation. It is used for webgpu
presentation. While this name describes the class well, it is
confusing due to webgpu having an entirely unrelated concept of
GPUExternalTexture.

This patch renames ExternalTexture, and all of its subclasses and
uses, to SharedTexture. This still describes the purpose accurately,
and has similarities to gl::SharedSurface which serves a similar
purpose for our webgl implementation.

Differential Revision: https://phabricator.services.mozilla.com/D255976
2025-07-03 19:02:24 +00:00
Sandor Molnar efedf71198 Revert "Bug 1975457 - Rename webgpu::ExtTex to ExternalTexture. r=webgpu-reviewers,nical" for causing build bustages @ ExternalTexture.cpp
This reverts commit 482781f3aa.

Revert "Bug 1975457 - Rename webgpu::ExternalTexture to SharedTexture. r=webgpu-reviewers,nical"

This reverts commit 0acc41c66b.
2025-07-03 17:59:24 +00:00
Jamie Nicol 482781f3aa Bug 1975457 - Rename webgpu::ExtTex to ExternalTexture. r=webgpu-reviewers,nical
Now that the previous patch has renamed ExternalTexture to
SharedTexture, we can rename our (currently just a stub)
implementation of webgpu's GPUExternalTexture to ExternalTexture.

Differential Revision: https://phabricator.services.mozilla.com/D255977
2025-07-03 16:41:05 +00:00
Jamie Nicol 0acc41c66b Bug 1975457 - Rename webgpu::ExternalTexture to SharedTexture. r=webgpu-reviewers,nical
An ExternalTexture is a texture that is created and owned by gecko,
but shared with the webgpu implementation. It is used for webgpu
presentation. While this name describes the class well, it is
confusing due to webgpu having an entirely unrelated concept of
GPUExternalTexture.

This patch renames ExternalTexture, and all of its subclasses and
uses, to SharedTexture. This still describes the purpose accurately,
and has similarities to gl::SharedSurface which serves a similar
purpose for our webgl implementation.

Differential Revision: https://phabricator.services.mozilla.com/D255976
2025-07-03 16:41:02 +00:00
sotaro 2cc8d30558 Bug 1957563 - Replace SurfaceDescriptorD3D10::fenceInfo with GpuProcessFencesHolderId r=gfx-reviewers,lsalzman
Remove FenceInfo. Instead use GpuProcessFencesHolderId and GpuProcessD3D11FencesHolderMap.

GpuProcessD3D11FencesHolderMap is changed to instantiate also in Parent process when GPU process does not exist. Then it seems better to change its name. The name change is going to be handled in Bug 1958752.

Differential Revision: https://phabricator.services.mozilla.com/D244539
2025-04-07 11:48:23 +00:00
Erich Gubler d632ae7411 Bug 1952345 - feat(webgpu): stub out GPUExternalTexture r=webgpu-reviewers,webidl,smaug,teoxoy
Do this by populating a trivial `ExtTex` type in `ExternalTexture.h`. Do not use `ExternalTexture`, since that's currently used by the internals that actually implement interesting operations for external texture usage with WGPU; punt on figuring out the perfect name for later.

This allows many CTS tests, which use `x instanceof GPUExternalTexture` without actually consuming the external texture API, to make interesting forward progress.

This should be strictly safe to do, since we do not permit the user to actually construct or use a `GPUExternalTexture`.

Analysis of CTS outcome changes:

- New `PASS`es resulting in promotion to tier 2:
	- `webgpu:shader,execution,expression,call,builtin,textureDimensions:depth:*`
	- `webgpu:shader,execution,expression,call,builtin,textureDimensions:sampled_and_multisampled:*` on Linux and macOS
	- `webgpu:shader,execution,expression,call,builtin,textureLoad:sampled_1d:*` on Windows and Linux
	- `webgpu:shader,execution,expression,call,builtin,textureLoad:sampled_3d:*` on Windows and Linux
	- `webgpu:shader,execution,expression,call,builtin,textureNumLayers:arrayed:*` on Linux and macOS
	- `webgpu:shader,execution,expression,call,builtin,textureNumLayers:sampled:*` on Linux and macOS
	- `webgpu:shader,execution,expression,call,builtin,textureNumLevels:depth:*`
	- `webgpu:shader,execution,expression,call,builtin,textureNumLevels:sampled:*` on Linux and macOS
	- `webgpu:shader,execution,expression,call,builtin,textureNumSamples:depth:*`
	- `webgpu:shader,execution,expression,call,builtin,textureNumSamples:sampled:*`
	- `webgpu:shader,execution,expression,call,builtin,textureSample:sampled_1d_coords:*` on Windows and Linux

	Otherwise are _many_ new `PASS`es in test variants that don't quite make entire test(s) pass, so this is definitely a good change. 🙂
- Some tests' variants have been deleted, since they are no longer reported due to _all_ runs of them `CRASH`ing due to timeout (rather than a stack crash). This will be dealt with in follow-up work. Since these tests are in tier 3, I don't see a hard problem with letting these be deleted for now.

Differential Revision: https://phabricator.services.mozilla.com/D240673
2025-03-18 01:10:58 +00:00