vulkan: Pass Vk instance to VulkanRenderer (#4859)
This will allow possible multiple driver selection without any need of LD preload. (useful when testing custom version of mesa for example)
This commit is contained in:
parent
162798b026
commit
a8950d6ac4
6 changed files with 23 additions and 20 deletions
|
@ -487,11 +487,12 @@ namespace Ryujinx.Headless.SDL2
|
|||
if (options.GraphicsBackend == GraphicsBackend.Vulkan && window is VulkanWindow vulkanWindow)
|
||||
{
|
||||
string preferredGpuId = string.Empty;
|
||||
Vk api = Vk.GetApi();
|
||||
|
||||
if (!string.IsNullOrEmpty(options.PreferredGpuVendor))
|
||||
{
|
||||
string preferredGpuVendor = options.PreferredGpuVendor.ToLowerInvariant();
|
||||
var devices = VulkanRenderer.GetPhysicalDevices();
|
||||
var devices = VulkanRenderer.GetPhysicalDevices(api);
|
||||
|
||||
foreach (var device in devices)
|
||||
{
|
||||
|
@ -504,6 +505,7 @@ namespace Ryujinx.Headless.SDL2
|
|||
}
|
||||
|
||||
return new VulkanRenderer(
|
||||
api,
|
||||
(instance, vk) => new SurfaceKHR((ulong)(vulkanWindow.CreateWindowSurface(instance.Handle))),
|
||||
vulkanWindow.GetRequiredInstanceExtensions,
|
||||
preferredGpuId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue