You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We got an immediate re-entrancy crash on Windows (and on no other platforms) when using SKGLView in .NET MAUI 9.0 Preview 6 with SkiaSharp 3.0 Preview 3.1. By adding:
#if WINDOWS
if(GHApp.WindowsXamlWindow != null)
{
GHApp.WindowsXamlWindow.DispatcherQueue?.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.High, () =>
{
#endif
internalGLView.InvalidateSurface();
#if WINDOWS
});
}
#endif
the re-entrancy crash disappeared. It looks like that DispatcherQueue code should be added to Windows SKGLView directly. I was wondering on whether priority should be High or Normal, but High seemed to work fine, and sounded more appropriate for a game loop. (Note: RenderLoop did not really work at least in our case; it refreshed the screen at high frequency but the animations on the screen / actual drawing were updated very infrequently.)
janne-hmp
changed the title
[Windows .NET MAUI 9.0] SKGLView is missing DispatcherQueue from InvalidateSurfance
[Windows .NET MAUI 9.0] SKGLView is missing DispatcherQueue from InvalidateSurface
Jul 17, 2024
@mattleibow This seems to be fixed now in SkiaSharp 3.116.1 and .NET MAUI 9.0 on Windows. In fact, adding the dispatcher queue seems to sometimes freeze the screen update. Did something change here over the past few months (after 29 Sep)? (There is no reentrancy crash anymore.)
Description
We got an immediate re-entrancy crash on Windows (and on no other platforms) when using SKGLView in .NET MAUI 9.0 Preview 6 with SkiaSharp 3.0 Preview 3.1. By adding:
the re-entrancy crash disappeared. It looks like that DispatcherQueue code should be added to Windows SKGLView directly. I was wondering on whether priority should be High or Normal, but High seemed to work fine, and sounded more appropriate for a game loop. (Note: RenderLoop did not really work at least in our case; it refreshed the screen at high frequency but the animations on the screen / actual drawing were updated very infrequently.)
Code
https://github.com/hyvanmielenpelit/GnollHack
Expected Behavior
SKGLView on Windows does not crash in re-entrancy upon consecutively calling InvalidateSurface.
Actual Behavior
SKGLView on Windows crashes in re-entrancy upon consecutively calling InvalidateSurface.
Version of SkiaSharp
3.x (Alpha)
Last Known Good Version of SkiaSharp
Other (Please indicate in the description)
IDE / Editor
Visual Studio (Windows)
Platform / Operating System
Windows
Platform / Operating System Version
Windows 11.
Devices
MSI Laptop.
Relevant Screenshots
No response
Relevant Log Output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: