Skip to content

Roxie/cef accelerated - #5597

Draft
roxanneskelly wants to merge 10 commits into
developfrom
roxie/CEF-accelerated
Draft

Roxie/cef accelerated#5597
roxanneskelly wants to merge 10 commits into
developfrom
roxie/CEF-accelerated

Conversation

@roxanneskelly

Copy link
Copy Markdown
Contributor

Enable accelerated painting from CEF/Dullahan. Dullahan will now hand the CEF media plugin a handle to the painted texture in the GPU, which can be shared with the viewer process. This avoids the previous case where we needed to copy the texture into system RAM and then put it back to VRAM after the bits were transferred to the viewer.

@github-actions

Copy link
Copy Markdown

This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or it will be closed in 7 days

@github-actions github-actions Bot added the stale label May 21, 2026
roxanneskelly and others added 8 commits July 8, 2026 14:29
The adapter_luid functionality is Windows-only, matching the existing
guards on the member declaration, initialization, and message passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pass gGLManager.mHasNVDXInterop from the viewer through the plugin init
message so the CEF plugin can conditionally set shared_texture_enable.
When the extension is not available, Dullahan falls back to the standard
OnPaint software rendering path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Let CEF texture size match the viewer window size instead of clamping
to 2048. The accelerated path clamps to the GPU max texture size
(GL_MAX_TEXTURE_SIZE) as a safety limit.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@roxanneskelly
roxanneskelly force-pushed the roxie/CEF-accelerated branch from bf33d53 to 5e8ca89 Compare July 8, 2026 21:30

@callumlinden callumlinden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved - with a single LL_WINDOWS0 typo to be fixed

{
mEnableMediaPluginDebugging = message_in.getValueBoolean("enable");
}
#if LL_WINDOWS0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still a wip. my way of temporarily commenting this section out

roxanneskelly and others added 2 commits July 10, 2026 10:57
Previously each media texture lazily created its own D3D11 device, context
and wglDXOpenDeviceNV interop device, and any transient failure tore the
whole device down and forced an expensive rebuild on the next frame. Both
caused rendering stutters when using handle-based accelerated media.

Move the D3D11 device, context and interop GL device to a process-wide
shared holder created once and reused by every texture. Trim
releaseInteropResources() to only tear down per-texture resources so a
stale handle during a CEF resize no longer rebuilds the device, and close
the shared device from LLGLManager::shutdownGL() while the GL context is
still valid.

Also extract GL adapter LUID detection into LLGLManager::detectGLAdapterLuid().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rework the Windows NV_DX_interop accelerated-media path to sample the
interop source texture directly instead of flip-blitting into a separate
output texture. dullahan now delivers the shared texture already in GL
orientation (flip_pixels_y honored in OnAcceleratedPaint), so the FBO,
blit, and persistent output texture are no longer needed.

The interop source name is installed into the GL texture as a *borrowed*
name: sampled by the renderer but owned solely by the interop layer,
which frees it only after unregistering. This fixes a double-free where
LLImageGL's ordinary lifecycle (deferred deletes, name-pool recycling,
background createGLTexture/discard) could delete a still-registered
interop name, recycling it into an unrelated texture and crashing in
LLNetMap::mObjectImage's destructor.

- Add mBorrowedName tracking plus setBorrowedTexName/clearBorrowedTexName
  to LLImageGL; guard all delete paths against borrowed names.
- Tear down interop resources before mGLTexturep in destroyGLTexture,
  unregistering before the GL name is freed.
- Bump dullahan to v1.40.0 (CEF 150) and link d3dcompiler.lib.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants