diff --git a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs index 81a3c09b35..e8ae84eb03 100644 --- a/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs +++ b/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs @@ -149,12 +149,16 @@ namespace Avalonia.Rendering.Composition.Server try { - if (_renderTarget == null && !_compositor.IsReadyToCreateRenderTarget(_surfaces())) + if (_renderTarget == null) { - IsWaitingForReadyRenderTarget = IsEnabled; - return; + if (!_compositor.IsReadyToCreateRenderTarget(_surfaces())) + { + IsWaitingForReadyRenderTarget = IsEnabled; + return; + } + + _renderTarget = _compositor.CreateRenderTarget(_surfaces()); } - _renderTarget ??= _compositor.CreateRenderTarget(_surfaces()); } catch (RenderTargetNotReadyException) { diff --git a/src/Avalonia.Vulkan/VulkanContext.cs b/src/Avalonia.Vulkan/VulkanContext.cs index 6667055e8c..8691e55a05 100644 --- a/src/Avalonia.Vulkan/VulkanContext.cs +++ b/src/Avalonia.Vulkan/VulkanContext.cs @@ -41,6 +41,10 @@ internal class VulkanContext : IVulkanPlatformGraphicsContext { if (featureType == typeof(IVulkanContextExternalObjectsFeature)) return _externalObjectsFeature; + + if (featureType == typeof(IVulkanKhrSurfacePlatformSurfaceFactory)) + return _surfaceFactory; + return null; } @@ -71,4 +75,4 @@ internal class VulkanContext : IVulkanPlatformGraphicsContext throw new VulkanException("Unable to find a suitable platform surface"); } -} \ No newline at end of file +}