Browse Source
Fix DeviceLuid byte ordering on MacOS GPU interop (#21293)
bytes.Reverse() was resolving to System.Linq.Enumberable.Reverse(). Forcing now to
MemoryExtensions.Reverse(Span) by calling AsSpan().
pull/21301/head
Diego Rivero
6 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
2 additions and
2 deletions
-
src/Avalonia.Native/AvaloniaNativeGlPlatformGraphics.cs
-
src/Avalonia.Native/Metal.cs
|
|
@ -264,7 +264,7 @@ namespace Avalonia.Native |
|
|
{ |
|
|
{ |
|
|
// We are reversing bytes to match MoltenVK (LUID is a Vulkan term after all)
|
|
|
// We are reversing bytes to match MoltenVK (LUID is a Vulkan term after all)
|
|
|
var bytes = BitConverter.GetBytes(registryId); |
|
|
var bytes = BitConverter.GetBytes(registryId); |
|
|
bytes.Reverse(); |
|
|
bytes.AsSpan().Reverse(); |
|
|
DeviceLuid = bytes; |
|
|
DeviceLuid = bytes; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
@ -102,7 +102,7 @@ internal class MetalExternalObjectsFeature : IMetalExternalObjectsFeature |
|
|
if (_device.GetIOKitRegistryId(®istryId) != 0) |
|
|
if (_device.GetIOKitRegistryId(®istryId) != 0) |
|
|
{ |
|
|
{ |
|
|
var bytes = BitConverter.GetBytes(registryId); |
|
|
var bytes = BitConverter.GetBytes(registryId); |
|
|
bytes.Reverse(); |
|
|
bytes.AsSpan().Reverse(); |
|
|
DeviceLuid = bytes; |
|
|
DeviceLuid = bytes; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|