Граф коммитов

42 Коммитов

Автор SHA1 Сообщение Дата
Imanol Fernandez cc77358c6f Bug 1646073 - Enable WebGL SwapChain pooling on Android. Use a separate SwapChain for WebVR. r=jgilbert
- Enable WebGL SwapChain pooling on Android. Creating and releasing Android Surfaces every frame causes a big performance hit due to AndroidSurface slow destructors bug.
- Add a separate SwapChain for WebVR. We are already using separate SwapChains for WebXR (WebGLFramebuffer::mOpaqueSwapChain) but not for WebVR (it uses the canvas backbuffer).

Differential Revision: https://phabricator.services.mozilla.com/D79840
2020-06-17 18:56:16 +00:00
Jeff Gilbert fac855a09e Bug 1632249 - Determine webgl's layers::TextureType in Present. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D79617
2020-06-15 18:26:14 +00:00
Jeff Gilbert 3ae501809c Bug 1632249 - NON_PREMULT TextureClient iff NON_PREMULT CanvasClient. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D78800
2020-06-15 18:26:02 +00:00
Jeff Gilbert fd44ed35e8 Bug 1632249 - WebXR compositing fixes. r=imanol
Differential Revision: https://phabricator.services.mozilla.com/D78117
2020-06-15 18:25:58 +00:00
Jeff Gilbert a97c615de2 Bug 1632249 - Support compositing out-of-process WebGL. r=handyman,lsalzman,nical,geckoview-reviewers,agi,imanol
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
  to propagate
* Mortgage/strip out more OffscreenCanvas code for now

Differential Revision: https://phabricator.services.mozilla.com/D75055
2020-06-15 18:25:55 +00:00
Dorel Luca 255f146f14 Backed out 7 changesets (bug 1632249) for Gtest perma chrash in [@ mozilla::BlockingResourceBase::CheckAcquire()]. CLOSED TREE
Backed out changeset 4ff99aab3ee8 (bug 1632249)
Backed out changeset d5b7fe789001 (bug 1632249)
Backed out changeset 64fbb616a0f3 (bug 1632249)
Backed out changeset 6f19f43e0a0b (bug 1632249)
Backed out changeset 073302d26c5e (bug 1632249)
Backed out changeset 7c94d37c446e (bug 1632249)
Backed out changeset 204b899f436d (bug 1632249)
2020-06-11 19:44:20 +03:00
Jeff Gilbert 2ac2690670 Bug 1632249 - NON_PREMULT TextureClient iff NON_PREMULT CanvasClient. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D78800
2020-06-11 06:37:40 +00:00
Jeff Gilbert 06fa957778 Bug 1632249 - WebXR compositing fixes. r=imanol
Differential Revision: https://phabricator.services.mozilla.com/D78117
2020-06-11 06:37:36 +00:00
Jeff Gilbert cf3c8fedea Bug 1632249 - Support compositing out-of-process WebGL. r=handyman,lsalzman,nical,geckoview-reviewers,agi,imanol
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
  to propagate
* Mortgage/strip out more OffscreenCanvas code for now

Differential Revision: https://phabricator.services.mozilla.com/D75055
2020-06-11 06:37:35 +00:00
Mihai Alexandru Michis 59ad7ed333 Backed out 6 changesets (bug 1632249) for causing bustages in CanvasRenderingContext2D.cpp
CLOSED TREE

Backed out changeset c93972b05d4f (bug 1632249)
Backed out changeset 04f5127c85d5 (bug 1632249)
Backed out changeset b15d91e64a25 (bug 1632249)
Backed out changeset 71ad2ed8e9ba (bug 1632249)
Backed out changeset 6e9a89ead3a5 (bug 1632249)
Backed out changeset dd00e2da3a0f (bug 1632249)
2020-06-11 02:43:35 +03:00
Jeff Gilbert d415e13cc1 Bug 1632249 - NON_PREMULT TextureClient iff NON_PREMULT CanvasClient. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D78800
2020-06-10 22:21:09 +00:00
Jeff Gilbert 28d2828abe Bug 1632249 - WebXR compositing fixes. r=imanol
Differential Revision: https://phabricator.services.mozilla.com/D78117
2020-06-10 22:21:04 +00:00
Jeff Gilbert 9b09e54345 Bug 1632249 - Support compositing out-of-process WebGL. r=handyman,lsalzman,nical,geckoview-reviewers,agi,imanol
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
  to propagate
