Refactor WebGL in preparation for proxying WebGL operations using GPU process for sandboxing
Categories
(Core :: Graphics: CanvasWebGL, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | verified |
People
(Reporter: handyman, Assigned: jgilbert)
References
(Regressed 1 open bug)
Details
(Whiteboard: [fxr-ww][geckoview:fxr:p1])
Attachments
(11 files, 15 obsolete files)
46 bytes,
text/x-phabricator-request
|
Details | Review | |
46 bytes,
text/x-phabricator-request
|
Details | Review | |
46 bytes,
text/x-phabricator-request
|
Details | Review | |
46 bytes,
text/x-phabricator-request
|
Details | Review | |
46 bytes,
text/x-phabricator-request
|
Details | Review | |
21.90 KB,
text/plain
|
Details | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Reporter | ||
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•7 years ago
|
||
Reporter | ||
Comment 3•7 years ago
|
||
Reporter | ||
Comment 4•7 years ago
|
||
Reporter | ||
Comment 5•7 years ago
|
||
Reporter | ||
Comment 6•7 years ago
|
||
Reporter | ||
Comment 7•7 years ago
|
||
Reporter | ||
Comment 8•7 years ago
|
||
Reporter | ||
Comment 9•7 years ago
|
||
Reporter | ||
Comment 10•7 years ago
|
||
Reporter | ||
Comment 11•7 years ago
|
||
Reporter | ||
Comment 12•7 years ago
|
||
Reporter | ||
Comment 13•7 years ago
|
||
Reporter | ||
Comment 14•7 years ago
|
||
Reporter | ||
Comment 15•7 years ago
|
||
Reporter | ||
Updated•7 years ago
|
![]() |
||
Comment 16•7 years ago
|
||
Reporter | ||
Comment 17•7 years ago
|
||
Comment 18•7 years ago
|
||
![]() |
||
Updated•7 years ago
|
![]() |
||
Updated•7 years ago
|
Reporter | ||
Comment 19•7 years ago
|
||
Comment 20•7 years ago
|
||
Updated•7 years ago
|
Reporter | ||
Comment 21•7 years ago
|
||
Updated•7 years ago
|
Reporter | ||
Comment 22•7 years ago
|
||
Reporter | ||
Comment 23•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 24•7 years ago
|
||
Reporter | ||
Comment 25•7 years ago
|
||
Comment 26•7 years ago
|
||
![]() |
||
Updated•7 years ago
|
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Comment 28•7 years ago
|
||
This is my latest, a bit cleaned up but obviously not well organized as the patch is 750K. The checkin comment has a bit of detail on how it works. This won't build or anything but it should hopefully illustrate any sticking points.
Reporter | ||
Comment 29•7 years ago
|
||
Work was moved to GitHub: https://github.com/davidp3/gecko-dev/tree/remote-webgl
Updated•7 years ago
|
Comment 30•7 years ago
|
||
Adding [geckoview:fxr:p1]
whiteboard tag to track this bug for GeckoView in Firefox Reality. Ehsan says Firefox Reality spends "around 22% of each frame waiting for the GL driver on the main thread; asynchronous WebGL would eliminate most of that waiting and increase the FPS by up to 28%."
Assignee | ||
Comment 31•7 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #30)
Adding
[geckoview:fxr:p1]
whiteboard tag to track this bug for GeckoView in Firefox Reality. Ehsan says Firefox Reality spends "around 22% of each frame waiting for the GL driver on the main thread; asynchronous WebGL would eliminate most of that waiting and increase the FPS by up to 28%."
I disagree with this assessment.
Assignee | ||
Comment 32•7 years ago
|
||
I expect initial performance of remoted WebGL to be similar-to-worse than present WebGL, at least for the initial landing.
There are no free lunches here.
Comment 33•7 years ago
|
||
Why is that? Because of the cost of the command serialization? And are you referring to frame rate overall or to the time spent on the main thread?
Assignee | ||
Comment 34•7 years ago
|
||
Extra copies, ser/deser costs, and various synchronizations. Initially, we're going to have a greater than ideal number of synchronization points, which we'll be burning down in time, and in response to profiling of content.
Assignee | ||
Comment 35•6 years ago
|
||
(P2 because it's not necessarily aiming for this next release, and P1 here would mean "aiming for this current Nightly")
Assignee | ||
Comment 36•6 years ago
|
||
Producer-consumer queues are often implemented with 2 semaphores that track how
much data/room is in the queue. This is not that -- that makes the processes
more synchronized than is necessary and requires us to be able to track how
much room is left, which qould require the semaphore to track the number of
bytes used/remaining, since we permit variable message lengths. And
CrossProcessSemaphores can only increment/decrement one at a time (thanks,
Windows), which would make byte count tracking with semaphore operations O(n)
per transaction instead of O(1).
This implementation avoids all of that -- careful analysis bounds the semaphore
values to a maximum of 2.
Assignee | ||
Comment 37•6 years ago
|
||
- Context loss using RAII
- Move Program reflection Client-side
Assignee | ||
Comment 38•6 years ago
|
||
Unity 2018 benchmark (https://files.unity3d.com/marcot/benchmarks2018.2.5f1/) runs roughly equivalent after fixing that I never marked LinkResult.pending = false. :)
Assignee | ||
Comment 39•6 years ago
|
||
(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.
Assignee | ||
Comment 40•6 years ago
|
||
- 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().
Reporter | ||
Comment 41•6 years ago
|
||
Moved some things, removed some things, blah blah blah.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Updated•6 years ago
|
Comment 42•6 years ago
|
||
Comment 43•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/71c122ac0ca7
https://hg.mozilla.org/mozilla-central/rev/ccfa767dba64
https://hg.mozilla.org/mozilla-central/rev/7e2a2b1b416f
https://hg.mozilla.org/mozilla-central/rev/e1b0906509ef
Assignee | ||
Updated•6 years ago
|
Comment 45•6 years ago
|
||
This feels like something we should get QA smoketesting ASAP since my understanding is that we don't have a lot of options with respect to backing out or disabling if major bugs are found before 74 goes to release.
Comment 46•6 years ago
|
||
Hi, Are there any steps or test pages we could use in order to verify this enhancement ?
Assignee | ||
Comment 47•6 years ago
|
||
Nothing specifically. https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html is the online version of the conformance tests, for which this shouldn't crash, and shouldn't cause toooo many failures. We run this on CI though.
Google Maps might be worth testing, but we expect a ton of bug reports if anything happens there. We expect to have pretty good verification by staying on top of bug and crash triage here.
Comment 48•6 years ago
|
||
I've tested this enhancement on Windows 10 and Mac 10.15.3 using the webGL conformance tests in Beta 74.0b7 and I got the following results:
Macintosh -
Test Summary: FAIL (2753 tests):
290846 subtests ran in 3571.65 seconds
PASSED: 2538 tests, 280536 subtests
NOT PASSED: 215 tests, 10310 subtests
FAILED: 215 tests, 10310 subtests
TIMED OUT: 0 tests, 0 subtests
SKIPPED: 0 tests, 0 subtests
Windows 10 -
Test Summary: FAIL (2753 tests):
289144 subtests ran in 7597.37 seconds
PASSED: 2670 tests, 284438 subtests
NOT PASSED: 83 tests, 4706 subtests
FAILED: 58 tests, 4681 subtests
TIMED OUT: 25 tests, 25 subtests
SKIPPED: 0 tests, 0 subtests
I've also tested Google Maps and I couldnt find any graphical or performance issues on either Mac or Windows.
Please note that on Ubuntu 16.04 the "Run Tests" button was greyed out, but I did test Google Maps and I couldn't find any noticeable issues.
I'm not sure what too many failures means but please let me know if we can mark this issue verified as Fixed based on these results.
Assignee | ||
Comment 49•6 years ago
|
||
That's great, thanks.
Comment 50•6 years ago
|
||
Based on Comment 49 I will update the tracking flag for this issue.
Description
•