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

Use Metal as a backend on Mac Catalyst #2747

Merged
merged 1 commit into from
Feb 10, 2024
Merged

Use Metal as a backend on Mac Catalyst #2747

merged 1 commit into from
Feb 10, 2024

Conversation

mattleibow
Copy link
Contributor

@mattleibow mattleibow commented Feb 8, 2024

Description of Change

There is no OpenGL or OpenGL ES on Mac Catalyst - there technically is but it is not meant to be used - so we swap out the backend of the .NET MAUI SKGLView to rather be a SKMetalView on Mac Catalyst.

There needs to be a new GPU view that uses Metal on Apple and maybe Vulkan on Android. But that is for another PR. We need an interface so people can even swap out their preferred backend. #2104

@mattleibow mattleibow merged commit 01a3218 into main Feb 10, 2024
1 of 2 checks passed
@mattleibow mattleibow deleted the dev/mac-gpu branch February 10, 2024 06:25
@taublast
Copy link
Contributor

We can let people choose the rendering backend at initialization with .UseSkiaSharp(optional settings) with enum of kind Vulkan, GL, ..., Auto.. so the correct handler will set to be used globally for the SKGLView.
A case when one would want to select backend at run-time I can think of is when one specific backend reveals itself not working on device so dev would want to programmatically select another one?..

@mattleibow
Copy link
Contributor Author

mattleibow commented Feb 22, 2024

@taublast I copied your comment to the issue where I am thinking to track that: #2104 (comment)

@gcadmes-extron
Copy link

gcadmes-extron commented Jul 11, 2024

I see this was merged in Feb 2024. Is the SKMetalView supposed to be operational for macOS?
The SKMetalView class doesn't appear to implement the IView. Attempting to add to a VerticalStackLayout or setting the Content of a page, this is the error displayed:
Will this be available soon? Also, still seeing this issue (#2050) regarding SKGLView, so that class is not an option either for macOS.

image
.NET SDK (x64)
SDK: /usr/local/share/dotnet/sdk/8.0.204/Sdks
SDK Versions:
	8.0.204
	8.0.101
	7.0.400
	7.0.307
	6.0.422
	6.0.421
	6.0.420
	6.0.418
	6.0.417
	6.0.416
	6.0.415
	6.0.414
	6.0.413
MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	8.0.4
	8.0.1
	7.0.10
	6.0.30
	6.0.29
	6.0.28
	6.0.26
	6.0.25
	6.0.24
	6.0.23
	6.0.22
	6.0.21

Xamarin.Mac
Version: 9.3.0.23 Visual Studio Professional
Hash: 9defd91b3
Branch: xcode14.3
Build date: 2023-10-23 16:14:59-0400

Xamarin.iOS
Version: 16.4.0.23 Visual Studio Professional
Hash: 9defd91b3
Branch: xcode14.3
Build date: 2023-10-23 16:15:00-0400

Operating System
Mac OS X 14.5.0
Darwin 23.5.0 Darwin Kernel Version 23.5.0
    Wed May  1 20:09:52 PDT 2024
    root:xnu-10063.121.3~5/RELEASE_X86_64 x86_64

@taublast
Copy link
Contributor

The issue #2050 is closed, you can use SKGLView on iOS to profit from Metal.
Cannot confirm it for MacCatalyst though.

@gcadmes-extron
Copy link

@taublast Thank you for confirming that iOS is operational.
As of right now, SKGLView and SKMetalView are still not supported on macOS.
I sure hope this task (2104) eventually comes to fruition for mac users. It's a bit dated. Other than this task, I'm unable to find any roadmaps that mention adding GPU support.

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

Successfully merging this pull request may close these issues.

3 participants