* Mortgage/strip out more OffscreenCanvas code for now

Differential Revision: https://phabricator.services.mozilla.com/D75055
2020-06-10 22:21:02 +00:00
Dorel Luca 7289b66d6f Backed out 4 changesets (bug 1632249) for Build bustages and mda failures. CLOSED TREE
Backed out changeset cdaa8a4e9e36 (bug 1632249)
Backed out changeset 9ff26bcc580c (bug 1632249)
Backed out changeset 16d84439756f (bug 1632249)
Backed out changeset bbfe23c61add (bug 1632249)
2020-06-09 03:19:48 +03:00
Jeff Gilbert e29ee2bc92 Bug 1632249 - NON_PREMULT TextureClient iff NON_PREMULT CanvasClient. r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D78800
2020-06-08 20:58:03 +00:00
Jeff Gilbert 8d174dfafc Bug 1632249 - WebXR compositing fixes. r=imanol
Differential Revision: https://phabricator.services.mozilla.com/D78117
2020-06-08 20:36:14 +00:00
Jeff Gilbert de6377896c Bug 1632249 - Support compositing out-of-process WebGL. r=handyman,lsalzman,nical,geckoview-reviewers,agi,imanol
* Majorly simplity CanvasRenderer
* Replace GLScreenBuffer with trivial GLSwapChain
* Use descriptor structs so that future SharedSurface changes aren't so painful
  to propagate
* Mortgage/strip out more OffscreenCanvas code for now

Differential Revision: https://phabricator.services.mozilla.com/D75055
2020-06-08 20:34:15 +00:00
Imanol Fernandez 201362531f Bug 1640912 - Update xrCompatible flag when WebGLContext::makeXRCompatible call succeeds r=jgilbert,kip,daoshengmu
Currently WebGL xrCompatible flag is only set when enabling the xrCompatible attribute in the canvas.getContext() call. We also need to set it to true after succesful makeXRCompatible() calls

Differential Revision: https://phabricator.services.mozilla.com/D76849
2020-06-03 00:49:45 +00:00
Jeff Gilbert f1608c2899 Bug 1636525 - Implicitly EndQuery before DeleteQuery. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D76941
2020-05-26 22:08:44 +00:00
David Parks 710d6e1015 Bug 1627305: Remove non-trivial macros from WebGL CommandQueue code r=jgilbert
Replaces DECLARE_METHOD_DISPATCHER and DEFINE_METHOD_DISPATCHER with generic classes.

Differential Revision: https://phabricator.services.mozilla.com/D69676
2020-04-30 22:25:09 +00:00
David Parks cbf4e1a5cc Bug 1621762: Part 7 - Add IpdlQueue actor traits to WebGLParent/WebGLChild r=jgilbert,jld
Adds IpdlQueue capability to PWebGL actors.  The WebGLChild, used in content processes, implements SyncProducerActor and AsyncConsumerActor because it sends (sync and async) messages and receives responses to them that it reads as async messages.  The WebGLParent, used in the compositor process, is a SyncConsumerActor and AsyncProducerActor for dual reasons.

Differential Revision: https://phabricator.services.mozilla.com/D68264
2020-04-30 22:24:44 +00:00
David Parks 8bd91e6a36 Bug 1621762: Part 3 - Make some classes generic to support multiple remote WebGL implementations r=jgilbert
* Templatize ProducerView/ConsumerView/(Sync)CommandSource/(Sync)CommandSink to allow both Pcq and Ipdl versions, as the client code is identical.
* Rename Producer/Consumer -> PcqProducer/PcqConsumer.

Differential Revision: https://phabricator.services.mozilla.com/D68259
2020-04-30 22:23:02 +00:00
David Parks ac84c81927 Bug 1621762 - Part 1: Basic refactoring of ProducerConsumerQueue & CommandQueue r=jgilbert
A lot of simple changes to prepare for later patches in the series:

* PcqCommand -> QueueCommand, PcqStatus -> QueueStatus, PcqParamTraits -> QueueParamTraits
* Consolidate BasicSink/Source into CommandSink/Source
* SyncCommandSource::mConsumer -> mResponseSink, SyncCommandSink::mProducer -> mResponseSource, CommandSource::mProducer -> mSource, CommandSink::mConsumer -> mSink
* Rename WebGLPcqParamTraits.h to WebGLQueueParamTraits.h
* ProducerConsumerQueue struct -> class.
* ProducerConsumerQueue::mProducer/mConsumer access -> ProducerConsumerQueue::TakeProducer/TakeConsumer
* Rename QueueStatus enum elements to follow style convention.
* Rename Status() to GetStatus() in ProducerView and ConsumerView to appease Linux.
* Rename CommandResult enum values to fit convention (and avoid Linux conflict with Success).

Differential Revision: https://phabricator.services.mozilla.com/D68256
2020-04-30 22:21:45 +00:00
Daniel Varga 452acadb3b Backed out 7 changesets (bug 1621762) for causing build bustages at builds/worker/workspace/obj-build/dist/include/mozilla/dom/ProducerConsumerQueue.h
CLOSED TREE

Backed out changeset 03903e8f368e (bug 1621762)
Backed out changeset 21ef72486643 (bug 1621762)
Backed out changeset 70d103786c83 (bug 1621762)
Backed out changeset a3e1332998c3 (bug 1621762)
Backed out changeset 010f653b87d2 (bug 1621762)
Backed out changeset 0496adcb4582 (bug 1621762)
Backed out changeset 8d85420fd2e6 (bug 1621762)
2020-04-30 06:06:33 +03:00
David Parks 053f3b98ca Bug 1621762: Part 7 - Add IpdlQueue actor traits to WebGLParent/WebGLChild r=jgilbert,jld
Adds IpdlQueue capability to PWebGL actors.  The WebGLChild, used in content processes, implements SyncProducerActor and AsyncConsumerActor because it sends (sync and async) messages and receives responses to them that it reads as async messages.  The WebGLParent, used in the compositor process, is a SyncConsumerActor and AsyncProducerActor for dual reasons.

Differential Revision: https://phabricator.services.mozilla.com/D68264
2020-04-30 01:56:55 +00:00
David Parks b360387b15 Bug 1621762: Part 3 - Make some classes generic to support multiple remote WebGL implementations r=jgilbert
* Templatize ProducerView/ConsumerView/(Sync)CommandSource/(Sync)CommandSink to allow both Pcq and Ipdl versions, as the client code is identical.
* Rename Producer/Consumer -> PcqProducer/PcqConsumer.

Differential Revision: https://phabricator.services.mozilla.com/D68259
2020-04-30 01:25:27 +00:00
David Parks 97aef305f8 Bug 1621762 - Part 1: Basic refactoring of ProducerConsumerQueue & CommandQueue r=jgilbert
A lot of simple changes to prepare for later patches in the series:

* PcqCommand -> QueueCommand, PcqStatus -> QueueStatus, PcqParamTraits -> QueueParamTraits
* Consolidate BasicSink/Source into CommandSink/Source
* SyncCommandSource::mConsumer -> mResponseSink, SyncCommandSink::mProducer -> mResponseSource, CommandSource::mProducer -> mSource, CommandSink::mConsumer -> mSink
* Rename WebGLPcqParamTraits.h to WebGLQueueParamTraits.h
* ProducerConsumerQueue struct -> class.
* ProducerConsumerQueue::mProducer/mConsumer access -> ProducerConsumerQueue::TakeProducer/TakeConsumer
* Rename QueueStatus enum elements to follow style convention.
* Rename Status() to GetStatus() in ProducerView and ConsumerView to appease Linux.
* Rename CommandResult enum values to fit convention (and avoid Linux conflict with Success).

Differential Revision: https://phabricator.services.mozilla.com/D68256
2020-04-30 01:19:33 +00:00
Imanol Fernandez 9035f18d3a Bug 1614499 - Implement XRWebGLLayer r=jgilbert,daoshengmu
Differential Revision: https://phabricator.services.mozilla.com/D62809

--HG--
extra : moz-landing-system : lando
2020-04-07 18:48:13 +00:00
Kearwood Gilbert 9136ce65cf Bug 1614496 - Implement WebXR Core Module DOM Interfaces r=jgilbert,daoshengmu,webidl,smaug,baku,imanol
Implement DOM interfaces for the WebXR Core Module. Additional work to implement the WebXR Core Module are marked with TODO (Bug #) comments within the patch and must be landed before enabling the dom.vr.webxr.enabled flag.

Differential Revision: https://phabricator.services.mozilla.com/D62369

--HG--
extra : moz-landing-system : lando
2020-04-06 19:33:32 +00:00
Jeff Gilbert 0e2a962631 Bug 1624944 - Uniform data uploads should accept SharedArrayBuffers. r=webidl,hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D68508

--HG--
extra : moz-landing-system : lando
2020-03-27 08:37:28 +00:00
Mike Hommey 082a30140e Bug 1621518 - Fix build errors with -Werror=format-security with GCC. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D66355

--HG--
extra : moz-landing-system : lando
2020-03-11 03:30:11 +00:00
Jeff Gilbert 49926cf5f0 Bug 1617326 - Fix WebGL CTS/conformance2/extensions/* on Windows. r=lsalzman
* Multiview detach shouldn't check for INVALID_VALUE.
* Forbid blitting to multiview.
* GetSamplerParameter(ANISOTROPIC) should work, modulo enabledness.

Differential Revision: https://phabricator.services.mozilla.com/D63743

--HG--
extra : moz-landing-system : lando
2020-02-23 04:22:54 +00:00
Razvan Maries b5b83a0cb5 Backed out changeset e4c9e943a369 (bug 1617326) for Mochitest perma failures on test_2_conformance2__extensions__ext-texture-filter-anisotropic.html. 2020-02-23 01:27:14 +02:00
Jeff Gilbert cf873c7ace Bug 1617326 - Fix WebGL CTS/conformance2/extensions/* on Windows. r=lsalzman
* Multiview detach shouldn't check for INVALID_VALUE.
* Forbid blitting to multiview.
* GetSamplerParameter(ANISOTROPIC) should work, modulo enabledness.

Differential Revision: https://phabricator.services.mozilla.com/D63743

--HG--
extra : moz-landing-system : lando
2020-02-22 20:51:09 +00:00
Jeff Gilbert 1abd55a851 Bug 1616715 - Make ReadPixelDesc per-call. r=lsalzman
GetSurfaceSnapshot (and similar) want to ReadPixels the backbuffer,
without having to navigate the GL PIXEL_PACK state.
Since this is cold cold code, it's nice to reduce the backend state by
making ReadPixelsDesc/PixelPackState per-call, and tracked by the
client. Arguably, PIXEL_PACK_BUFFER should be per-call as well.

Differential Revision: https://phabricator.services.mozilla.com/D63587

--HG--
extra : moz-landing-system : lando
2020-02-21 03:12:41 +00:00
Jeff Gilbert 165c15a8f3 Bug 1613106 - Add missing context loss check. r=lsalzman
The call to InitializeCanvasRenderer earlier in the function can lose
the context.

Differential Revision: https://phabricator.services.mozilla.com/D62100

--HG--
extra : moz-landing-system : lando
2020-02-07 20:19:43 +00:00
Jeff Gilbert 3c0ff11f59 Bug 1609908 - Reset WebGL layer on resize. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D60755

--HG--
extra : moz-landing-system : lando
2020-01-23 22:32:57 +00:00
Jeff Gilbert 2c2c0487c0 Bug 1609006 - 0x0 canvas yields 1x1 webgl context. r=lsalzman
Also, always resize, not just on change. (As per spec)

Differential Revision: https://phabricator.services.mozilla.com/D59967

--HG--
extra : moz-landing-system : lando
2020-01-15 05:13:53 +00:00
Jeff Gilbert f26e4d546b Bug 1477756 - Fix non-webgl CI tests. r=handyman
* Revert some partial webgl+oop+vr code.
* More missing FuncScope.
* Fix compile errors.
* Refactor some ifdef'd code to branch and compile on all platforms.
* -Wno-error=unused-result for GCC to allow for (void)MustUse().

Depends on D55739

Differential Revision: https://phabricator.services.mozilla.com/D56169

--HG--
extra : moz-landing-system : lando
2020-01-08 22:19:26 +00:00
Jeff Gilbert 0dfd1a2a0d Bug 1477756 - Fix all webgl regression tests according to CI. r=handyman
(This is a combination of 31 commits)

* Fix Linux compilation.

* Fix mac compilation.

* CI compile fixes.

* printf's size_t is %zu. %tu would be unsigned ptrdiff_t.

* No non-ref Maybe args.

* MOZ_CRASH for noreturn

* Handle implied texture sizes, rewrite comment stripping.

* Replace e.g. WebGLProgramInner with simpler webgl::ProgramKeepAlive.

* Bounce ValidateProgram call off driver.

* Uniform name length limit, cubemap fb-attach, non-array uniforms, undersized texImage views.

* alignas for uint8_t[sizeof(float)*N] pun buffers.

* CC fixes?

* Fill attrib0Active.

* Repair max-warnings limit.

* This is basically required in order for CI's logging to not explode.

* Don't cache WebGLMemoryTracker.

* Deleted prog/shader error, no texSubImage(null), client-side fingerprint resist for exts.

* Fix GetUniformIndices and MakeRangeFromView.

* CC Traverse base class from within derived class to fix leaking the world. :(

* PauseTransformFeedback
* TexImage video fastpath
* GetFragLocation for arrays
* Forbid BindBufferRange during TF

* Mark tests and fix RBAB query and test.

* Change(!) query deletion behavior to match spec.
* Mark conformance2/query/query.html failing for now.

* Implicitly EndQuery on DeleteQuery while spec is in flux.

* Fix error code for test.

* RAII LruPosition for WebGL context limit.

* Include std::list.

* Mark CompileResult and LinkResult.pending as false when retrieved.

* Hold strong-ref to NotLostData during Run<> to prevent LoseContext=>UAF.

* Don't assume GetUniformLocation(foo+'[0]') means foo is an array.
* Don't assume !mCanvasElement means !!mOffscreenCanvas.

* Handle composition while context-lost.

* All non-value-init members must be const or have inline init.

* Mark passing tests on Linux.

Depends on D54019

Differential Revision: https://phabricator.services.mozilla.com/D55739

--HG--
extra : moz-landing-system : lando
2020-01-08 22:19:23 +00:00
Jeff Gilbert e1d0fe64bb Bug 1477756 - Client-side bindings mirror for precise CC, and merge similar codepaths. r=handyman
* Context loss using RAII
* Move Program reflection Client-side

Depends on D54018

Differential Revision: https://phabricator.services.mozilla.com/D54019

--HG--
extra : moz-landing-system : lando
2020-01-08 22:19:16 +00:00
David Parks 198fa063c2 Bug 1477756 - Initial out-of-process WebGL implementation. r=mccr8,handyman
Splits WebGLContext into ClientWebGLContext and HostWebGLContext.  The Client enables the JS-control of a WebGL context in a content procecss while the Host executes the WebGL graphics operations (via a WebGLContext that maintains much of the existing code) in the compositor process.  At this point, the cross-process behavior is disabled -- this series of patches is an incremental step toward that final goal.

Differential Revision: https://phabricator.services.mozilla.com/D54018

--HG--
extra : moz-landing-system : lando
2020-01-08 22:19:14 +00:00