Skip to content

CEF3: Support rendering to a hardware GL/D3D texture/surface provided by the client #1006

Closed

Description

@magreenblatt

Original report by me.


Original issue 1006 created by magreenblatt on 2013-06-27T17:50:13.000Z:

CEF3 off-screen rendering does not currently support hardware acceleration. This means that some features like 3D CSS which require hardware acceleration do not currently work when using off-screen rendering.

See issue comment 51.8 for related comments.

Activity

  1. magreenblatt commented on Aug 8, 2013

    @magreenblatt
    CollaboratorAuthor

    Comment 1. originally posted by magreenblatt on 2013-08-08T16:05:01.000Z:

    issue #1048 has been merged into this issue.

  2. magreenblatt commented on Feb 14, 2014

    @magreenblatt
    CollaboratorAuthor

    Original comment by Anonymous.


    Comment 2. originally posted by [email protected] on 2014-02-14T05:30:14.000Z:

    Hi , I just wanted to follow up on this issues. I remember we had some good discussions back in issue #518 about a fairly simple approach to support GPU acceleration for off screen rendering on Windows by using shared surfaces.

    Any idea on timeline here ?

  3. magreenblatt commented on Feb 19, 2014

    @magreenblatt
    CollaboratorAuthor

    Original comment by Anonymous.


    Comment 3. originally posted by efrencd on 2014-02-19T19:11:57.000Z:

    Hello,

    here it is a very interesting article about the Desktop Window Manager in Windows Vista, 7 and 8.

    http://en.wikipedia.org/wiki/Desktop\_Window\_Manager

    It seems in Windows Vista and beyond, all windows are actually textures that are rendered to an offscreen buffer and then put in a 3d surface (actually a D3D surface) representing that window.

    Taking that into account I guess there must be an easy way to get the whole content (harware accelerated) from CEF and use it as a texture so that we can embed it in our own apps (see awesomium.com)

    Probably this will only work in Windows Vista and beyond and not in Windows XP.
    I think CEF should support some of the features modern windows have to offer even if that breaks backwards compability with Win XP. I know many people love XP but we can't forget it is a 13 years old OS and many advancements have occurred since its release.

  4. magreenblatt commented on Apr 7, 2014

    @magreenblatt
    CollaboratorAuthor

    Original comment by Anonymous.


    Comment 4. originally posted by MGusarenko on 2014-04-07T08:25:34.000Z:

    I am working on patch for HW offscreen render support, description will be avail at CEF forum as soon as premoderated. Everyone who intrested in can join.

  5. magreenblatt commented on Apr 7, 2014

    @magreenblatt
    CollaboratorAuthor

    Original changes by Anonymous.


    • set attachment to "OnAcceleratedPaint_cromium.zip"
  6. magreenblatt commented on Apr 7, 2014

    @magreenblatt
    CollaboratorAuthor
  7. magreenblatt commented on Apr 8, 2014

    @magreenblatt
    CollaboratorAuthor

    Original comment by Anonymous.


    Comment 6. originally posted by jarred.nicholls on 2014-04-08T19:38:14.000Z:

    Amazing re: the HW accelerated off screen rendering! It really helps my use case with integrating CEF into QtQuick/QML scene graph without compromising.

  8. magreenblatt commented on Jun 28, 2014

    @magreenblatt
    CollaboratorAuthor

    Comment 7. originally posted by magreenblatt on 2014-06-28T00:10:37.000Z:

    There are currently two use cases for hardware acceleration:

    1. Support for accelerated features like 3D CSS and WebGL which require GPU acceleration for rendering and compositing.

    2. Support for delivering the final composited result to a GL/D3D texture/surface provided by the client in order to minimize copies and CPU load.

    comment 1. will be addressed by issue comment 12.57 which re-implements off-screen rendering support in trunk using the delegated renderer. comment 2. will be left to this issue.

  9. magreenblatt commented on Jun 28, 2014

    @magreenblatt
    CollaboratorAuthor

    Comment 8. originally posted by magreenblatt on 2014-06-28T00:12:53.000Z:

  10. magreenblatt commented on Oct 23, 2014

    @magreenblatt
    CollaboratorAuthor

    Comment 9. originally posted by magreenblatt on 2014-10-23T17:31:24.000Z:

  11. magreenblatt commented on Nov 7, 2014

    @magreenblatt
    CollaboratorAuthor

    Comment 11. originally posted by magreenblatt on 2014-11-07T22:00:18.000Z:

    It's likely best to implement this at the Ozone layer. See http://crbug.com/431397 for details.

  12. magreenblatt commented on Mar 1, 2015

    @magreenblatt
    CollaboratorAuthor

    Original comment by Anonymous.


    Comment 12. originally posted by efrencd on 2015-03-01T13:39:33.000Z:

    Hello, any plans or aproximate date in which this feature will be added? thanks.

  13. magreenblatt commented on Mar 2, 2015

    @magreenblatt
    CollaboratorAuthor

    Original comment by Anonymous.


    Comment 13. originally posted by ameggs on 2015-03-02T22:55:56.000Z:

    My (possibly incorrect or outdated?) understanding is that Chromium renders to GPU-side 256x256 pixel tiles, rather than a single buffer that's the full size of the visible browser window. When something on the page changes, only tiles that are changed get redrawn. At display time, something called the "ubercompositor" takes the current list of tiles and merges it with browser-side UI things. The only time the entire web page is drawn into a single buffer is when the tiles are combined with that UI for the final render. I'm basing this off these two documents; if I'm wrong I welcome the correction:

    https://docs.google.com/document/d/1tkwOlSlXiR320dFufuA\_M-RF9L5LxFWmZFg5oW35rZk

    https://docs.google.com/document/d/1ziMZtS5Hf8azogi2VjSE6XPaMwivZSyXAIIp0GgInNA

    But if my understanding is correct, then implementing this as described would mean chromium or CEF would be rendering all its tiles to a buffer we provided, and then we'd render that buffer into our own view. But if the goal here is to reduce latency and copies, maybe the best way to achieve this isn't for CEF to render to a texture/surface that we provide. Instead, just expose the current tile set to us. We can send those tiles into our own 3D renderer as part of our own independently-running update/draw/present loop.

    This would be especially appreciated by game developers, because we're frequently GPU-limited, and anything that reduces the number of GPU-side copies would help.

  14. magreenblatt commented on Aug 20, 2015

    @magreenblatt
    CollaboratorAuthor

    Samsung has (very indirectly) proposed a new API for hardware-accelerated off-screen rendering in CEF: http://blogs.s-osg.org/servo-the-countdown-to-your-next-browser-continues/ ("Composite Smarter, Not Harder" section).

    Also, using in-process-gpu in combination with a custom OutputSurface seems like a promising implementation approach. Related conversation: https://groups.google.com/a/chromium.org/d/msg/graphics-dev/cnr8n3mdRFc/2n7QrPAaAQAJ

  15. magreenblatt commented on Aug 27, 2015

    @magreenblatt
    CollaboratorAuthor

    Original comment by Cef Gluist (Bitbucket: cefgluist).


    Intented updated patches to Chromium41/CEFr2272.

  16. 42 remaining items

  17. magreenblatt commented on Mar 18, 2019

    @magreenblatt
    CollaboratorAuthor

    Linux: Add OSR use_external_begin_frame support (see issue #1006)

    → <<cset a48e0720762a (bb)>>

  18. magreenblatt commented on Mar 18, 2019

    @magreenblatt
    CollaboratorAuthor

    Linux: Add OSR use_external_begin_frame support (see issue #1006)

    → <<cset 2ff59af42954 (bb)>>

  19. magreenblatt commented on Mar 18, 2019

    @magreenblatt
    CollaboratorAuthor

    Linux: Add OSR use_external_begin_frame support (see issue #1006)

    → <<cset ce74f0ae4dff (bb)>>

  20. magreenblatt commented on Jul 23, 2019

    @magreenblatt
    CollaboratorAuthor

    Original comment by Romain Caire (Bitbucket: Romain Caire).


    Hi,

    I’d like to help implementing Accelerated Paint in OSR mode on Linux.

    Is there any work being done on this end I could look at ?

  21. magreenblatt commented on Jul 23, 2019

    @magreenblatt
    CollaboratorAuthor

    Original comment by Alexander Guettler (Bitbucket: xforce, GitHub: xforce).


    As part of #2575/viz-implementation-for-osr I am investigating the possibility of supporting more platforms.

    As part of the last chromium update my WIP part of Viz OSR was merged without any shared surface, because the old implementation doesn’t work with Viz.

    I will be publishing a new early work PR sometime this week to add shared surface again for Windows and go from there.

  22. magreenblatt commented on Aug 27, 2019

    @magreenblatt
    CollaboratorAuthor

    Original comment by Romain Caire (Bitbucket: Romain Caire).


    Hi @{557058:f07fe0c3-2eef-4563-993e-dcdb7d76e546} ,

    ‌

    Did you had some time to work on this ?

    Feel free to DM me on Twitter @RomainCaire if you need any help or If i can be any useful :slight_smile:

  23. magreenblatt commented on Nov 11, 2021

    @magreenblatt
    CollaboratorAuthor

    Issue #3216 was marked as a duplicate of this issue.

  24. magreenblatt commented on Feb 16, 2022

    @magreenblatt
    CollaboratorAuthor

    Issue #3263 is likely the best way to implement this for Linux (and possibly other platforms in the future).

  25. magreenblatt commented on Jul 14, 2022

    @magreenblatt
    CollaboratorAuthor

    Original comment by Joshua Chen (Bitbucket: gpbeta, GitHub: gpbeta).


    Hi, again! Just a quick question:

    Can we create the staging texture with D3D11_BIND_RENDER_TARGET bind flag? (libcef/browser/gpu/external_texture_manager.cc)

    ‌

    We want to make use of the shared texture provided by CEF3 with ANGLE backed by Direct 3D 11.

    So the only choice is eglCreatePbufferFromClientBuffer(), however, when we pass the shared handle it fails with EGL_BAD_SURFACE.

    After some digging into ANGLE’s source codes, we found that eglCreatePbufferFromClientBuffer() requires the client buffer to be render-able, even if we only read the frame buffer later:

    EGLint SwapChain11::resetOffscreenColorBuffer(const gl::Context *context,
                                                  int backbufferWidth,
                                                  int backbufferHeight)
    {
    ...
            // Fail if the offscreen texture is not renderable.
            if ((offscreenTextureDesc.BindFlags & D3D11_BIND_RENDER_TARGET) == 0)
            {
                ERR() << "Could not use provided offscreen texture, texture not renderable.";
                release();
                return EGL_BAD_SURFACE;
            }
    ...
    }

    It’s both reasonable that a PBuffer should be render-able and a shared texture from CEF should be read-only, but I think it should be safe to make the staging texture render-able?

    ‌

  26. added
    osr
    on Mar 12, 2023
  27. added a commit that references this issue on Apr 28, 2024
    77c1e82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Frameworkenhancementosr

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions