aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs
diff options
context:
space:
mode:
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);
}
}
}