Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS:Unable to create pixel format shim surface for conversion from Rgba8888 to Bgra8888 #3808

Closed
ghost opened this issue Apr 22, 2020 · 8 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 22, 2020

Tested with Avalonia 0.9.6, 0.9.9
OS is running under VMware 15:

macOS Mojave 10.14.6
Darwin 18.7.0

Got the following error:

Unhandled exception. System.Exception: Unable to create pixel format shim surface for conversion from Rgba8888 to Bgra8888
   at Avalonia.Skia.FramebufferRenderTarget.PixelFormatConversionShim..ctor(SKImageInfo destinationInfo, IntPtr framebufferAddress)
   at Avalonia.Skia.FramebufferRenderTarget.CreateSurface(SKImageInfo desiredImageInfo, ILockedFramebuffer framebuffer)
   at Avalonia.Skia.FramebufferRenderTarget.CreateDrawingContext(IVisualBrushRenderer visualBrushRenderer)
   at Avalonia.Rendering.DeferredRenderer.EnsureDrawingContext(IDrawingContextImpl& context)
   at Avalonia.Rendering.DeferredRenderer.UpdateRenderLayersAndConsumeSceneIfNeeded(IDrawingContextImpl& context, Boolean recursiveCall)
   at Avalonia.Rendering.DeferredRenderer.Render(Boolean forceComposite)
   at Avalonia.Rendering.DeferredRenderer.Paint(Rect rect)
   at Avalonia.Controls.TopLevel.HandlePaint(Rect rect)
   at Avalonia.Native.WindowBaseImpl.WindowBaseEvents.Avalonia.Native.Interop.IAvnWindowBaseEvents.Paint()
   at Avalonia.Native.Interop.IAvnWindowBaseEventsShadow.IAvnWindowBaseEventsVtbl.Paint(IntPtr thisObject)
--- End of stack trace from previous location where exception was thrown ---
   at Avalonia.Native.PlatformThreadingInterface.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
   at AvaloniaApp.Program.Main(String[] args) in /Users/osx/work/ceftest/cefnetmacos/AvaloniaApp/Program.cs:line 1

.
This is a test application for CefNet. I load https://yandex.ru/ and move the mouse over the window. The application crashes within 1- 2 minutes.

@kekekeks
Copy link
Member

kekekeks commented Apr 22, 2020

Have you tried running on actual Apple hardware? There were issues with running on OSX virtual machines in the past.

@ghost
Copy link
Author

ghost commented Apr 22, 2020

No, I have not tried.

@derekantrican
Copy link
Contributor

derekantrican commented Jan 9, 2021

I just saw this issue on actual Mac hardware. Unfortunately, don't have a repo yet. Here are the details:

OSX 10.13.6
2012 MacBook Pro (13 inch)

Stack trace is:

EXCEPTION MESSAGE: Unable to create pixel format shim surface for conversion from Rgba8888 to Bgra8888

INNER EXCEPTION: 

STACK TRACE: 
   at Avalonia.Skia.FramebufferRenderTarget.PixelFormatConversionShim..ctor(SKImageInfo destinationInfo, IntPtr framebufferAddress)
   at Avalonia.Skia.FramebufferRenderTarget.CreateSurface(SKImageInfo desiredImageInfo, ILockedFramebuffer framebuffer)
   at Avalonia.Skia.FramebufferRenderTarget.CreateDrawingContext(IVisualBrushRenderer visualBrushRenderer)
   at Avalonia.Rendering.DeferredRenderer.EnsureDrawingContext(IDrawingContextImpl& context)
   at Avalonia.Rendering.DeferredRenderer.UpdateRenderLayersAndConsumeSceneIfNeeded(IDrawingContextImpl& context, Boolean recursiveCall)
   at Avalonia.Rendering.DeferredRenderer.Render(Boolean forceComposite)
   at Avalonia.Rendering.DeferredRenderer.Paint(Rect rect)
   at Avalonia.Controls.TopLevel.HandlePaint(Rect rect)
   at Avalonia.Native.WindowBaseImpl.WindowBaseEvents.Avalonia.Native.Interop.IAvnWindowBaseEvents.Paint()
   at Avalonia.Native.Interop.IAvnWindowBaseEventsShadow.IAvnWindowBaseEventsVtbl.Paint(IntPtr thisObject)
--- End of stack trace from previous location where exception was thrown ---
   at Avalonia.Native.PlatformThreadingInterface.RunLoop(CancellationToken cancellationToken)
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode)
   at Bulk_Edit_Calendar_Events_WPF.Program.Main(String[] args) in C:\Users\derek\source\repos\derekantrican\Bulk-Edit-Calendar-Events\Bulk Edit Calendar Events_WPF\Program.cs:line 25

Program.cs#25 is:

BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);

@derekantrican
Copy link
Contributor

derekantrican commented Jan 9, 2021

I seem to get it when tooltips are changing quickly - I have a list of items that all compute their own tooltip and running the cursor back and forth over them will cause the application to stop responding and throw the error with my Unhandled Exception handing. If you're interested, I could venture into creating a min repo

@derekantrican
Copy link
Contributor

Seems to be resolved with Avalonia 0.10.0 (at least for me)

@ltetak
Copy link
Contributor

ltetak commented Nov 15, 2021

This is easily reproducible on M1 macs when opening a context menu in 0.10.10.

@ghost
Copy link
Author

ghost commented Jun 22, 2022

Still reproducible on Macbook Pro 14 M1 (2021), macOS 12.4, Avalonia 0.10.14 and

BuildAvaloniaApp()
.With(new AvaloniaNativePlatformOptions { UseGpu = !PlatformInfo.IsMacOS })

@DmitriyYukhanov
Copy link

Still reproduces for me in Avalonia 0.10.18 in my Avalonia app which runs on Mac OS 12.6 VM when I try to show the context menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants