55using Avalonia . Platform ;
66using Avalonia . Platform . Surfaces ;
77using Avalonia . Vulkan ;
8- using Avalonia . Win32 . DirectX ;
98using Avalonia . Win32 . Interop ;
10- using MicroCom . Runtime ;
119
1210namespace Avalonia . Win32 . Vulkan ;
1311
@@ -18,13 +16,6 @@ internal class VulkanSupport
1816
1917 public static VulkanPlatformGraphics ? TryInitialize ( VulkanOptions options )
2018 {
21- if ( IsParallelsDisplayAdapter ( ) )
22- {
23- Logger . TryGet ( LogEventLevel . Warning , "Vulkan" ) ? . Log ( null ,
24- "Parallels Display Adapter detected; skipping Vulkan initialization and falling back to the next configured rendering mode." ) ;
25- return null ;
26- }
27-
2819 return VulkanPlatformGraphics . TryCreate ( options ?? new ( ) , new VulkanPlatformSpecificOptions
2920 {
3021 RequiredInstanceExtensions = { "VK_KHR_win32_surface" } ,
@@ -37,34 +28,6 @@ internal class VulkanSupport
3728 } ) ;
3829 }
3930
40- private static unsafe bool IsParallelsDisplayAdapter ( )
41- {
42- var factoryGuid = MicroComRuntime . GetGuidFor ( typeof ( IDXGIFactory1 ) ) ;
43- DirectXUnmanagedMethods . CreateDXGIFactory1 ( ref factoryGuid , out var factoryPointer ) ;
44-
45- if ( factoryPointer == null )
46- return false ;
47-
48- using var factory = MicroComRuntime . CreateProxyFor < IDXGIFactory1 > ( factoryPointer , true ) ;
49-
50- for ( uint index = 0 ; ; index ++ )
51- {
52- void * adapterPointer = null ;
53-
54- if ( factory . EnumAdapters1 ( index , & adapterPointer ) != 0 || adapterPointer == null )
55- return false ;
56-
57- using var adapter = MicroComRuntime . CreateProxyFor < IDXGIAdapter1 > ( adapterPointer , true ) ;
58- var desc = adapter . Desc1 ;
59- var description = Marshal . PtrToStringUni ( ( IntPtr ) desc . Description ) ;
60-
61- if ( description ? . StartsWith (
62- "Parallels Display Adapter" ,
63- StringComparison . OrdinalIgnoreCase ) == true )
64- return true ;
65- }
66- }
67-
6831 internal class VulkanSurfaceFactory : IVulkanKhrSurfacePlatformSurfaceFactory
6932 {
7033 public bool CanRenderToSurface ( IVulkanPlatformGraphicsContext context , IPlatformRenderSurface surface ) =>
0 commit comments