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:
Mary
2023-05-08 13:05:37 +02:00
committed by GitHub
parent 162798b026
commit a8950d6ac4
6 changed files with 23 additions and 20 deletions

View File

@ -35,6 +35,7 @@ using Ryujinx.Input.HLE;
using Ryujinx.Ui.Common;
using Ryujinx.Ui.Common.Configuration;
using Ryujinx.Ui.Common.Helper;
using Silk.NET.Vulkan;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.PixelFormats;
@ -701,6 +702,7 @@ namespace Ryujinx.Ava
if (ConfigurationState.Instance.Graphics.GraphicsBackend.Value == GraphicsBackend.Vulkan)
{
renderer = new VulkanRenderer(
Vk.GetApi(),
(_rendererHost.EmbeddedWindow as EmbeddedWindowVulkan).CreateSurface,
VulkanHelper.GetRequiredInstanceExtensions,
ConfigurationState.Instance.Graphics.PreferredGpu.Value);

View File

@ -25,6 +25,7 @@ using System.Linq;
using System.Runtime.InteropServices;
using System.Net.NetworkInformation;
using TimeZone = Ryujinx.Ava.UI.Models.TimeZone;
using Silk.NET.Vulkan;
namespace Ryujinx.Ava.UI.ViewModels
{
@ -310,7 +311,7 @@ namespace Ryujinx.Ava.UI.ViewModels
{
_gpuIds = new List<string>();
List<string> names = new();
var devices = VulkanRenderer.GetPhysicalDevices();
var devices = VulkanRenderer.GetPhysicalDevices(Vk.GetApi());
if (devices.Length == 0)
{