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

387 Коммитов

Автор SHA1 Сообщение Дата
Jeff Gilbert 4a8c88c707 Bug 1655000 - Use same function for getting size as reading into buffer. r=lsalzman
Previously we called GetFrontBufferSize, alloc'd a buffer, and called
FrontBufferSnapshotInto to read into the buffer.
Now, call FrontBufferSnapshotInto({}) to get size, and then alloc and
pass pointer to newly alloc'd data into
FrontBufferSnapshotInto(Some(ptr)).
Using the same function for both means that logic can't diverge and
cause mismatch bugs.

Differential Revision: https://phabricator.services.mozilla.com/D113611
2021-05-06 00:22:42 +00:00
Alexandru Michis 2460ffe976 Backed out changeset 1331f134a250 (bug 1655000) for causing bustages in WebGLContext.cpp
CLOSED TREE
2021-04-29 00:44:19 +03:00
Jeff Gilbert 9317ccff9a Bug 1655000 - Use same function for getting size as reading into buffer. r=lsalzman
Previously we called GetFrontBufferSize, alloc'd a buffer, and called
FrontBufferSnapshotInto to read into the buffer.
Now, call FrontBufferSnapshotInto({}) to get size, and then alloc and
pass pointer to newly alloc'd data into
FrontBufferSnapshotInto(Some(ptr)).
Using the same function for both means that logic can't diverge and
cause mismatch bugs.

Differential Revision: https://phabricator.services.mozilla.com/D113611
2021-04-28 20:38:23 +00:00
Jeff Gilbert a8926ffa47 Bug 1640607 - Send SurfaceDescriptors for GPU blitting for video-to-webgl. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D101061
2021-01-14 01:23:06 +00:00
Simon Giesecke dd80614fa0 Bug 1678062 - Remove unnecessary includes. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D97467

Depends on D96561
2020-11-23 16:12:02 +00:00
Botond Ballo 7ca62fc979 Bug 1667594 - Avoid including nsLayoutUtils.h in WebGLContext.h. r=jgilbert
It does not appear to be needed.

Differential Revision: https://phabricator.services.mozilla.com/D91683
2020-09-30 21:04:55 +00:00
Jeff Walden e8f3f74ef6 Bug 1656411 - Move typed array, ArrayBuffer, and dataview-related functions out of jsfriendapi.h to two new headers. r=mgaudet,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D85524
2020-07-31 16:37:27 +00:00
Emilio Cobos Álvarez ff61891772 Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Jeff Gilbert f25a4cdbe8 Bug 1607940 - IPC TexImage. r=lsalzman,nika,handyman
Differential Revision: https://phabricator.services.mozilla.com/D83291
2020-07-21 22:57:01 +00:00
Jeff Gilbert 35f892e782 Bug 1607940 - Stand up webgl.out-of-process:true path. r=handyman,nika,froydnj
* Use clearer pref names.
* Default (and only support) IPDL dispatching.
* Make DispatchCommands async-only.
* Sync ipdl command per sync webgl entrypoint.
  * Eat the boilerplate cost, since there's not too many.
* Run SerializedSize off same path as Serialize.
* All shmem uploads go through normal DispatchCommands.
* Defer pruning of dead code for now so we can iterate quickly.
* Use Read/Write(begin,end) instead of (begin,size).
  * This would have prevented a bug where we read/wrote N*sizeof(T)*sizeof(T).

Differential Revision: https://phabricator.services.mozilla.com/D81495
2020-07-21 22:56:52 +00:00
Jeff Gilbert 80a2030fe4 Bug 1649894 - Add webgl.debug.incomplete-tex-color. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D81920
2020-07-02 01:42:21 +00:00
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 a3bc94c178 Bug 1632249 - Create a separate WebGLContext::PresentInto function for WebXR. r=jgilbert
- Do not apply mIsCanvasDirty bailout when presenting from a opaque FBO
back buffer.
- Create a separate WebGLContext::PresentInto with more specific XR
validations and logic.
- Use the Opaque FBO backbuffer as source when calling
BlitBackbufferToCurDriverFB
- Always invalidate OpaqueFBO regardless of the WebGL context's
preserveDrawingBuffer value.

Differential Revision: https://phabricator.services.mozilla.com/D78301
2020-06-15 18:26:00 +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 4ab7ab5da0 Bug 1632249 - Create a separate WebGLContext::PresentInto function for WebXR. r=jgilbert
- Do not apply mIsCanvasDirty bailout when presenting from a opaque FBO
back buffer.
- Create a separate WebGLContext::PresentInto with more specific XR
validations and logic.
- Use the Opaque FBO backbuffer as source when calling
BlitBackbufferToCurDriverFB
- Always invalidate OpaqueFBO regardless of the WebGL context's
preserveDrawingBuffer value.

Differential Revision: https://phabricator.services.mozilla.com/D78301
2020-06-11 06:37:38 +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 14622aa141 Bug 1632249 - Create a separate WebGLContext::PresentInto function for WebXR. r=jgilbert
- Do not apply mIsCanvasDirty bailout when presenting from a opaque FBO
back buffer.
- Create a separate WebGLContext::PresentInto with more specific XR
validations and logic.
- Use the Opaque FBO backbuffer as source when calling
BlitBackbufferToCurDriverFB
- Always invalidate OpaqueFBO regardless of the WebGL context's
preserveDrawingBuffer value.

Differential Revision: https://phabricator.services.mozilla.com/D78301
2020-06-10 22:21:07 +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
Imanol Fernandez 8549c99014 Bug 1632249 - Create a separate WebGLContext::PresentInto function for WebXR. r=jgilbert
- Do not apply mIsCanvasDirty bailout when presenting from a opaque FBO back buffer.
- Create a separate WebGLContext::PresentInto with more specific XR validations and logic.
- Use the Opaque FBO backbuffer as source when calling BlitBackbufferToCurDriverFB
- Always invalidate OpaqueFBO regardless of the WebGL context’s preserveDrawingBuffer value.

Differential Revision: https://phabricator.services.mozilla.com/D78301
2020-06-08 20:35:38 +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 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
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
Imanol Fernandez ec6ba5a531 Bug 1617751 - Ensure that GLScreenBuffer back buffer is created using the newly attached factory. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D64183

--HG--
extra : moz-landing-system : lando
2020-03-03 00:43:10 +00:00
Jeff Gilbert 91ab854fc8 Bug 1617785 - Optimize GetDrawFetchLimits and vertexAttribPointer. r=lsalzman
Our goal here is to just be fast enough that we don't need to cache.

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

--HG--
extra : moz-landing-system : lando
2020-02-26 00:44:26 +00:00
Jeff Gilbert e5d08f59ba Bug 1617091 - Remove DynDGpuManager, add webgl.power-preference-override. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D63599

--HG--
extra : moz-landing-system : lando
2020-02-21 04:00:07 +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 011c0a1fd7 Bug 1616715 - SurfaceFromElement gets alpha Premult unless opt-in to NonPremult. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D63421

--HG--
extra : moz-landing-system : lando
2020-02-21 02:27:08 +00:00
Csoregi Natalia 0d667d17dd Backed out changeset 5005fe56b7b0 (bug 1616715) for failures on test_2_conformance2__canvas__to-data-url-with-pack-params.html. CLOSED TREE 2020-02-21 01:33:48 +02:00
Jeff Gilbert 95d86374ba Bug 1616715 - SurfaceFromElement gets alpha Premult unless opt-in to NonPremult. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D63421

--HG--
extra : moz-landing-system : lando
2020-02-20 20:52:10 +00:00
Jeff Gilbert b3e7d58623 Bug 1616457 - Fix failures in conformance/extensions/webgl-draw-buffers. r=lsalzman
We must not check frag output type agreement if colorMask(0,0,0,0).
We must allow drawing with no frag outputs, leaving color values
unchanged. (evidently this is used enough that we spec'd it this way?)

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

--HG--
extra : moz-landing-system : lando
2020-02-19 20:47:30 +00:00
Simon Giesecke 723b05dfb6 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/canvas. r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D63142

--HG--
extra : moz-landing-system : lando
2020-02-18 21:08:00 +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
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

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

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Kearwood "Kip" Gilbert dcba527c05 Bug 1581374 - Implement WebGLContext.makeXRCompatible (WIP) r=jgilbert,daoshengmu,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D45952

--HG--
extra : moz-landing-system : lando
2019-11-15 21:32:15 +00:00
Daosheng Mu 21480b57c1 Bug 1565268 - Recovering VRDisplay status after VRService is shutdown. r=kip,jgilbert
When JS is paused, VRService will automatically shutdown because the timer is not updated,
we used to create a new VRDisplay to JS. However, the page is still using the older VRDisplay,
so it can't get the newest VRDisplayInfo status. We should exit presentation and
apply the VRDisplayInfo status to the original VRDisplay instead of creating new one.

Besides, we also need to release the VR screen buffer after exiting the immersive mode to avoid eglMakeCurrent error.

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

--HG--
extra : moz-landing-system : lando
2019-10-29 00:35:35 +00:00
Greyson Gilbert 5ab46fc0a3 Bug 1535809 - Add warning on use of implicitly enabled extensions r=jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D36431

--HG--
extra : moz-landing-system : lando
2019-07-09 05:21:30 +00:00
Jeff Gilbert a8530d0dbd Bug 1535373 - IsContextLost() before early-out. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D37350

--HG--
extra : moz-landing-system : lando
2019-07-09 02:36:52 +00:00