Skip to content

A bit better handling of gpu context loss - #21387

Merged
MrJul merged 3 commits into
masterfrom
feature/wd/gpu-context-loss-handling
May 19, 2026
Merged

MrJul merged 3 commits into
masterfrom
feature/wd/gpu-context-loss-handling

Conversation

@kekekeks

Copy link
Copy Markdown
Member

Don't propagate RenderTargetCorruptedException/RenderTargetNotReadyException from ServerCompositionTarget, introduce a way to properly reset GPU resources for a lost context by ServerCompositor when deterministic dispose order is required (i. e. EGLContext depends on some other resource, so we need to destroy EGLContext before that resource).

Comment thread src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs Outdated
MrJul
MrJul previously approved these changes May 18, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0065485-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Resolve conflicts:
- ServerCompositionTarget.cs: keep try/catch extraction from PR, adopt Size parameter from master
- ServerCompositor.UserApis.cs: keep ResetAllGpuResources() from PR alongside master's changes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@MrJul
MrJul enabled auto-merge May 19, 2026 08:41
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.1.999-cibuild0065557-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
MrJul added this pull request to the merge queue May 19, 2026
Merged via the queue into master with commit 391444d May 19, 2026
11 checks passed
@MrJul
MrJul deleted the feature/wd/gpu-context-loss-handling branch May 19, 2026 09:25
mgth added a commit to mgth/HLab.Avalonia that referenced this pull request Jul 26, 2026
Brings the GPU robustness work relevant to LittleBigMouse#506 (empty
layout view on DisplayLink docks / mixed dual-GPU setups): proper GPU
context loss handling (AvaloniaUI/Avalonia#21387), region dirty rect
clipping disabled by default (#21553), stencil buffers re-enabled
(#21586), and unfiltered adapter selection (#21695).

Co-Authored-By: Claude Fable 5 
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.

3 participants