-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vulkan backend #12737
Vulkan backend #12737
Conversation
You can test this PR using the following package version. |
return new ImportedImage(_context, _pool, handle, properties); | ||
} | ||
|
||
[DllImport("/home/kekekeks/Projects/pinvokewtf/cmake-build-debug/libpinvokewtf.so")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug code
# Conflicts: # samples/GpuInterop/VulkanDemo/VulkanImage.cs # src/Avalonia.X11/X11Platform.cs # src/Windows/Avalonia.Win32/Win32GlManager.cs
You can test this PR using the following package version. |
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update target frameworks here as we did in other projects.
|
||
namespace Avalonia.Vulkan; | ||
|
||
[Unstable] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should start marking Unstable attribute with a specific reason why. Here and in other places.
FreeUsedCommandBuffers(); | ||
|
||
if (_handle.Handle != 0) | ||
_context.DeviceApi.DestroyCommandPool(_context.DeviceHandle, _handle, IntPtr.Zero); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it's expected to skip ThrowOnError here
.Information, | ||
_ => LogEventLevel.Information | ||
}; | ||
if (Logger.TryGet(level, "Vulkan", out var logger)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better to move "Vulkan" to a LogArea enum-class, so we have a self-documenting logger class.
: SKColorType.Bgra8888, SKColorSpace.CreateSrgb()); | ||
var image = surface.Snapshot(); | ||
_gpu.GrContext.Flush(); | ||
//surface.Canvas.Flush(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it's a debug code, and surface disposal will flush canvas as well.
if (renderingMode == Win32RenderingMode.Vulkan) | ||
{ | ||
var vulkan = VulkanSupport.TryInitialize(AvaloniaLocator.Current.GetService<VulkanOptions>() ?? new()); | ||
if (vulkan != null) | ||
return vulkan; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, no compositor support for now?
* Ported the old Vulkan PR * chop-chop * Support for external objects in vulkan backend * Fixed structure type * Removed debug code * sln fix * Don't force vulkan on windows
Adds Vulkan backend.
Note that importing DXGI handles for interop purposes isn't supported yet, only opaque vulkan handles are supported