Commit Graph

56 Commits

Author SHA1 Message Date
Brad Werth
0ac2dc146e Bug 1906527 Part 1: Rename SurfaceFormat::YUV422 to YUY2, and rename YUV to YUV420. r=jgilbert
This is just a renaming patch, motivated by a need for clarity before
addding more YUV formats. Comments and log messages are updated as well,
and one function in MacIOSurface is renamed.

There is one small change in TextureHost.cpp  to satisfy clang-tidy.

Differential Revision: https://phabricator.services.mozilla.com/D217883
2024-08-05 17:59:15 +00:00
sotaro
b4bd4ed4c0 Bug 1901947 - Clean up some DXGITextureHostD3D11 code r=gfx-reviewers,lsalzman
Removed unused members and clean up around DXGITextureHostD3D11::GetAsSurface().

This is a preparation for Bug 1889275.

Differential Revision: https://phabricator.services.mozilla.com/D213389
2024-06-12 17:29:38 +00:00
Cosmin Sabou
3077e1076d Backed out changeset 10faf99bbe8f (bug 1880016) as request by sotaro. 2024-02-13 18:13:04 +02:00
sotaro
2414d5152e Bug 1880016 - Make RenderDXGITextureHost::SyncObjectNeeded() return false when ID3D11Texture2D is created by compositor device r=gfx-reviewers,lsalzman
By default, hardware video decoder uses compositor device for D3D11Device. In this case, mSyncObject->Synchronize() in RenderCompositorANGLE::BeginFrame() is not necessary.

When ID3D11Texture2D is created by compositor device, the Synchronize() is not necessary.

Differential Revision: https://phabricator.services.mozilla.com/D201693
2024-02-13 15:12:28 +00:00
sotaro
5eabf27101 Bug 1817617 - Wait ID3D11Query of D3D11Texture2D copy complete just before blitting for video overlay with non Intel GPUs r=media-playback-reviewers,padenot
Normally when D3D11Texture2D is copied by ID3D11DeviceContext::CopySubresourceRegion() with compositor device, WebRender does not need to wait copy complete, since WebRender also uses compositor device.

But with Non-intel GPUs(like NDIVIA), there is a case that the copy complete need to be wait explicitly even with compositor device

mSyncObject->Synchronize() could not be used with compositor device.

Wait of the query is not called in D3D11DXVA2Manager::CopyToImage(), since the wait could take long time. Then the Wait of the query is deferred to just before blitting for video overlay.

Differential Revision: https://phabricator.services.mozilla.com/D200041
2024-02-01 10:28:32 +00:00
sotaro
7d06300567 Bug 1861605 - Use IDXGIResource1::CreateSharedHandle() instead of IDXGIResource::GetSharedHandle() r=gfx-reviewers,lsalzman
gecko uses IDXGIResource::GetSharedHandle(). But it is recommend not to use anymore to retrieve the handle to a shared resource.
IDXGIResource1::CreateSharedHandle() with D3D11_RESOURCE_MISC_SHARED_NTHANDLE flag should be used instead of the GetSharedHandle().

The CreateSharedHandle() could be called only once for a shared resource. Later calls fail.

HANDLEs of ID3D11Texture2D are replaced by gfx::FileHandleWrappers.

Differential Revision: https://phabricator.services.mozilla.com/D192173
2023-12-19 09:23:21 +00:00
sotaro
86d050de4e Bug 1866412 - Add FenceD3D11 for wrapping ID3D11Fence r=gfx-reviewers,jrmuizel
The change is a preparation for Bug 1865984, Bug 1863474 and Bug 1861605.

FenceD3D11 is going to be used by Bug 1865984 and Bug 1863474. And FileHandleWrapper is going to be added for wrapping shared handle of ID3D11Fence and ID3D11Texture2D(Bug 1861605).

For now, FenceInfo is expected to be delivered just during creating TextureHost. It works for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D194612
2023-12-09 11:55:15 +00:00
Stanca Serban
b57f879b5e Backed out changeset 54e35266f616 (bug 1866412) for causing bp-nu bustages in RenderD3D11TextureHost.cpp. CLOSED TREE 2023-12-08 11:00:31 +02:00
sotaro
3e3409b160 Bug 1866412 - Add FenceD3D11 for wrapping ID3D11Fence r=gfx-reviewers,jrmuizel
The change is a preparation for Bug 1865984, Bug 1863474 and Bug 1861605.

FenceD3D11 is going to be used by Bug 1865984 and Bug 1863474. And FileHandleWrapper is going to be added for wrapping shared handle of ID3D11Fence and ID3D11Texture2D(Bug 1861605).

For now, FenceInfo is expected to be delivered just during creating TextureHost. It works for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D194612
2023-12-08 05:13:57 +00:00
sotaro
52f83a0b60 Bug 1863241 - Replace WindowsHandle by HANDLE in Windows only code around layers r=gfx-reviewers,lsalzman
WindowsHandle exists for ipc. And we normally use HANDLE in Windows only code. We do not need to use both WindowsHandle and HANDLE in Windows only code.

This is a preparation for Bug 1861605.

Differential Revision: https://phabricator.services.mozilla.com/D192811
2023-11-07 00:18:04 +00:00
sotaro
2cae2b6402 Bug 1847665 - Reduce SyncObjectD3D11Host::Synchronize() call in RenderCompositorANGLE::BeginFrame() r=gfx-reviewers,lsalzman
SyncObjectD3D11Host::Synchronize() could spend time when GPU is busy.
The Synchronize() call is not necessary when all RenderDXGITextureHosts have GpuProcessTextureId or KeyedMutex.

Differential Revision: https://phabricator.services.mozilla.com/D185619
2023-08-08 04:50:54 +00:00
sotaro
3ece048a1b Bug 1829063 - Split video overlay feature of software decoded video from nsIGfxInfo::FEATURE_VIDEO_OVERLAY r=gfx-reviewers,lsalzman
Current gecko enables "software decoded video overlay" only when "hardware decoded video overlay" is enabled. On current release, "hardware decoded video overlay" is not enabled yet with non-Intel GPU, then "software decoded video overlay" is not yet enabled on release. It is not good. We want to enable "software decoded video overlay" independently from "hardware decoded video overlay". Then settings of video overlay is split between "hardware decoded video overlay" and "software decoded video overlay". Then "software decoded video overlay" could be enabled/disabled independently from status of "hardware decoded video overlay".

* settings of hardware decoded video overlay
- nsIGfxInfo::FEATURE_VIDEO_OVERLAY:
- gfx.webrender.dcomp-video-hw-overlay-win
- gfx.webrender.dcomp-video-hw-overlay-win-force-enabled
- gfxVars::UseWebRenderDCompVideoHwOverlayWin()

* settings of software decoded video overlay
- nsIGfxInfo::FEATURE_VIDEO_SOFTWARE_OVERLAY
- gfx.webrender.dcomp-video-sw-overlay-win
- gfx.webrender.dcomp-video-sw-overlay-win-force-enabled
- gfxVars::UseWebRenderDCompVideoSwOverlayWin()

Differential Revision: https://phabricator.services.mozilla.com/D175993
2023-06-22 00:21:07 +00:00
serge-sans-paille
93b77462d2 Bug 1824071 - Make gfx/webrender_bindings buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D173398
2023-03-24 07:01:09 +00:00
sotaro
0bb743f94a Bug 1811170 - Make GpuProcessTextureId strongly-typed r=gfx-reviewers,lsalzman
uint64_t is used for GpuProcessTextureId. It should be strongly-typed.

Differential Revision: https://phabricator.services.mozilla.com/D167224
2023-01-19 08:19:28 +00:00
Lee Salzman
cfb26bdf6f Bug 1792527 - Explicitly bind mip filter for external textures inside WebRender. r=gw
If an external image shows up multiple times while using a different image rendering
setting on each instance, we can erroneously call handler.lock() for each instance in
parallel, thus defaulting to the last image rendering setting supplied for all instances
in that batch.

To work around this, we get rid of the concept of having RenderTextureHosts maintain and
set the image rendering state, which results in a nice simplification. Then, when we go
to actually bind an external image inside WebRender, we set the image rendering state
at that point, so that regardless of how many instances of an external image are locked
simultaneously, we always use the correct image rendering setting for a batch.

Differential Revision: https://phabricator.services.mozilla.com/D158920
2022-10-10 19:23:51 +00:00
Kelsey Gilbert
a32dfd5297 Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-13 17:40:43 +00:00
Marian-Vasile Laza
7ec7dec6f1 Backed out changeset f1e6746037f7 (bug 1785925) for causing reftest failures on DCLayerTree.cpp. CLOSED TREE 2022-09-06 23:35:51 +03:00
Kelsey Gilbert
24a9bc97bb Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-06 18:36:34 +00:00
Cristian Tuns
3d56a1da28 Backed out changeset b14b975aa6d7 (bug 1785925) for causing build bustages on GLBlitHelper.cpp CLOSED TREE 2022-09-02 20:12:33 -04:00
Kelsey Gilbert
75cccdd5cb Bug 1785925 - Add LUT and Colorspace support to GLBlitHelper. r=lsalzman,media-playback-reviewers,alwu
This code was originally developed in bug 1771374, but here we omit the
DCLayerTree changes for later.

Differential Revision: https://phabricator.services.mozilla.com/D155027
2022-09-02 22:15:58 +00:00
Iulian Moraru
27d760c7c2 Backed out 9 changesets (bug 1771374) for causing mochitest-webgl failures. CLOSED TREE
Backed out changeset ded977dd1896 (bug 1771374)
Backed out changeset adeb8b7d48f9 (bug 1771374)
Backed out changeset 7767340872c5 (bug 1771374)
Backed out changeset 33282b4ffaae (bug 1771374)
Backed out changeset 75db498cd0e7 (bug 1771374)
Backed out changeset 70035903ea37 (bug 1771374)
Backed out changeset 7c7de0fb66e1 (bug 1771374)
Backed out changeset 615df05e016f (bug 1771374)
Backed out changeset ac3411d21928 (bug 1771374)
2022-08-02 03:38:09 +03:00
Kelsey Gilbert
0bd05e8c5c Bug 1771374 - Fix build and lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-08-01 19:49:27 +00:00
Kelsey Gilbert
fa6e66aedd Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-08-01 19:49:26 +00:00
Narcis Beleuzu
a9e7761934 Backed out 4 changesets (bug 1771374) for causing Google docs and maps rendering regressions. a=backout
Backed out changeset 9c65411d1843 (bug 1771374)
Backed out changeset 9f5cf953fcc8 (bug 1771374)
Backed out changeset 8b39f60971e4 (bug 1771374)
Backed out changeset ef52a6c462b6 (bug 1771374)
2022-07-14 00:43:56 +03:00
Kelsey Gilbert
f35027d825 Bug 1771374 - Fix build and lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-07-12 23:55:51 +00:00
Kelsey Gilbert
8eb05ff04b Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-07-12 23:55:50 +00:00
smolnar
3fa084ce2f Backed out 3 changesets (bug 1771374) for causing build bustage in gfx/gl/gtest/TestColorspaces.cpp CLOSED TREE
Backed out changeset 4d01f260c43a (bug 1771374)
Backed out changeset fc62679f0a6c (bug 1771374)
Backed out changeset f4f12470f8b7 (bug 1771374)
2022-06-30 21:19:17 +03:00
Kelsey Gilbert
ec0b1e1d29 Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-30 17:56:27 +00:00
Kelsey Gilbert
bb48a57a8a Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-30 17:56:26 +00:00
criss
d5ece910a9 Backed out 3 changesets (bug 1771374) for causing bustages on Colorspaces.h. CLOSED TREE
Backed out changeset 498c27656dc3 (bug 1771374)
Backed out changeset 6f97bc39643f (bug 1771374)
Backed out changeset b4fdb70808b6 (bug 1771374)
2022-06-30 05:28:11 +03:00
Kelsey Gilbert
8fdac7788a Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-29 23:38:23 +00:00
Kelsey Gilbert
c4f86e2e33 Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 23:38:22 +00:00
criss
efb5f18b59 Backed out 3 changesets (bug 1771374) for causing build bustages on GLBlitHelper.cpp. CLOSED TREE
Backed out changeset 71d40a0a3c9c (bug 1771374)
Backed out changeset 6a42df6834fe (bug 1771374)
Backed out changeset be888d0fd0bf (bug 1771374)
2022-06-30 01:12:46 +03:00
Kelsey Gilbert
7cf061700c Bug 1771374 - Fix lint warnings. r=gfx-reviewers,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D150620
2022-06-29 21:48:53 +00:00
Kelsey Gilbert
bad5d9146c Bug 1771374 - Support display-p3 output via DirectComposition on Windows. r=sotaro,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D150275
2022-06-29 21:48:52 +00:00
sotaro
4f8549101c Bug 1766282 - Do not use SharedHandle of ID3D11Texture2D of hardware decoded video during no video copy r=jgilbert,jrmuizel,gfx-reviewers
With CI's NVIDIA GPU, SharedHandle of ID3D11Texture2D of hardware decoded video during no video copy caused rendering problem. When SharedHandle is not used, the rendering problem did not happen. But when video is rendered to WebGL texture, SharedHandle need to be used.
In this case, D3D11TextureIMFSampleImage copies original ID3D11Texture2D to a new ID3D11Texture2D and use a shared handled of the copied texture. And no video copy of future video frames are disabled.

NoCopyNV12Texture is renamed to ZeroCopyNV12Texture to clarify its meaning.

Differential Revision: https://phabricator.services.mozilla.com/D144598
2022-05-20 04:37:53 +00:00
sotaro
33ec38c192 Bug 1757698 - Add D3D11TextureIMFSampleImage and array index handling to D3D11TextureData r=jgilbert,gfx-reviewers,jrmuizel
This is a preparation of Bug 1723207.

D3D11TextureIMFSampleImage is used for storing ID3D11Texture2D of IMFSample. Array index handling is added, since there are cases that hardware decoder uses array texture. D3D11TextureIMFSampleImage is expected to be used in GPU process.

Differential Revision: https://phabricator.services.mozilla.com/D140017
2022-03-03 02:30:28 +00:00
Jeff Gilbert
afdbf9538b Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
  references'.

Differential Revision: https://phabricator.services.mozilla.com/D115298
2021-06-25 19:16:22 +00:00
Iulian Moraru
1a8cb02555 Backed out changeset 10a229d128c0 (bug 1459526) for causing reftest failures on short.mp4.lastframe.html. CLOSED TREE 2021-06-25 06:34:36 +03:00
Jeff Gilbert
5c14187731 Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
  references'.

Differential Revision: https://phabricator.services.mozilla.com/D115298
2021-06-24 23:43:31 +00:00
Alexandru Michis
3477ca89c8 Backed out changeset f7016db57a2e (bug 1459526) for causing reftest failures.
CLOSED TREE
2021-06-18 07:49:06 +03:00
Jeff Gilbert
920429087b Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
  references'.

Differential Revision: https://phabricator.services.mozilla.com/D115298
2021-06-17 23:43:34 +00:00
Butkovits Atila
367d829107 Backed out changeset 318f32313091 (bug 1459526) for causing wrench bustages. CLOSED TREE 2021-06-17 04:45:11 +03:00
Jeff Gilbert
72024fcc23 Bug 1459526 - Handle full-range video in Webrender. r=gw,lsalzman
+ Begin to add video tests to ensure we ratchet towards correctness.
+ Test rec709 x (yuv420p, yuv420p10, gbrp) x (tv, pc) x codecs.
+ Just mark fuzziness for now. Better would be e.g. 16_127_233 'bad
  references'.

Differential Revision: https://phabricator.services.mozilla.com/D115298
2021-06-17 01:12:18 +00:00
Matt Woodrow
eaf110a595 Bug 1678656 - Don't rely on mPlanes to compute RenderTextureHost size, since it's only initialized when used with SWGL. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D104141
2021-02-09 04:38:24 +00:00
sotaro
3d7b9d1062 Bug 1683247 - Stop to create shared GL and WebRenderShaders in RenderDXGITextureHost::GetD3D11Texture2D() r=nical
sw-wr does not need shared GL and WebRenderShaders.

Differential Revision: https://phabricator.services.mozilla.com/D100081
2020-12-18 22:38:22 +00:00
Matt Woodrow
ec72f3a124 Bug 1673983 - Support using D3D11 textures as external compositor surfaces with D3D11 compositor. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D95800
2020-11-06 00:01:54 +00:00
Matt Woodrow
979882e86f Bug 1673983 - Add RenderTextureHostSWGL support to D3D11 RenderTextureHosts. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D95799
2020-11-06 00:01:36 +00:00
Narcis Beleuzu
37bd723824 Backed out 4 changesets (bug 1673983) for linting failure on moz.build CLOSED TREE
Backed out changeset f408fc890ba1 (bug 1673983)
Backed out changeset 49ae9de85ab9 (bug 1673983)
Backed out changeset 91d8f0f829fd (bug 1673983)
Backed out changeset 91cb8ee8ddd8 (bug 1673983)
2020-11-06 00:10:34 +02:00
Matt Woodrow
d3116d3c9e Bug 1673983 - Support using D3D11 textures as external compositor surfaces with D3D11 compositor. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D95800
2020-11-05 19:27:23 +00:00