Page 1 of 1

Problems on macOS Catalina + Xamarin.Mac

Posted: 13 Oct 2019, 16:45
by bastos80
Okay, so I'm having a few issues getting Noesis GUI to work on my macOS Catalina setup.

First off, the Metal render context does not seem to work, forcing me te revert to RenderContextNSGL.
Using RenderContextMTL results in a NullReferenceException in NoesisApp.RenderContextMTL.Init(...) at startup.

Secondly, when I do use RenderContextNSGL, there are scaling issues, it uses only lower left 1/4th of the screen, the rest remains black. It does show the whole image, just scaled down. This also causes a mismatch with the mouse input coordinates.

To test this, I just ran a couple of the supplied C# examples.

Also, I still have to patch Xamarin.Mac back to version 5.8, the latest version gives a type initialization exception at startup (viewtopic.php?f=3&t=1819&p=10328&hilit=macos#p10328)

Is there anything I can do to fix this or are these bugs in Noesis GUI?

Re: Problems on macOS Catalina + Xamarin.Mac

Posted: 14 Oct 2019, 11:21
by bastos80
Some more digging into the Metal render context reveals the exception occurs in the following line:

((NSView)Runtime.GetNSObject(window)).Layer.AddSublayer(_layer);

Where, apparently, ((NSView)Runtime.GetNSObject(window)).Layer is null

Re: Problems on macOS Catalina + Xamarin.Mac

Posted: 14 Oct 2019, 11:37
by bastos80
Ok, I managed to get Metal to work by changing the following in the RenderContextMTL class:

I changed
((NSView)Runtime.GetNSObject(window)).Layer.AddSublayer(_layer);
to
((NSView)Runtime.GetNSObject(window)).Layer = _layer;
And added
mTLTextureDescriptor.StorageMode = MTLStorageMode.Private;
to the Resize () method.

Re: Problems on macOS Catalina + Xamarin.Mac

Posted: 16 Oct 2019, 12:39
by hcpizzi
Hi bastos80,

Thank you for digging into this issue. We're taking a look at your changes and we'll integrate them into our next release.