Avalonia
Avalonia copied to clipboard
Vulkan Backend
What does the pull request do?
Adds vulkan backend for skia
What is the updated/expected behavior with this PR?
The backend can be enabled with UseVulkan
property in Win32PlatformOption
or X11PlatformOptions
.
How was the solution implemented (if it's not obvious)?
The backend uses Silk.Net as the vulkan bindings
Checklist
- [x] Add render control
- [ ] Added unit tests (if possible)?
- [ ] Added XML documentation to any related classes?
- [ ] Consider submitting a PR to https://github.com/AvaloniaUI/Documentation with user documentation
Breaking changes
None
Obsoletions / Deprecations
Fixed issues
Fixes #4274
You can test this PR using the following package version. 0.10.999-cibuild0019019-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019019-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019021-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019021-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019022-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019022-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
Not exactly acquainted with .NET/Nuget/etc, how do I use this in my own project while it's not merged?
@s5bug You can follow the guide from https://github.com/AvaloniaUI/Avalonia/wiki/Using-nightly-build-feed and instead of nightly feed url use the one provided by the PR bot above. And then simply update avalonia package version to the one from the bot as well.
The bot doesn't post a message every commit, is that still fine?
You can test this PR using the following package version. 0.10.999-cibuild0019159-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019192-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
Ok, using https://nuget.avaloniaui.net/repository/avalonia-all/index.json didn't work, but https://pkgs.dev.azure.com/AvaloniaUI/aa84306f-2981-47b9-8206-edb3bed6250d/_packaging/64388c94-6632-79aa-93af-ab6362308af7/nuget/v3/index.json did. Unfortunately I don't currently have the time to actually write and test Vulkan code.
You can test this PR using the following package version. 0.10.999-cibuild0019270-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
Open for review
You can test this PR using the following package version. 0.10.999-cibuild0019274-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019275-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
imo we need to at least cover those types with our own. Never a good idea to expose 3rd party types on the core library's API.
I'm seeing both Avalonia.Skia and Avalonia.Vulkan having public API members exposing raw Silk.NET types.
I understand that replacing Silk.NET for Avalonia.Vulkan might be problematic, and I won't be strictly against of it. Especially if it's only an optional package as an opengl replacement. But can we avoid it in the Avalonia.Skia?
Silk.Net objects can simply be replaced by only exposing their handles, which are just ulong
fields. Those can be used by the user on their own vulkan binding, or if using Silk.Net, just passing it to the respective constructors.
@emmauss Perhaps you can add original shader code there with a readme about how to compile it to spirv. In case somebody wants to modify it later.
Silk.Net objects can simply be replaced by only exposing their handles, which are just ulong fields
this is acceptable for me :)
@emmauss Perhaps you can add original shader code there with a readme about how to compile it to spirv. In case somebody wants to modify it later.
I've added the glsl files
You can test this PR using the following package version. 0.10.999-cibuild0019290-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019297-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019341-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019354-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
~Blocked by #7841~
You can test this PR using the following package version. 0.10.999-cibuild0019437-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019489-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]
You can test this PR using the following package version. 0.10.999-cibuild0019495-beta
. (feed url: https://nuget.avaloniaui.net/repository/avalonia-all/index.json) [PRBUILDID]