aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs
diff options
context:
space:
mode:
authorEmmanuel Hansen <emmausssss@gmail.com>2022-09-19 18:05:26 +0000
committerGitHub <noreply@github.com>2022-09-19 15:05:26 -0300
commit6f0395538b8e8af3bba7536b44780d57e51e8697 (patch)
tree4d3f4f620dd287fc1ca38ea9ea722b6e022301dd /Ryujinx.Graphics.Vulkan/VulkanRenderer.cs
parentb9f1ff3c7748c6a2665e76d17e86c3b7228f44fe (diff)
Avalonia - Use embedded window for avalonia (#3674)1.1.274
* wip * use embedded window * fix race condition on opengl Windows * fix glx issues on prime nvidia * fix mouse support win32 * clean up * addressed review * addressed review * fix warnings * fix sotware keyboard dialog * Update Ryujinx.Ava/Ui/Applet/SwkbdAppletDialog.axaml.cs Co-authored-by: gdkchan <gab.dark.100@gmail.com> * remove double semi Co-authored-by: gdkchan <gab.dark.100@gmail.com>
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/VulkanRenderer.cs')
-rw-r--r--Ryujinx.Graphics.Vulkan/VulkanRenderer.cs66
1 files changed, 5 insertions, 61 deletions
diff --git a/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs b/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs
index 5abe1be1..3776be9e 100644
--- a/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs
+++ b/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs
@@ -20,7 +20,6 @@ namespace Ryujinx.Graphics.Vulkan
private SurfaceKHR _surface;
private PhysicalDevice _physicalDevice;
private Device _device;
- private uint _queueFamilyIndex;
private WindowBase _window;
internal FormatCapabilities FormatCapabilities { get; private set; }
@@ -37,7 +36,6 @@ namespace Ryujinx.Graphics.Vulkan
internal ExtDebugReport DebugReportApi { get; private set; }
internal uint QueueFamilyIndex { get; private set; }
- public bool IsOffScreen { get; }
internal Queue Queue { get; private set; }
internal Queue BackgroundQueue { get; private set; }
internal object BackgroundQueueLock { get; private set; }
@@ -94,22 +92,6 @@ namespace Ryujinx.Graphics.Vulkan
Samplers = new HashSet<SamplerHolder>();
}
- public VulkanRenderer(Instance instance, Device device, PhysicalDevice physicalDevice, Queue queue, uint queueFamilyIndex, object lockObject)
- {
- _instance = instance;
- _physicalDevice = physicalDevice;
- _device = device;
- _queueFamilyIndex = queueFamilyIndex;
-
- Queue = queue;
- QueueLock = lockObject;
-
- IsOffScreen = true;
- Shaders = new HashSet<ShaderCollection>();
- Textures = new HashSet<ITexture>();
- Samplers = new HashSet<SamplerHolder>();
- }
-
private unsafe void LoadFeatures(string[] supportedExtensions, uint maxQueueCount, uint queueFamilyIndex)
{
FormatCapabilities = new FormatCapabilities(Api, _physicalDevice);
@@ -286,34 +268,6 @@ namespace Ryujinx.Graphics.Vulkan
_window = new Window(this, _surface, _physicalDevice, _device);
}
- private unsafe void SetupOffScreenContext(GraphicsDebugLevel logLevel)
- {
- var api = Vk.GetApi();
-
- Api = api;
-
- VulkanInitialization.CreateDebugCallbacks(api, logLevel, _instance, out var debugReport, out _debugReportCallback);
-
- DebugReportApi = debugReport;
-
- var supportedExtensions = VulkanInitialization.GetSupportedExtensions(api, _physicalDevice);
-
- uint propertiesCount;
-
- api.GetPhysicalDeviceQueueFamilyProperties(_physicalDevice, &propertiesCount, null);
-
- QueueFamilyProperties[] queueFamilyProperties = new QueueFamilyProperties[propertiesCount];
-
- fixed (QueueFamilyProperties* pProperties = queueFamilyProperties)
- {
- api.GetPhysicalDeviceQueueFamilyProperties(_physicalDevice, &propertiesCount, pProperties);
- }
-
- LoadFeatures(supportedExtensions, queueFamilyProperties[0].QueueCount, _queueFamilyIndex);
-
- _window = new ImageWindow(this, _physicalDevice, _device);
- }
-
public BufferHandle CreateBuffer(int size)
{
return BufferManager.CreateWithHandle(this, size, false);
@@ -519,14 +473,7 @@ namespace Ryujinx.Graphics.Vulkan
public void Initialize(GraphicsDebugLevel logLevel)
{
- if (IsOffScreen)
- {
- SetupOffScreenContext(logLevel);
- }
- else
- {
- SetupContext(logLevel);
- }
+ SetupContext(logLevel);
PrintGpuInformation();
}
@@ -638,15 +585,12 @@ namespace Ryujinx.Graphics.Vulkan
sampler.Dispose();
}
- if (!IsOffScreen)
- {
- SurfaceApi.DestroySurface(_instance, _surface, null);
+ SurfaceApi.DestroySurface(_instance, _surface, null);
- Api.DestroyDevice(_device, null);
+ Api.DestroyDevice(_device, null);
- // Last step destroy the instance
- Api.DestroyInstance(_instance, null);
- }
+ // Last step destroy the instance
+ Api.DestroyInstance(_instance, null);
}
}
}