AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.79k stars 2.23k forks source link

D3D11 rendering doesn't work in Skia #16411

Open amerkoleci opened 3 months ago

amerkoleci commented 3 months ago

Describe the bug

https://github.com/AvaloniaUI/Avalonia/blob/master/samples/GpuInterop/D3DDemo/D3D11DemoControl.cs doesn't work when using Avalonia with vulkan while it works with OpenGL Angle backend.

Probably vulkan Skia need to import the d3d shared handle.

I can submit PR if someone can guide me on the Skia vulkan backend.

To Reproduce

Uncomment this line https://github.com/AvaloniaUI/Avalonia/blob/master/samples/GpuInterop/MainWindow.axaml#L9 and comment the line bellow

Expected behavior

It should work as with OpenGL backend enabled

Avalonia version

11.1.0

OS

Windows

Additional context

No response

kekekeks commented 3 months ago

Vulkan backend currently only supports VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT and VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT.

For D3D interop to work other handle types need to be added.