-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viz Implementation for OSR #2575
Comments
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce). So a quick update on this, I have to say this turns out to be for me a lot more complicated than I initially expected. This then kind of made me realize (or let's just say I am pretty sure) that we can't really do the current approach to shared texture support, but I will think about it, as all the output device stuff including the viz::Display no longer lives in the browser process but rather the render process. If anyone has some input on this it would be greatly appreciated, but I will continue my endeavors regardless. [1] https://docs.google.com/document/d/1tFdX9StXn9do31hddfLuZd0KJ_dBFgtYmxgvGKxd0rY/edit |
@xforce_dev Thanks for the update. I'll try to give feedback next week. |
I'm not sure what the best solution is here, especially with regards to shared textures. I've asked @wesselsga (the shared textures author) for feedback as well. |
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce). @magreenblatt thanks, I might just a bit in over my head with this here, but it's a great learning opportunity, digging through a lot of the chromium code and changes that are involved here. |
From kylechar@ on the Chromium/viz team:
|
Also, it's worth noting that Ozone does not support software compositing but instead has the GPU process rendering directly to the target surface. That's similar to the shared surface use case in CEF. |
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce). Thanks, that is actually quite helpful, I came across those before, but didn't quite understand how they specifically relate to some things, I am currently working on the Chromium 74 branch update, but will continue work on this again very soon (If all goes well sometime this weekend actually) |
@xforce_dev Thanks! I think it would be nice to trial the SoftwareOutputDeviceWinProxy and LayeredWindowUpdaterImpl generalization approach in CEF, and then submit those changes back to Chromium if it works out. |
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce). PR: https://bitbucket.org/chromiumembedded/cef/pull-requests/226 |
Issue #2682 was marked as a duplicate of this issue. |
Issue #2722 was marked as a duplicate of this issue. |
Update to Chromium version 76.0.3809.0 (#665002) OSR tests will be fixed by a follow-up merge of Viz support (see issue #2575). → <<cset cc0db5f166b6 (bb)>> |
Add initial Viz implementation for OSR (see issue #2575). The old shared surface implementation has been removed and will need to be → <<cset ac2cc54e13ff (bb)>> |
Remove unused GetCompositor method and fix macOS compile error (see issue #2575) → <<cset cf87c88b0567 (bb)>> |
Original comment by Rob Sussman (Bitbucket: Rob Sussman). I just tried building the 3809 branch but it failed with the error below (on mac). Should the above changeset cf87c88b0567 be applied to 3809 in addition to master?
|
Remove unused GetCompositor method and fix macOS compile error (see issue #2575) → <<cset d98abbb7927b (bb)>> |
Original comment by Isaac Richards (Bitbucket: irichardsnv). Hey, hopefully this is useful - I've basically just gotten it all working, but the attached is a re-implementation of the shared texture bits for the new viz osr approach. Compared to the earlier shared texture patch, this simplifies the chrome parts of the change quite a bit. Chrome now has enough shared texture code to handle a large portion of that earlier patch. Unfortunately, this means that cef is passing the textures back to the client slightly differently - chromium is internally using the dx11.1 nthandle/keyed mutex style textures, so the client needs to deal with the handles properly and lock/unlock the textures when used. Patch should apply to the 3865 branch, and I should have it tested enough to submit a proper PR sometime next week. |
Original changes by Isaac Richards (Bitbucket: irichardsnv).
|
Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce). @{557058:a2ba0474-dc8c-446a-a7ba-63ea519588f3} So thanks for doing this and hopefully we can get this merged so that we are back to the previous feature set of OSR. |
Original comment by Isaac Richards (Bitbucket: irichardsnv). I actually tried for a quite a while to get the SharedImage stuff working first, but wasn’t able to. GLImageDXGI locks the texture when it’s bound, and I couldn’t figure out how to get the SharedImage interface to unbind the texture (and unlock it for the client to use) without destroying it. The patch I posted is just using the GpuMemoryBuffer bits, though, and passing that to the OSR code in libcef, so there’s a good chance it’ll work with slight massaging on other platforms. The only windows specific code in there is to deal a bit with the handles in libcef and a small workaround for the brokenness of the dx11 keyed mutex design.. |
Original comment by pkv (Bitbucket: pkvstream). @{557058:a2ba0474-dc8c-446a-a7ba-63ea519588f3} do you have a version of this patch for branch 3809 ? we’re quite interested in having shared textures reimplemented (we = obsproject) ; 3865 unfortunately is missing another feature which interests us (https://bitbucket.org/chromiumembedded/cef/commits/58e1149c7127314072903d3d45b9ba8b9fd2fc92) |
Original comment by Isaac Richards (Bitbucket: irichardsnv). Hey, bit of a delay on the accelerated texture stuff - I’ve got one last issue I’m trying to work out first with some rare flickering after a resize. In the meantime, though, I was able to get the accelerated path working on OSX as well, with very minor plumbing changes in CEF (basically getting the shared texture flag passed to RenderWidgetHostViewOSR). I’ll need to port the changes over to cefclient for that, though - need to change the GL code to use GL_TEXTURE_RECTANGLE instead of 2D, use the CGL/IOSurface APIs to get access to the shared texture, a couple other things... I wasn’t planning on backporting this to 3809, but can take a look if I find the time. |
Original comment by pkv (Bitbucket: pkvstream). @{557058:a2ba0474-dc8c-446a-a7ba-63ea519588f3} great news for the support of macOS 👏 . I tried to build your patch against 3865 but unfortunately the patch doesn’t apply against current branch. Do you have a more recent version of the patch ? Tried looking in your repo but it hasn’t been updated for a while. edit: made a mistake in applying the patch. Discard |
Original comment by Scott Maxwell (Bitbucket: scottmax, GitHub: scottmax). Hi @{557058:a2ba0474-dc8c-446a-a7ba-63ea519588f3} , Would it be possible for you to post another Cheers, Scott |
Original comment by Isaac Richards (Bitbucket: irichardsnv). Sure - here's my latest. Should be more stable than the last revision. I'm hoping to find the time to finish clean up and update to the latest branch and then submit a proper pull request in the next week or two. It's still against the 3904 branch, and does not contain the cefclient changes required to use the hardware texture sharing on Mac.. To work on mac, the opengl code needs to change from GL_TEXTURE_2D to GL_TEXTURE_RECTANGLE, and once that's done, you can bind to the shared handles with something like:
|
Original changes by Isaac Richards (Bitbucket: irichardsnv).
|
Original comment by Romain Caire (Bitbucket: Romain Caire). Thanks a lot @issac Richards. Could this be (with minimal changes) be also used in an CEF OSR app running on Linux ? |
Original comment by pkv (Bitbucket: pkvstream). the bug i Mentioned is fixed in the new patch @{557058:a2ba0474-dc8c-446a-a7ba-63ea519588f3} ! Hope you can PR soon. Thanks for this. |
Original comment by Isaac Richards (Bitbucket: irichardsnv). @{557058:1abc75c9-ed35-467b-9d29-aa6fd2ae20fb} - Theoretically, yes, it should work with minimal modifications to the cef/chromium bits on Linux. You’d have to modify the libcef/browser/native/browser_platform_delegate files as I did for the Mac support to plumb through the use_shared_texture_flag on linux, and then in libcef/browser/osr/host_display_client_osr.cc’s OnAfterFlip() function, add stuff to unwrap the gfx::GpuMemoryBufferHandle to get the platform specific handle of the shared texture/data. Then on the client, your starting point for the changes would be somewhere around chromium/src/ui/gl/gl_image_native_pixmap.cc - would need to figure out how to go from the NativePixmapHandle you get in the GpuMemoryBufferHandle to something usable in opengl land.. |
Original comment by Romain Caire (Bitbucket: Romain Caire). Cool, thanks a lot @issac Richards . I’ll try that as soon as I have some spare time. Would be very interesting to see it working :slight_smile: |
Original comment by David Morasz (Bitbucket: microdee, GitHub: microdee). I’ve tested out @{557058:a2ba0474-dc8c-446a-a7ba-63ea519588f3} 's patch on windows on branch 3904 (with Release x64 config), unfortunately cefclient now only displaying white, instead of the proper content and has painting artifacts when resizing 😞 . Cefclient was run with As an extra I was generating projects with
|
Original comment by Riku Palomäki (Bitbucket: riku_palomaki). I updated the patch by @{557058:a2ba0474-dc8c-446a-a7ba-63ea519588f3} on 3945 branch: https://bitbucket.org/riku_palomaki/cef/commits/137be9414bc47ba4351d927e20046335480e475a. I’m using this in our OpenGL based app with WGL_NV_DX_interop extension to use the shared D3D11 texture in an OpenGL context, which kind of works. However, I noticed couple of issues:
|
Original comment by Isaac Richards (Bitbucket: irichardsnv). Thanks! - I forgot to comment here, but there’s an open pull request https://bitbucket.org/chromiumembedded/cef/pull-requests/285/reimplement-shared-texture-support-for-viz/diff with it updated to 3945 as well. I wasn’t sure what to do about the acquiresync in gl_image_dxgi having an immediate timeout, like you’ve mentioned - since that code’s used for a number of other things inside of chromium, I couldn’t easily determine the side-effects of making it an infinite wait. One potential safe workaround would be to lock/unlock the handle inside of the new gl_output_surface_external with an infinite timeout after the texture comes back from the client, but before it’s handed back to the queue for chromium to render to.. I’ll take a look at the post-process thing. |
Original comment by Riku Palomäki (Bitbucket: riku_palomaki). 🤦♂️ Ah, I didn’t notice that merge request. It’s great that you are working on it! It seems that GLImageDXGI uses triple buffering, I think in normal cases inside Chromium it’s not possible to get into a situation where AcquireSync wouldn’t just immediately succeed, so I would like to believe that the change to infinite timeout is safe. |
Original comment by David Morasz (Bitbucket: microdee, GitHub: microdee). I can confirm Isaac Richards’ pull request works fine except that autodraw website was glitching as mentioned before, however it might not be caused solely by the CSS filters as Riku Palomäki said, because they worked perfectly well for me in the w3school live examples (blur and dropshadow or any combination of multiple ones as well). |
Original comment by Jon S (Bitbucket: sirbrialliance, GitHub: sirbrialliance). Issue #2960 was marked as a duplicate of this issue. |
Original comment by Felix Faust (Bitbucket: Felix Faust). any news on this? |
Original comment by Qiang Li (Bitbucket: Qiang Li). Now I am using the latest version 86.0.241(Cefsharp.Wpf), facing the same problem, expected this version can resolve but i am wrong. Use this way I haven't see the above process killed problem (cef's log was no error even if page stacked)
But I don't know if it is the right way to resolve the problem, anyone can give same advice ? |
OSR tests will be fixed by a follow-up merge of Viz support (see issue chromiumembedded#2575).
…). The old shared surface implementation has been removed and will need to be re-implemented using the Viz code path.
Related PR for OnAcceleratedPaint support: https://bitbucket.org/chromiumembedded/cef/pull-requests/734 |
Thanks! Marshall, could you backport the commit to M124 branch when possible? It was confirmed to work on that. |
Adds support for the OnAcceleratedPaint callback. Verified to work on macOS and Windows. Linux support is present but not implemented for cefclient, so it is not verified to work. To test: Run `cefclient --off-screen-rendering-enabled --shared-texture-enabled`
Original report by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).
Chromium is currently replacing much of the old compositor code with a new system called Viz [1].
Right now we can still use the old path, but I expect them to remove that in a not too distant future (already disabled by default on desktop platforms [2]).
So we need a 'new' OSR implementation that is based on Viz.
[1] https://chromium.googlesource.com/chromium/src/+/master/services/viz/
[2] https://crrev.com/c/1374207
The text was updated successfully, but these errors were encountered: