feat(macOS): Expose UseMetalOnMacOS feature#21174
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR exposes a new feature configuration option UseMetalOnMacOS to allow developers to explicitly control whether Metal or Software rendering is used on macOS, rather than relying solely on automatic detection.
- Adds a new nullable boolean property
UseMetalOnMacOStoFeatureConfiguration.Rendering - Updates the macOS Skia host initialization logic to respect the explicit configuration setting
- Includes a bug fix for software rendering coordinate calculations in the native view
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Uno.UI/FeatureConfiguration.cs | Adds the new UseMetalOnMacOS property with documentation |
| src/Uno.UI.Runtime.Skia.MacOS/Hosting/MacSkiaHost.cs | Updates initialization logic to use the new configuration property instead of RenderSurfaceType |
| src/Uno.UI.Runtime.Skia.MacOS/UnoNativeMac/UnoNativeMac/UNOSoftView.m | Fixes coordinate calculation for software rendering |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21174/docs/index.html |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21174/wasm-skia-net9/index.html |
|
The build 172308 found UI Test snapshots differences: Details
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21174/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21174/docs/index.html |
|
The build 172829 found UI Test snapshots differences: Details
|
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21174/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21174/docs/index.html |
|
The build 173264 found UI Test snapshots differences: Details
|
GitHub Issue: closes #
PR Type:
What is the current behavior? 🤔
Software rendering on macOS is automatic, when Metal is not available.
This makes it hard to test it properly.
What is the new behavior? 🚀
Setting
UseMetalOnMacOSto a specific value will use the chosen renderer.The default is
nullwhich remains the automatic detection of Metal availability.PR Checklist ✅
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information ℹ️