Skip to content
  • Jocelyn Turcotte's avatar
    Delegated renderer: Put textures on those quads. · 7403ef59
    Jocelyn Turcotte authored
    
    
    A few changes are necessary to allow fetching textures provided by
    the render processes through IPC and bound to their respective GL
    context in the GPU process and use them in the QtQuick scene graph.
    
    - Remove the plain color test textures.
    - Allow setting the QtQuick QOpenGLContext's handle as the share
      context for all context set as shared in the Chromium GPU process.
      We do this by letting the GpuChannelManager ask us for a
      ShareGroup instance responsible for returning a sharing GL context
      handle.
    - Fetch texture IDs from the MailboxManager used by the GPU process
      using the Mailbox given to us in the DelegatedFrameData.
      This is the same mechanism used by Chromium to share textures
      between "client" GL contexts.
    - Keep the QtQuick scene graph threads and Chromium in-process GPU
      thread separate. The complicated part of merging those two
      rendering pipelines on the same thread is that it would force Qt
      to also use only one thread for rendering. For the moment we will
      try to synchronize those threads together instead.
    - Lock the Qt SG thread while waiting for resource sync points.
      Do so by posting a callback to the Chromium GPU thread and wait
      until the sync point of every resource has been retired by the
      producing contexts.
    - Acknowledge the delegated from once QtQuick swapped the GL buffers
      instead of right after we added the frame to the scene graph.
      This fixes some issues where the textures for the previous frame
      would already be released as Chromium was producing the new frame.
    
    There are still a few issues regarding synchronization that have to
    be fixed, especially when Qt triggers the rendering of a new frame
    while Chromium is starting to produce the next frame.
    
    Note: To enable it we still need to pass the following command switches:
    --enable-delegated-renderer --enable-threaded-compositing --in-process-gpu
    
    Change-Id: I2d4f7fac603b1808ed1495a8d689cb48e9ed41b9
    Reviewed-by: default avatarZeno Albisser <zeno.albisser@digia.com>
    7403ef59