Commit Graph

263 Commits

Author SHA1 Message Date
Kelsey Gilbert
a136c10eb3 Bug 1825673 - Implement WEBGL_provoking_vertex. r=gfx-reviewers,webidl,lsalzman,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D174197
2023-04-01 00:33:25 +00:00
Noemi Erli
ac328fe39f Backed out changeset bc8c5f1973ff (bug 1825673) for causing mochitest failures in test_GridElementWidthResizer.html CLOSED TREE 2023-03-31 23:14:09 +03:00
Kelsey Gilbert
9d47482195 Bug 1825673 - Implement WEBGL_provoking_vertex. r=gfx-reviewers,webidl,lsalzman,saschanaz
Differential Revision: https://phabricator.services.mozilla.com/D174197
2023-03-31 18:48:20 +00:00
Kelsey Gilbert
ecd474bc06 Bug 1812932 - Add size outvar to GetImageBuffer. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D171764
2023-03-21 18:05:09 +00:00
Cristina Horotan
4f0c1988f7 Backed out changeset 7657d29cd872 (bug 1812932) for causing bc failures at browser_view_image.js CLOSED TREE 2023-03-07 09:26:40 +02:00
Kelsey Gilbert
947ce14974 Bug 1812932 - Add size outvar to GetImageBuffer. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D171764
2023-03-07 04:52:04 +00:00
Tom Schuster
5422bb4186 Bug 1810489 - Do more precise RFP checks in WebGL. r=gfx-reviewers,nical,tjr
Depends on D166897

Differential Revision: https://phabricator.services.mozilla.com/D166898
2023-01-18 08:19:49 +00:00
Nika Layzell
8c037ef668 Bug 1806709 - Part 2: Clean up some trivial nsIPrincipal helper methods from nsIGlobalObject, r=asuth
These methods only existed because nsIGlobalObject::PrincipalOrNull was not
available off-main-thread, so can now be removed.

Depends on D165198

Differential Revision: https://phabricator.services.mozilla.com/D165199
2022-12-21 15:53:22 +00:00
sotaro
51aa6c3acf Bug 1688020 - Release image of SurfaceDescriptorD3D10 after WebGLContext::TexImage() also with in-process WebGL r=gfx-reviewers,lsalzman
Like Bug 1798624, image of SurfaceDescriptorD3D10  needs to be kept alive until WebGLContext::TexImage() call with in-process WebGL.

Differential Revision: https://phabricator.services.mozilla.com/D165109
2022-12-20 04:25:15 +00:00
Andrew McCreight
0a2c5523a4 Bug 1805931, part 1 - Declare Root and Unroot inline to save on boilerplate. r=smaug
Bug 181137 made ContentIteratorBase no longer refcounted, but
it did not remove this bit of CC boilerplate. With the inline
root, using this macro in a non-refcounted class is an error.

ObjectModel.h and ClientWebGLContext.cpp used macros to define
root and unroot, but that is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D164828
2022-12-15 19:45:00 +00:00
sotaro
7dc86c1c3b Bug 1776885 - Add capability of async remote texture on WebGL if CanvasRenderThread is used r=gfx-reviewers,lsalzman
The remote texture is processed asynchronously, but the WebGL rendering results are rendered synchronously with WebRender transaction by WebRender.

Async remote texture support is enabled only when CanvasRenderThread is used. This is to simplify implementation.

In async mode, remote texture of current RemoteTextureId might not be created yet when WebRenderImageHost::UseRemoteTexture() is called. In this case, RemoteTextureHostWrapper uses its own external image ID, otherwise the RemoteTextureHostWrapper uses compatible old remote texture for creating wr display list. RenderTextureHostWrapper calls RemoteTextureMap::GetExternalImageIdOfRemoteTextureSync() before is ussage. The GetExternalImageIdOfRemoteTextureSync() synchronously waits until remote texture becomes ready. The wait works since WebGL IPC handling is always done in CanvasRenderThread in async mode.

PWebGLChild::SendGetFrontBuffer() triggers sync IPC. It is called to ensure the compatible remote texture in RemoteTextureMap during RemoteTextureMap::GetRemoteTextureForDisplayList() call.

Differential Revision: https://phabricator.services.mozilla.com/D162971
2022-12-07 02:24:57 +00:00
Kelsey Gilbert
1882d16c5c Bug 1801095 - Don't expose webgl_-prefixed uniforms to webgl. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D164007
2022-12-07 02:14:03 +00:00
Stanca Serban
1adf82e4e3 Backed out changeset d78a41db7a82 (bug 1776885) for causing reftests failures in ReleaseCompositableRef. CLOSED TREE 2022-12-06 17:34:12 +02:00
sotaro
c30670232e Bug 1776885 - Add capability of async remote texture on WebGL if CanvasRenderThread is used r=gfx-reviewers,lsalzman
The remote texture is processed asynchronously, but the WebGL rendering results are rendered synchronously with WebRender transaction by WebRender.

Async remote texture support is enabled only when CanvasRenderThread is used. This is to simplify implementation.

In async mode, remote texture of current RemoteTextureId might not be created yet when WebRenderImageHost::UseRemoteTexture() is called. In this case, RemoteTextureHostWrapper uses its own external image ID, otherwise the RemoteTextureHostWrapper uses compatible old remote texture for creating wr display list. RenderTextureHostWrapper calls RemoteTextureMap::GetExternalImageIdOfRemoteTextureSync() before is ussage. The GetExternalImageIdOfRemoteTextureSync() synchronously waits until remote texture becomes ready. The wait works since WebGL IPC handling is always done in CanvasRenderThread in async mode.

PWebGLChild::SendGetFrontBuffer() triggers sync IPC. It is called to ensure the compatible remote texture in RemoteTextureMap during RemoteTextureMap::GetRemoteTextureForDisplayList() call.

Differential Revision: https://phabricator.services.mozilla.com/D162971
2022-12-06 13:56:19 +00:00
Kelsey Gilbert
8956c8564e Bug 1645092 - Don't fail GetUniform if the program is not current. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D163401
2022-11-30 08:18:10 +00:00
Csoregi Natalia
075a1e3d28 Backed out changeset 71ab84eb3e33 (bug 1645092) for causing build bustages. CLOSED TREE 2022-11-30 06:54:06 +02:00
Kelsey Gilbert
80b368135f Bug 1645092 - Don't fail GetUniform if the program is not current. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D163401
2022-11-30 04:23:40 +00:00
Botond Ballo
bcf265578a Bug 1802225 - Remove Layers.{h,cpp}. r=tnikkel,geckoview-reviewers,jgilbert,media-playback-reviewers,padenot,m_kato
Where appropriate, `#include "Layers.h"` is replaced with
more specific inclusions.

Differential Revision: https://phabricator.services.mozilla.com/D162934
2022-11-29 01:52:03 +00:00
Lee Salzman
954f87098c Bug 1799402 - Use WGR to rasterize paths in DrawTargetWebgl. r=jrmuizel
This adds a path vertex buffer where triangle list output from WGR is stored.
Each PathCacheEntry can potentially reference a range of vertexes in this buffer
corresponding to triangles for that entry. When this buffer is full, it gets
orphaned and clears corresponding cache entries, so that it can start anew.

Differential Revision: https://phabricator.services.mozilla.com/D161479
2022-11-12 08:06:44 +00:00
Iulian Moraru
f876a9fbe3 Backed out 3 changesets (bug 1799402) for causing windows build bustages. CLOSED TREE
Backed out changeset e51cd76008ef (bug 1799402)
Backed out changeset 3ff660b475ff (bug 1799402)
Backed out changeset 9cfa7581565e (bug 1799402)
2022-11-12 08:33:24 +02:00
Lee Salzman
d603ff9f26 Bug 1799402 - Use WGR to rasterize paths in DrawTargetWebgl. r=jrmuizel
This adds a path vertex buffer where triangle list output from WGR is stored.
Each PathCacheEntry can potentially reference a range of vertexes in this buffer
corresponding to triangles for that entry. When this buffer is full, it gets
orphaned and clears corresponding cache entries, so that it can start anew.

Differential Revision: https://phabricator.services.mozilla.com/D161479
2022-11-12 05:42:30 +00:00
Emilio Cobos Álvarez
12e596995e Bug 1799435 - Make RFP checks faster. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161447
2022-11-08 02:36:25 +00:00
sotaro
fd61fca0e0 Bug 1798624 - Release image of SurfaceDescriptorD3D10 on Send-side after Ping response r=jgilbert,gfx-reviewers
GPUVideoTextureClient of SurfaceDescriptorD3D10 needs to be kept alive until WebGLParent::RecvTexImage() is handled by parent side.

Confirmed that test_conformance__textures__misc__texture-npot-video.html test failure was addressed.

Differential Revision: https://phabricator.services.mozilla.com/D161015
2022-11-08 00:32:17 +00:00
Sandor Molnar
93a6e1c506 Backed out changeset c7f5349824c4 (bug 1799435) for causing crashes in mozilla::dom::HTMLImageElement::LoadSelectedImage CLOSED TREE 2022-11-08 02:39:14 +02:00
Emilio Cobos Álvarez
79700d8de9 Bug 1799435 - Make RFP checks faster. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161447
2022-11-07 22:23:50 +00:00
Iulian Moraru
281af99f4d Backed out changeset 44cb21194dc0 (bug 1799435) for causing multiple resist fingerprint related failures. CLOSED TREE 2022-11-07 18:42:11 +02:00
Emilio Cobos Álvarez
553deca383 Bug 1799435 - Make RFP checks faster. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D161447
2022-11-07 14:40:57 +00:00
Kelsey Gilbert
47073a4193 Bug 1798703 - Enforce alignment for UniformData via union rather than overalignment. r=lsalzman
Reverts the overalignment from bug 1794237.

Differential Revision: https://phabricator.services.mozilla.com/D161360
2022-11-07 07:24:43 +00:00
sotaro
5b2be73b02 Bug 1795050 - Set mResetLayer = true in ClientWebGLContext::Event_webglcontextrestored() r=gfx-reviewers,lsalzman
There was still a timing that hit the assert. When ClientWebGLContext::Event_webglcontextrestored() was called just before ClientWebGLContext::UpdateWebRenderCanvasData() the assert was failed.

Differential Revision: https://phabricator.services.mozilla.com/D161243
2022-11-05 04:14:31 +00:00
Kelsey Gilbert
90d7e92a52 Bug 1798539 - Release temp shmem on Send-side after Ping response. r=gfx-reviewers,lsalzman
Originally, we special-cased shmems to try to send them directly
without a copy.
Unfortunately, ipc::Shmem doesn't support that, so we
allocated a new shmem on PWebGL and sent that.
However, we didn't include shmem-cleanup steps in RecvTexImage, so we
leaked the shmem.

We would be tempted to check inside the Desc in RecvTexImage and cleanup that
shmem, *however* RawTexImage from dtwebgl also uses this path, and its shmems
are UnsafeShmems, which are *not* supposed to be cleaned up.

Rather than adding e.g. a bool to differentiate them, let's just explicitly do
the cleanup in the caller that knows it needs to clean up.

One pattern I want to use more often for cross-process lifetimes is:
```
  foo = new RefcountedResource();
  SendUseAsync(foo);
  SendPing()->Then([foo]() {});
```

By the time we the promise from SendPing is resolved, we know the remote side is
done with `foo`, and so our trivial capturing lambda will take care of releasing
it on the Send side. It's straightforward and safe, and the lifetimes have one
extra return-trip of latency, but that's almost always fine.

Differential Revision: https://phabricator.services.mozilla.com/D160996
2022-11-02 05:22:09 +00:00
sotaro
a76c64f383 Bug 1795050 - Add context lost check to ClientWebGLContext::UpdateWebRenderCanvasData() r=gfx-reviewers,lsalzman
There was a case that context was lost with mResetLayer=false.

Differential Revision: https://phabricator.services.mozilla.com/D160874
2022-11-01 08:13:54 +00:00
Kelsey Gilbert
4c04190335 Bug 1696693 - Don't blit-tex-upload for srgb textures. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D159649
2022-10-19 01:22:43 +00:00
Kelsey Gilbert
49a2625ba0 Bug 1794956 - TransferToImageBitmap should reset bitmap but not state. r=gfx-reviewers,lsalzman
s/Reset/ResetBitmap/ and implement for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D159346
2022-10-16 22:52:40 +00:00
Iulian Moraru
bd5791d52c Backed out 2 changesets (bug 1794956) for causing wpt failures on offscreencanvas.transfer.to.imagebitmap.html. CLOSED TREE
Backed out changeset 7b3067b086e6 (bug 1794956)
Backed out changeset 3abcf6ccf88a (bug 1794956)
2022-10-15 19:09:01 +03:00
Kelsey Gilbert
b3044b4370 Bug 1794956 - TransferToImageBitmap should reset bitmap but not state. r=gfx-reviewers,lsalzman
s/Reset/ResetBitmap/ and implement for WebGL and WebGPU.

Differential Revision: https://phabricator.services.mozilla.com/D159346
2022-10-15 09:01:46 +00:00
Kelsey Gilbert
15bd2c460d Bug 1795372 - Remove redundant keepalives. r=gfx-reviewers,lsalzman
Now that FuncScope keepalives mNotLost, individual functions don't need
to.

Differential Revision: https://phabricator.services.mozilla.com/D159431
2022-10-14 23:10:19 +00:00
Kelsey Gilbert
6e859e38e2 Bug 1795372 - Keepalive mNotLost within FuncScope. r=gfx-reviewers,lsalzman
Also remove unused FuncScopeId.

Differential Revision: https://phabricator.services.mozilla.com/D159428
2022-10-14 23:10:19 +00:00
Butkovits Atila
81f677aaef Backed out changeset 0a2985a48339 (bug 1769747) for causing gl failures. 2022-10-05 01:38:13 +03:00
Kelsey Gilbert
621abd235f Bug 1769747 - Support non-RGBA video-to-texture fastpath. r=gfx-reviewers,nical
Also scale back some asserts from debug-fatal to just warnings, because
I kept hitting them during testing because of our poor surface lifetime
handling.

Differential Revision: https://phabricator.services.mozilla.com/D157993
2022-10-04 20:31:42 +00:00
sotaro
84347a9ce9 Bug 1792008 - Check size when mNotLost->mCanvasRenderer is re-used r=lsalzman,gfx-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D158096
2022-09-26 05:14:45 +00:00
Kelsey Gilbert
ffedef7b34 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
Kelsey Gilbert
126d92764e Bug 1755973 - Try implied arr+[0] in GetUniformIndices. r=gfx-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D156622
2022-09-12 21:51:55 +00:00
Marian-Vasile Laza
2947853aa8 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
9d63573c9c 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
5441faef5e 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
3f0e56383e 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
Andrew Osmond
3da96b6b2b Bug 1782722 - Make WebGL override unmasked renderer/vendor pref accesses thread safe. r=gfx-reviewers,lsalzman,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D153469
2022-08-16 01:00:22 +00:00
Kelsey Gilbert
5edd8d5841 Bug 1778808 - Use stricter TiedFields instead of IsTriviallySerializable in WebGL's QueueParamTraits. r=lsalzman,nika
```
// We guarantee our robustness via these requirements:
// * Object.MutTiedFields() gives us a tuple,
// * where the combined sizeofs all field types sums to sizeof(Object),
//   * (thus we know we are exhaustively listing all fields)
// * where feeding each field back into ParamTraits succeeds,
// * and ParamTraits is only automated for BytesAlwaysValidT<T> types.
// (BytesAlwaysValidT rejects bool and enum types, and only accepts int/float
// types, or array or std::arrays of such types)
// (Yes, bit-field fields are rejected by MutTiedFields too)
```

BytesAlwaysValidT<T> is the same as the IsTriviallySerializable<T> that
it replaces, however the emphasis is different, and should discourage
tagging structs as IsTriviallySerializable, since they more clearly
aren't BytesAlwaysValid.

Differential Revision: https://phabricator.services.mozilla.com/D151676
2022-08-09 21:01:55 +00:00
Kelsey Gilbert
5787ea3eb1 Bug 1778549 - Don't crash on validation failure in ReadPixelsPbo. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D153423
2022-08-03 06:10:31 +00:00
Iulian Moraru
1352b09cab 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