Hardware offscreen render support

Made a cool mod to CEF that you'd like to share with others? Discuss CEF modifications here, and view modifications that others have made.

Re: Hardware offscreen render support

Postby vlhm » Fri Apr 18, 2014 8:25 am

Hi Assert,

Awesome news!! As you said earlier we need this already yesterday. And while it may not be merged into the trunk of CEF at this time, it is really great to see someone who made an effort to provide accelerated OSR. I have thought about it myself more than a few times, but only the thought to set up the build environments kept me from getting into it.

However, since I wanted to try your work and provide some feedback I finally got everything set up and build Chromium and CEF with your patch - not as painful as I thought it would be -:)

Your patch seems to work very well and I have also verified that D3D path works. Rendering some 3D website using standard OSR loads CPU by 25% (this is 100% load of single core), rendering using accelerated OSR loads CPU only by 8% (includes CPU load by application). And this is great improvement! However, we having issues with this build. Our applications uses rendering to window as well as offscreen rendering. And it is important to have stable working components (this is not related to OSR patch). So, for example, we find out that cef_binary_3.1650.1562_windows32 build (without patch) renders black to window on some switchable graphics computers. It seems everything works (so CefBrowser changes cursor, reacts to clicks, JS calls sent to application, but just black window on screen). cef_binary_3.1846.1640_windows32 build compiled with your patch renders black even on some desktops. Disabling accelerated_compositing solves this issue. But then also no sense to use this CEF build then. So we currently can only stick to cef_binary_3.1547.1412_windows32 build which do not have these issues.

As you mentioned , then it may be a good idea to wait for next CEF sync point to continue . But just in case you actually make a patch that will work with latest trunk of CEF/Chromium then please do share.-:)

Comments Regarding API.
--------------------------------------
I think complete API will need also following:
1. Provide accelerated handle type. This can be OpenGL HDC, or D3D shared surface handle. So implementing application will know what kind of handle it gets without having prior knowledge of CEF parameters used.
2. Provide a way to switch back to non-accelerated OSR mode. Here 2 options: a) Application can create new browser, or b) Browser can do this switch.
Surfaces sharing may fail in some cases (for example, when you trying to open handle on another adapter, i.e. application and CEF works on different adapters).
Also, when D3D application receives OpenGL handle (or other way around), it can implement OpenGL->D3D sharing, or just switch back to non-accelerated mode. OpenGL->D3D is not available on all systems.
So switch back method required in any case.

There are also some general issues with surface sharing and switchable graphics in D3D. So it may be better to disable any accelerated OSR for now when switchable graphics system detected AND HANDLE PASSED FROM ANOTHER PROCESS (else this will require more effort to provide required API to handle all cases). In some cases OpenSharedResource call succeeded but CopyResource do not copy. This is NVidia and AMD issues because either CopyResource must work or OpenSharedResource returns failure.
vlhm
Newbie
 
Posts: 2
Joined: Fri Apr 18, 2014 7:06 am

Re: Hardware offscreen render support

Postby vlhm » Sat Apr 19, 2014 8:27 am

FYI. This is our post regarding AMD switchable graphics issue.
http://devgurus.amd.com/thread/160800
vlhm
Newbie
 
Posts: 2
Joined: Fri Apr 18, 2014 7:06 am

Re: Hardware offscreen render support

Postby magreenblatt » Wed Apr 23, 2014 4:36 pm

Chromium is now actively deleting the code used by the legacy software path (see https://code.google.com/p/chromiumembed ... il?id=1257). If someone is interested in assisting with the new software compositor implementation please let me know (or post to that issue).
magreenblatt
Site Admin
 
Posts: 9847
Joined: Fri May 29, 2009 6:57 pm

Re: Hardware offscreen render support

Postby Mikael » Thu May 08, 2014 5:08 am

Just wanted to give a major thanks to Assert for adding this functionality. It took me a few days to get everything working with Direct3D9, but it works beautifully now. It's at least as performant and responsive as the Chrome browser, and sometimes a bit better even. All of this while we're rendering a bunch of other stuff in our application as well.

Again, thank you Assert for sharing this with the rest of us. I've been waiting a long time for something like this to show up in CEF, and looking at the patch I'm glad I didn't attempt this myself, 'cause I don't think I would've been able to achieve that result.

I really, really hope something like this can be added to trunk at some point, even with the new compositor and whatnot, 'cause we're probably gonna be stuck with this revision until it does.
Mikael
Newbie
 
Posts: 8
Joined: Fri Oct 05, 2012 4:18 pm

Re: Hardware offscreen render support

Postby Vin » Tue Jun 03, 2014 9:36 am

Glad I found this thread.... I was hoping to merge with the latest trunk to get the webrtc updates, but I see all the interfaces have changed to support OpenGL rendering. In the past I used this to add web capability into my existing OpenGL application on Windows. Looking at the latest trunk, I cannot figure out how such is possible. I stumbled on this thread and am wondering if any progress has been made in this area, and if so, point me in the direction of what the new classes/APIs are.

Thanks for any help,
V
Vin
Newbie
 
Posts: 1
Joined: Tue Jun 03, 2014 9:29 am

Re: Hardware offscreen render support

Postby magreenblatt » Wed Jun 04, 2014 1:24 pm

Vin wrote:I stumbled on this thread and am wondering if any progress has been made in this area, and if so, point me in the direction of what the new classes/APIs are.

You can star https://code.google.com/p/chromiumembed ... il?id=1257 for updates when they become available.
magreenblatt
Site Admin
 
Posts: 9847
Joined: Fri May 29, 2009 6:57 pm

Re: Hardware offscreen render support

Postby TomDigitale » Wed Jun 11, 2014 11:57 am

Hello,

I'm trying to apply this patch to the branch 1750, and some of the patch methods differed from branch 1650 (I believe the patch has to be applied to branch 1650 ? Correct me if I'm wrong).
As a result, i could only have this:

http://nsa33.casimages.com/img/2014/06/ ... 440135.png

(the black strips appears when re-sizing the window).

Have you any idea on how to make it works with branch 1750? Or should I only use branch 1650 ?
TomDigitale
Techie
 
Posts: 18
Joined: Fri Mar 14, 2014 6:00 am

Re: Hardware offscreen render support

Postby tr3s » Fri Jun 20, 2014 5:50 am

Just wanted to say thanks to Assert for this patch.
I've patched CEF and Chormium and build cefclient.exe. But if D3D path is set all I get is a Black Frame and a White Frame if OpenGL path is set.
Do you have any idea why is this happening? I'm Using CEF 1640 with Chromium 251746.
tr3s
Newbie
 
Posts: 4
Joined: Fri Jun 20, 2014 5:20 am

Re: Hardware offscreen render support

Postby tr3s » Fri Jun 20, 2014 3:04 pm

TomDigitale, you should be using CEF trunk Rev. 1640, not Branch 1650, to use this patch. In order to have everything building correctly and patched right (cef_create_projects applies some patches to chromium src) you should use Chromium trunk Rev. 251746.

I don't know what I'm doing wrong but with I can't get anything rendered to cefclient with OSR enabled. I can see that cef loads the page, i can ear audio, the cursor changes but nothing is rendered. All i get is a black frame if D3D path is enabled and a white frame if OpenGL path is enabled (-use-gl=desktop). :(
tr3s
Newbie
 
Posts: 4
Joined: Fri Jun 20, 2014 5:20 am

Re: Hardware offscreen render support

Postby alex8b » Thu Jul 31, 2014 7:09 am

Has anyone managed to get it working? I'm getting into the same problem with black/white frame. It's very sad that there's no progress on this feature since April.
alex8b
Newbie
 
Posts: 2
Joined: Thu Jul 31, 2014 6:00 am

PreviousNext

Return to Modifications Forum

Who is online

Users browsing this forum: No registered users and 1 guest