aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Directory.Packages.props8
-rw-r--r--src/Ryujinx.Graphics.Vulkan/BufferHolder.cs6
-rw-r--r--src/Ryujinx.Graphics.Vulkan/BufferManager.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/BufferState.cs5
-rw-r--r--src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs8
-rw-r--r--src/Ryujinx.Graphics.Vulkan/DescriptorSetCollection.cs14
-rw-r--r--src/Ryujinx.Graphics.Vulkan/DescriptorSetManager.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/MemoryAllocatorBlockList.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/MoltenVK/MVKInitialization.cs18
-rw-r--r--src/Ryujinx.Graphics.Vulkan/PipelineBase.cs4
-rw-r--r--src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/PipelineLayoutFactory.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/RenderPassHolder.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/SamplerHolder.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/Shader.cs2
-rw-r--r--src/Ryujinx.Graphics.Vulkan/TextureCopy.cs12
-rw-r--r--src/Ryujinx.Graphics.Vulkan/TextureStorage.cs8
-rw-r--r--src/Ryujinx.Graphics.Vulkan/TextureView.cs14
-rw-r--r--src/Ryujinx.Graphics.Vulkan/Vendor.cs8
-rw-r--r--src/Ryujinx.Graphics.Vulkan/Window.cs12
-rw-r--r--src/Ryujinx.Gtk3/Program.cs3
-rw-r--r--src/Ryujinx.Headless.SDL2/Program.cs6
-rw-r--r--src/Ryujinx/Program.cs6
26 files changed, 94 insertions, 60 deletions
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 8a9fdc3be..301024cf8 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -39,9 +39,9 @@
39 <PackageVersion Include="securifybv.ShellLink" Version="0.1.0" /> 39 <PackageVersion Include="securifybv.ShellLink" Version="0.1.0" />
40 <PackageVersion Include="shaderc.net" Version="0.1.0" /> 40 <PackageVersion Include="shaderc.net" Version="0.1.0" />
41 <PackageVersion Include="SharpZipLib" Version="1.4.2" /> 41 <PackageVersion Include="SharpZipLib" Version="1.4.2" />
42 <PackageVersion Include="Silk.NET.Vulkan" Version="2.16.0" /> 42 <PackageVersion Include="Silk.NET.Vulkan" Version="2.21.0" />
43 <PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.16.0" /> 43 <PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.21.0" />
44 <PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.16.0" /> 44 <PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.21.0" />
45 <PackageVersion Include="SkiaSharp" Version="2.88.7" /> 45 <PackageVersion Include="SkiaSharp" Version="2.88.7" />
46 <PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="2.88.7" /> 46 <PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="2.88.7" />
47 <PackageVersion Include="SPB" Version="0.0.4-build32" /> 47 <PackageVersion Include="SPB" Version="0.0.4-build32" />
@@ -49,4 +49,4 @@
49 <PackageVersion Include="System.Management" Version="8.0.0" /> 49 <PackageVersion Include="System.Management" Version="8.0.0" />
50 <PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" /> 50 <PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />
51 </ItemGroup> 51 </ItemGroup>
52</Project> 52</Project> \ No newline at end of file
diff --git a/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs b/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs
index 3dcbc3130..e840fdc02 100644
--- a/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs
+++ b/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs
@@ -122,7 +122,7 @@ namespace Ryujinx.Graphics.Vulkan
122 Range = (uint)size, 122 Range = (uint)size,
123 }; 123 };
124 124
125 _gd.Api.CreateBufferView(_device, bufferViewCreateInfo, null, out var bufferView).ThrowOnError(); 125 _gd.Api.CreateBufferView(_device, in bufferViewCreateInfo, null, out var bufferView).ThrowOnError();
126 126
127 return new Auto<DisposableBufferView>(new DisposableBufferView(_gd.Api, _device, bufferView), this, _waitable, _buffer); 127 return new Auto<DisposableBufferView>(new DisposableBufferView(_gd.Api, _device, bufferView), this, _waitable, _buffer);
128 } 128 }
@@ -153,7 +153,7 @@ namespace Ryujinx.Graphics.Vulkan
153 PipelineStageFlags.AllCommandsBit, 153 PipelineStageFlags.AllCommandsBit,
154 DependencyFlags.DeviceGroupBit, 154 DependencyFlags.DeviceGroupBit,
155 1, 155 1,
156 memoryBarrier, 156 in memoryBarrier,
157 0, 157 0,
158 null, 158 null,
159 0, 159 0,
@@ -770,7 +770,7 @@ namespace Ryujinx.Graphics.Vulkan
770 0, 770 0,
771 null, 771 null,
772 1, 772 1,
773 memoryBarrier, 773 in memoryBarrier,
774 0, 774 0,
775 null); 775 null);
776 } 776 }
diff --git a/src/Ryujinx.Graphics.Vulkan/BufferManager.cs b/src/Ryujinx.Graphics.Vulkan/BufferManager.cs
index 1b6ac9988..7523913ec 100644
--- a/src/Ryujinx.Graphics.Vulkan/BufferManager.cs
+++ b/src/Ryujinx.Graphics.Vulkan/BufferManager.cs
@@ -221,7 +221,7 @@ namespace Ryujinx.Graphics.Vulkan
221 PBufferBinds = &bufferBind 221 PBufferBinds = &bufferBind
222 }; 222 };
223 223
224 gd.Api.QueueBindSparse(gd.Queue, 1, bindSparseInfo, default).ThrowOnError(); 224 gd.Api.QueueBindSparse(gd.Queue, 1, in bindSparseInfo, default).ThrowOnError();
225 } 225 }
226 226
227 var holder = new BufferHolder(gd, _device, buffer, (int)size, storageAllocations); 227 var holder = new BufferHolder(gd, _device, buffer, (int)size, storageAllocations);
diff --git a/src/Ryujinx.Graphics.Vulkan/BufferState.cs b/src/Ryujinx.Graphics.Vulkan/BufferState.cs
index d585dd53c..e49df765d 100644
--- a/src/Ryujinx.Graphics.Vulkan/BufferState.cs
+++ b/src/Ryujinx.Graphics.Vulkan/BufferState.cs
@@ -25,7 +25,10 @@ namespace Ryujinx.Graphics.Vulkan
25 { 25 {
26 var buffer = _buffer.Get(cbs, _offset, _size, true).Value; 26 var buffer = _buffer.Get(cbs, _offset, _size, true).Value;
27 27
28 gd.TransformFeedbackApi.CmdBindTransformFeedbackBuffers(cbs.CommandBuffer, binding, 1, buffer, (ulong)_offset, (ulong)_size); 28 ulong offset = (ulong)_offset;
29 ulong size = (ulong)_size;
30
31 gd.TransformFeedbackApi.CmdBindTransformFeedbackBuffers(cbs.CommandBuffer, binding, 1, in buffer, in offset, in size);
29 } 32 }
30 } 33 }
31 34
diff --git a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs
index e3938392f..e1fd3fb9d 100644
--- a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs
+++ b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs
@@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.Vulkan
45 Level = CommandBufferLevel.Primary, 45 Level = CommandBufferLevel.Primary,
46 }; 46 };
47 47
48 api.AllocateCommandBuffers(device, allocateInfo, out CommandBuffer); 48 api.AllocateCommandBuffers(device, in allocateInfo, out CommandBuffer);
49 49
50 Dependants = new List<IAuto>(); 50 Dependants = new List<IAuto>();
51 Waitables = new List<MultiFenceHolder>(); 51 Waitables = new List<MultiFenceHolder>();
@@ -83,7 +83,7 @@ namespace Ryujinx.Graphics.Vulkan
83 CommandPoolCreateFlags.ResetCommandBufferBit, 83 CommandPoolCreateFlags.ResetCommandBufferBit,
84 }; 84 };
85 85
86 api.CreateCommandPool(device, commandPoolCreateInfo, null, out _pool).ThrowOnError(); 86 api.CreateCommandPool(device, in commandPoolCreateInfo, null, out _pool).ThrowOnError();
87 87
88 // We need at least 2 command buffers to get texture data in some cases. 88 // We need at least 2 command buffers to get texture data in some cases.
89 _totalCommandBuffers = isLight ? 2 : MaxCommandBuffers; 89 _totalCommandBuffers = isLight ? 2 : MaxCommandBuffers;
@@ -253,7 +253,7 @@ namespace Ryujinx.Graphics.Vulkan
253 SType = StructureType.CommandBufferBeginInfo, 253 SType = StructureType.CommandBufferBeginInfo,
254 }; 254 };
255 255
256 _api.BeginCommandBuffer(entry.CommandBuffer, commandBufferBeginInfo).ThrowOnError(); 256 _api.BeginCommandBuffer(entry.CommandBuffer, in commandBufferBeginInfo).ThrowOnError();
257 257
258 return new CommandBufferScoped(this, entry.CommandBuffer, cursor); 258 return new CommandBufferScoped(this, entry.CommandBuffer, cursor);
259 } 259 }
@@ -311,7 +311,7 @@ namespace Ryujinx.Graphics.Vulkan
311 311
312 lock (_queueLock) 312 lock (_queueLock)
313 { 313 {
314 _api.QueueSubmit(_queue, 1, sInfo, entry.Fence.GetUnsafe()).ThrowOnError(); 314 _api.QueueSubmit(_queue, 1, in sInfo, entry.Fence.GetUnsafe()).ThrowOnError();
315 } 315 }
316 } 316 }
317 } 317 }
diff --git a/src/Ryujinx.Graphics.Vulkan/DescriptorSetCollection.cs b/src/Ryujinx.Graphics.Vulkan/DescriptorSetCollection.cs
index 846dd5c7d..40fc01b24 100644
--- a/src/Ryujinx.Graphics.Vulkan/DescriptorSetCollection.cs
+++ b/src/Ryujinx.Graphics.Vulkan/DescriptorSetCollection.cs
@@ -43,7 +43,7 @@ namespace Ryujinx.Graphics.Vulkan
43 PBufferInfo = &bufferInfo, 43 PBufferInfo = &bufferInfo,
44 }; 44 };
45 45
46 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); 46 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
47 } 47 }
48 } 48 }
49 49
@@ -66,7 +66,7 @@ namespace Ryujinx.Graphics.Vulkan
66 PBufferInfo = pBufferInfo, 66 PBufferInfo = pBufferInfo,
67 }; 67 };
68 68
69 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); 69 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
70 } 70 }
71 } 71 }
72 72
@@ -84,7 +84,7 @@ namespace Ryujinx.Graphics.Vulkan
84 PImageInfo = &imageInfo, 84 PImageInfo = &imageInfo,
85 }; 85 };
86 86
87 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); 87 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
88 } 88 }
89 } 89 }
90 90
@@ -107,7 +107,7 @@ namespace Ryujinx.Graphics.Vulkan
107 PImageInfo = pImageInfo, 107 PImageInfo = pImageInfo,
108 }; 108 };
109 109
110 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); 110 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
111 } 111 }
112 } 112 }
113 113
@@ -144,7 +144,7 @@ namespace Ryujinx.Graphics.Vulkan
144 PImageInfo = pImageInfo, 144 PImageInfo = pImageInfo,
145 }; 145 };
146 146
147 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); 147 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
148 148
149 i += count - 1; 149 i += count - 1;
150 } 150 }
@@ -166,7 +166,7 @@ namespace Ryujinx.Graphics.Vulkan
166 PTexelBufferView = &texelBufferView, 166 PTexelBufferView = &texelBufferView,
167 }; 167 };
168 168
169 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); 169 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
170 } 170 }
171 } 171 }
172 172
@@ -200,7 +200,7 @@ namespace Ryujinx.Graphics.Vulkan
200 PTexelBufferView = pTexelBufferView + i, 200 PTexelBufferView = pTexelBufferView + i,
201 }; 201 };
202 202
203 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, writeDescriptorSet, 0, null); 203 _holder.Api.UpdateDescriptorSets(_holder.Device, 1, in writeDescriptorSet, 0, null);
204 } 204 }
205 205
206 i += count; 206 i += count;
diff --git a/src/Ryujinx.Graphics.Vulkan/DescriptorSetManager.cs b/src/Ryujinx.Graphics.Vulkan/DescriptorSetManager.cs
index 707ae1292..97669942c 100644
--- a/src/Ryujinx.Graphics.Vulkan/DescriptorSetManager.cs
+++ b/src/Ryujinx.Graphics.Vulkan/DescriptorSetManager.cs
@@ -40,7 +40,7 @@ namespace Ryujinx.Graphics.Vulkan
40 PPoolSizes = pPoolsSize, 40 PPoolSizes = pPoolsSize,
41 }; 41 };
42 42
43 Api.CreateDescriptorPool(device, descriptorPoolCreateInfo, null, out _pool).ThrowOnError(); 43 Api.CreateDescriptorPool(device, in descriptorPoolCreateInfo, null, out _pool).ThrowOnError();
44 } 44 }
45 } 45 }
46 46
diff --git a/src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs b/src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs
index 5c5a8f3ad..763d26eb5 100644
--- a/src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs
+++ b/src/Ryujinx.Graphics.Vulkan/FramebufferParams.cs
@@ -250,7 +250,7 @@ namespace Ryujinx.Graphics.Vulkan
250 Layers = Layers, 250 Layers = Layers,
251 }; 251 };
252 252
253 api.CreateFramebuffer(_device, framebufferCreateInfo, null, out var framebuffer).ThrowOnError(); 253 api.CreateFramebuffer(_device, in framebufferCreateInfo, null, out var framebuffer).ThrowOnError();
254 return new Auto<DisposableFramebuffer>(new DisposableFramebuffer(api, _device, framebuffer), null, _attachments); 254 return new Auto<DisposableFramebuffer>(new DisposableFramebuffer(api, _device, framebuffer), null, _attachments);
255 } 255 }
256 256
diff --git a/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs b/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs
index baccc698f..ff1565246 100644
--- a/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs
+++ b/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs
@@ -115,7 +115,7 @@ namespace Ryujinx.Graphics.Vulkan
115 PNext = &importInfo, 115 PNext = &importInfo,
116 }; 116 };
117 117
118 Result result = _api.AllocateMemory(_device, memoryAllocateInfo, null, out var deviceMemory); 118 Result result = _api.AllocateMemory(_device, in memoryAllocateInfo, null, out var deviceMemory);
119 119
120 if (result < Result.Success) 120 if (result < Result.Success)
121 { 121 {
diff --git a/src/Ryujinx.Graphics.Vulkan/MemoryAllocatorBlockList.cs b/src/Ryujinx.Graphics.Vulkan/MemoryAllocatorBlockList.cs
index a1acc90f9..3d42ed7e2 100644
--- a/src/Ryujinx.Graphics.Vulkan/MemoryAllocatorBlockList.cs
+++ b/src/Ryujinx.Graphics.Vulkan/MemoryAllocatorBlockList.cs
@@ -220,7 +220,7 @@ namespace Ryujinx.Graphics.Vulkan
220 MemoryTypeIndex = (uint)MemoryTypeIndex, 220 MemoryTypeIndex = (uint)MemoryTypeIndex,
221 }; 221 };
222 222
223 _api.AllocateMemory(_device, memoryAllocateInfo, null, out var deviceMemory).ThrowOnError(); 223 _api.AllocateMemory(_device, in memoryAllocateInfo, null, out var deviceMemory).ThrowOnError();
224 224
225 IntPtr hostPointer = IntPtr.Zero; 225 IntPtr hostPointer = IntPtr.Zero;
226 226
diff --git a/src/Ryujinx.Graphics.Vulkan/MoltenVK/MVKInitialization.cs b/src/Ryujinx.Graphics.Vulkan/MoltenVK/MVKInitialization.cs
index 457240aa0..930d6b525 100644
--- a/src/Ryujinx.Graphics.Vulkan/MoltenVK/MVKInitialization.cs
+++ b/src/Ryujinx.Graphics.Vulkan/MoltenVK/MVKInitialization.cs
@@ -1,3 +1,4 @@
1using Silk.NET.Core.Loader;
1using Silk.NET.Vulkan; 2using Silk.NET.Vulkan;
2using System; 3using System;
3using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
@@ -8,6 +9,8 @@ namespace Ryujinx.Graphics.Vulkan.MoltenVK
8 [SupportedOSPlatform("macos")] 9 [SupportedOSPlatform("macos")]
9 public static partial class MVKInitialization 10 public static partial class MVKInitialization
10 { 11 {
12 private const string VulkanLib = "libvulkan.dylib";
13
11 [LibraryImport("libMoltenVK.dylib")] 14 [LibraryImport("libMoltenVK.dylib")]
12 private static partial Result vkGetMoltenVKConfigurationMVK(IntPtr unusedInstance, out MVKConfiguration config, in IntPtr configSize); 15 private static partial Result vkGetMoltenVKConfigurationMVK(IntPtr unusedInstance, out MVKConfiguration config, in IntPtr configSize);
13 16
@@ -29,5 +32,20 @@ namespace Ryujinx.Graphics.Vulkan.MoltenVK
29 32
30 vkSetMoltenVKConfigurationMVK(IntPtr.Zero, config, configSize); 33 vkSetMoltenVKConfigurationMVK(IntPtr.Zero, config, configSize);
31 } 34 }
35
36 private static string[] Resolver(string path)
37 {
38 if (path.EndsWith(VulkanLib))
39 {
40 path = path[..^VulkanLib.Length] + "libMoltenVK.dylib";
41 return [path];
42 }
43 return Array.Empty<string>();
44 }
45
46 public static void InitializeResolver()
47 {
48 ((DefaultPathResolver)PathResolver.Default).Resolvers.Insert(0, Resolver);
49 }
32 } 50 }
33} 51}
diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs
index bda6167d7..57fa59264 100644
--- a/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs
+++ b/src/Ryujinx.Graphics.Vulkan/PipelineBase.cs
@@ -102,7 +102,7 @@ namespace Ryujinx.Graphics.Vulkan
102 SType = StructureType.PipelineCacheCreateInfo, 102 SType = StructureType.PipelineCacheCreateInfo,
103 }; 103 };
104 104
105 gd.Api.CreatePipelineCache(device, pipelineCacheCreateInfo, null, out PipelineCache).ThrowOnError(); 105 gd.Api.CreatePipelineCache(device, in pipelineCacheCreateInfo, null, out PipelineCache).ThrowOnError();
106 106
107 _descriptorSetUpdater = new DescriptorSetUpdater(gd, device); 107 _descriptorSetUpdater = new DescriptorSetUpdater(gd, device);
108 _vertexBufferUpdater = new VertexBufferUpdater(gd); 108 _vertexBufferUpdater = new VertexBufferUpdater(gd);
@@ -1628,7 +1628,7 @@ namespace Ryujinx.Graphics.Vulkan
1628 ClearValueCount = 1, 1628 ClearValueCount = 1,
1629 }; 1629 };
1630 1630
1631 Gd.Api.CmdBeginRenderPass(CommandBuffer, renderPassBeginInfo, SubpassContents.Inline); 1631 Gd.Api.CmdBeginRenderPass(CommandBuffer, in renderPassBeginInfo, SubpassContents.Inline);
1632 RenderPassActive = true; 1632 RenderPassActive = true;
1633 } 1633 }
1634 } 1634 }
diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs
index 89ce10b0a..85069c6b2 100644
--- a/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs
+++ b/src/Ryujinx.Graphics.Vulkan/PipelineConverter.cs
@@ -116,7 +116,7 @@ namespace Ryujinx.Graphics.Vulkan
116 DependencyCount = 1, 116 DependencyCount = 1,
117 }; 117 };
118 118
119 gd.Api.CreateRenderPass(device, renderPassCreateInfo, null, out var renderPass).ThrowOnError(); 119 gd.Api.CreateRenderPass(device, in renderPassCreateInfo, null, out var renderPass).ThrowOnError();
120 120
121 return new DisposableRenderPass(gd.Api, device, renderPass); 121 return new DisposableRenderPass(gd.Api, device, renderPass);
122 } 122 }
diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineLayoutFactory.cs b/src/Ryujinx.Graphics.Vulkan/PipelineLayoutFactory.cs
index bca119f6a..8d7815616 100644
--- a/src/Ryujinx.Graphics.Vulkan/PipelineLayoutFactory.cs
+++ b/src/Ryujinx.Graphics.Vulkan/PipelineLayoutFactory.cs
@@ -91,7 +91,7 @@ namespace Ryujinx.Graphics.Vulkan
91 Flags = flags, 91 Flags = flags,
92 }; 92 };
93 93
94 gd.Api.CreateDescriptorSetLayout(device, descriptorSetLayoutCreateInfo, null, out layouts[setIndex]).ThrowOnError(); 94 gd.Api.CreateDescriptorSetLayout(device, in descriptorSetLayoutCreateInfo, null, out layouts[setIndex]).ThrowOnError();
95 } 95 }
96 } 96 }
97 97
diff --git a/src/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs b/src/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs
index 714cb2833..c9a546648 100644
--- a/src/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs
+++ b/src/Ryujinx.Graphics.Vulkan/Queries/BufferedQuery.cs
@@ -52,7 +52,7 @@ namespace Ryujinx.Graphics.Vulkan.Queries
52 PipelineStatistics = flags, 52 PipelineStatistics = flags,
53 }; 53 };
54 54
55 gd.Api.CreateQueryPool(device, queryPoolCreateInfo, null, out _queryPool).ThrowOnError(); 55 gd.Api.CreateQueryPool(device, in queryPoolCreateInfo, null, out _queryPool).ThrowOnError();
56 } 56 }
57 57
58 var buffer = gd.BufferManager.Create(gd, sizeof(long), forConditionalRendering: true); 58 var buffer = gd.BufferManager.Create(gd, sizeof(long), forConditionalRendering: true);
diff --git a/src/Ryujinx.Graphics.Vulkan/RenderPassHolder.cs b/src/Ryujinx.Graphics.Vulkan/RenderPassHolder.cs
index b2dd0dd87..a364c5716 100644
--- a/src/Ryujinx.Graphics.Vulkan/RenderPassHolder.cs
+++ b/src/Ryujinx.Graphics.Vulkan/RenderPassHolder.cs
@@ -125,7 +125,7 @@ namespace Ryujinx.Graphics.Vulkan
125 DependencyCount = 1, 125 DependencyCount = 1,
126 }; 126 };
127 127
128 gd.Api.CreateRenderPass(device, renderPassCreateInfo, null, out var renderPass).ThrowOnError(); 128 gd.Api.CreateRenderPass(device, in renderPassCreateInfo, null, out var renderPass).ThrowOnError();
129 129
130 _renderPass = new Auto<DisposableRenderPass>(new DisposableRenderPass(gd.Api, device, renderPass)); 130 _renderPass = new Auto<DisposableRenderPass>(new DisposableRenderPass(gd.Api, device, renderPass));
131 } 131 }
diff --git a/src/Ryujinx.Graphics.Vulkan/SamplerHolder.cs b/src/Ryujinx.Graphics.Vulkan/SamplerHolder.cs
index f67daeecc..7f37ab139 100644
--- a/src/Ryujinx.Graphics.Vulkan/SamplerHolder.cs
+++ b/src/Ryujinx.Graphics.Vulkan/SamplerHolder.cs
@@ -68,7 +68,7 @@ namespace Ryujinx.Graphics.Vulkan
68 samplerCreateInfo.BorderColor = BorderColor.FloatCustomExt; 68 samplerCreateInfo.BorderColor = BorderColor.FloatCustomExt;
69 } 69 }
70 70
71 gd.Api.CreateSampler(device, samplerCreateInfo, null, out var sampler).ThrowOnError(); 71 gd.Api.CreateSampler(device, in samplerCreateInfo, null, out var sampler).ThrowOnError();
72 72
73 _sampler = new Auto<DisposableSampler>(new DisposableSampler(gd.Api, device, sampler)); 73 _sampler = new Auto<DisposableSampler>(new DisposableSampler(gd.Api, device, sampler));
74 } 74 }
diff --git a/src/Ryujinx.Graphics.Vulkan/Shader.cs b/src/Ryujinx.Graphics.Vulkan/Shader.cs
index 06f3499db..1c8caffd9 100644
--- a/src/Ryujinx.Graphics.Vulkan/Shader.cs
+++ b/src/Ryujinx.Graphics.Vulkan/Shader.cs
@@ -64,7 +64,7 @@ namespace Ryujinx.Graphics.Vulkan
64 PCode = (uint*)pCode, 64 PCode = (uint*)pCode,
65 }; 65 };
66 66
67 api.CreateShaderModule(device, shaderModuleCreateInfo, null, out _module).ThrowOnError(); 67 api.CreateShaderModule(device, in shaderModuleCreateInfo, null, out _module).ThrowOnError();
68 } 68 }
69 69
70 CompileStatus = ProgramLinkStatus.Success; 70 CompileStatus = ProgramLinkStatus.Success;
diff --git a/src/Ryujinx.Graphics.Vulkan/TextureCopy.cs b/src/Ryujinx.Graphics.Vulkan/TextureCopy.cs
index fdc0a248b..45cddd772 100644
--- a/src/Ryujinx.Graphics.Vulkan/TextureCopy.cs
+++ b/src/Ryujinx.Graphics.Vulkan/TextureCopy.cs
@@ -88,7 +88,7 @@ namespace Ryujinx.Graphics.Vulkan
88 DstOffsets = dstOffsets, 88 DstOffsets = dstOffsets,
89 }; 89 };
90 90
91 api.CmdBlitImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, region, filter); 91 api.CmdBlitImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, in region, filter);
92 92
93 copySrcLevel++; 93 copySrcLevel++;
94 copyDstLevel++; 94 copyDstLevel++;
@@ -320,13 +320,13 @@ namespace Ryujinx.Graphics.Vulkan
320 { 320 {
321 var region = new ImageResolve(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent); 321 var region = new ImageResolve(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent);
322 322
323 api.CmdResolveImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, region); 323 api.CmdResolveImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, in region);
324 } 324 }
325 else 325 else
326 { 326 {
327 var region = new ImageCopy(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent); 327 var region = new ImageCopy(srcSl, new Offset3D(0, 0, srcZ), dstSl, new Offset3D(0, 0, dstZ), extent);
328 328
329 api.CmdCopyImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, region); 329 api.CmdCopyImage(commandBuffer, srcImage, ImageLayout.General, dstImage, ImageLayout.General, 1, in region);
330 } 330 }
331 331
332 width = Math.Max(1, width >> 1); 332 width = Math.Max(1, width >> 1);
@@ -422,7 +422,7 @@ namespace Ryujinx.Graphics.Vulkan
422 DependencyCount = 1, 422 DependencyCount = 1,
423 }; 423 };
424 424
425 gd.Api.CreateRenderPass2(device, renderPassCreateInfo, null, out var renderPass).ThrowOnError(); 425 gd.Api.CreateRenderPass2(device, in renderPassCreateInfo, null, out var renderPass).ThrowOnError();
426 426
427 using var rp = new Auto<DisposableRenderPass>(new DisposableRenderPass(gd.Api, device, renderPass)); 427 using var rp = new Auto<DisposableRenderPass>(new DisposableRenderPass(gd.Api, device, renderPass));
428 428
@@ -445,7 +445,7 @@ namespace Ryujinx.Graphics.Vulkan
445 Layers = (uint)src.Layers, 445 Layers = (uint)src.Layers,
446 }; 446 };
447 447
448 gd.Api.CreateFramebuffer(device, framebufferCreateInfo, null, out var framebuffer).ThrowOnError(); 448 gd.Api.CreateFramebuffer(device, in framebufferCreateInfo, null, out var framebuffer).ThrowOnError();
449 using var fb = new Auto<DisposableFramebuffer>(new DisposableFramebuffer(gd.Api, device, framebuffer), null, srcView, dstView); 449 using var fb = new Auto<DisposableFramebuffer>(new DisposableFramebuffer(gd.Api, device, framebuffer), null, srcView, dstView);
450 450
451 var renderArea = new Rect2D(null, new Extent2D((uint)src.Info.Width, (uint)src.Info.Height)); 451 var renderArea = new Rect2D(null, new Extent2D((uint)src.Info.Width, (uint)src.Info.Height));
@@ -465,7 +465,7 @@ namespace Ryujinx.Graphics.Vulkan
465 // to resolve the depth-stencil texture. 465 // to resolve the depth-stencil texture.
466 // TODO: Do speculative resolve and part of the same render pass as the draw to avoid 466 // TODO: Do speculative resolve and part of the same render pass as the draw to avoid
467 // ending the current render pass? 467 // ending the current render pass?
468 gd.Api.CmdBeginRenderPass(cbs.CommandBuffer, renderPassBeginInfo, SubpassContents.Inline); 468 gd.Api.CmdBeginRenderPass(cbs.CommandBuffer, in renderPassBeginInfo, SubpassContents.Inline);
469 gd.Api.CmdEndRenderPass(cbs.CommandBuffer); 469 gd.Api.CmdEndRenderPass(cbs.CommandBuffer);
470 } 470 }
471 } 471 }
diff --git a/src/Ryujinx.Graphics.Vulkan/TextureStorage.cs b/src/Ryujinx.Graphics.Vulkan/TextureStorage.cs
index f36db68de..f78b9ed47 100644
--- a/src/Ryujinx.Graphics.Vulkan/TextureStorage.cs
+++ b/src/Ryujinx.Graphics.Vulkan/TextureStorage.cs
@@ -114,7 +114,7 @@ namespace Ryujinx.Graphics.Vulkan
114 Flags = flags, 114 Flags = flags,
115 }; 115 };
116 116
117 gd.Api.CreateImage(device, imageCreateInfo, null, out _image).ThrowOnError(); 117 gd.Api.CreateImage(device, in imageCreateInfo, null, out _image).ThrowOnError();
118 118
119 if (foreignAllocation == null) 119 if (foreignAllocation == null)
120 { 120 {
@@ -284,7 +284,7 @@ namespace Ryujinx.Graphics.Vulkan
284 0, 284 0,
285 null, 285 null,
286 1, 286 1,
287 barrier); 287 in barrier);
288 288
289 if (useTempCbs) 289 if (useTempCbs)
290 { 290 {
@@ -401,11 +401,11 @@ namespace Ryujinx.Graphics.Vulkan
401 401
402 if (to) 402 if (to)
403 { 403 {
404 _gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, region); 404 _gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, in region);
405 } 405 }
406 else 406 else
407 { 407 {
408 _gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, region); 408 _gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, in region);
409 } 409 }
410 410
411 offset += mipSize; 411 offset += mipSize;
diff --git a/src/Ryujinx.Graphics.Vulkan/TextureView.cs b/src/Ryujinx.Graphics.Vulkan/TextureView.cs
index d4f26a2dd..c5453c0c7 100644
--- a/src/Ryujinx.Graphics.Vulkan/TextureView.cs
+++ b/src/Ryujinx.Graphics.Vulkan/TextureView.cs
@@ -117,7 +117,7 @@ namespace Ryujinx.Graphics.Vulkan
117 PNext = &imageViewUsage, 117 PNext = &imageViewUsage,
118 }; 118 };
119 119
120 gd.Api.CreateImageView(device, imageCreateInfo, null, out var imageView).ThrowOnError(); 120 gd.Api.CreateImageView(device, in imageCreateInfo, null, out var imageView).ThrowOnError();
121 return new Auto<DisposableImageView>(new DisposableImageView(gd.Api, device, imageView), null, storage.GetImage()); 121 return new Auto<DisposableImageView>(new DisposableImageView(gd.Api, device, imageView), null, storage.GetImage());
122 } 122 }
123 123
@@ -492,7 +492,7 @@ namespace Ryujinx.Graphics.Vulkan
492 dstStageMask, 492 dstStageMask,
493 DependencyFlags.None, 493 DependencyFlags.None,
494 1, 494 1,
495 memoryBarrier, 495 in memoryBarrier,
496 0, 496 0,
497 null, 497 null,
498 0, 498 0,
@@ -557,7 +557,7 @@ namespace Ryujinx.Graphics.Vulkan
557 0, 557 0,
558 null, 558 null,
559 1, 559 1,
560 memoryBarrier); 560 in memoryBarrier);
561 } 561 }
562 562
563 public TextureView GetView(Format format) 563 public TextureView GetView(Format format)
@@ -949,11 +949,11 @@ namespace Ryujinx.Graphics.Vulkan
949 949
950 if (to) 950 if (to)
951 { 951 {
952 _gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, region); 952 _gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, in region);
953 } 953 }
954 else 954 else
955 { 955 {
956 _gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, region); 956 _gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, in region);
957 } 957 }
958 958
959 offset += mipSize; 959 offset += mipSize;
@@ -1010,11 +1010,11 @@ namespace Ryujinx.Graphics.Vulkan
1010 1010
1011 if (to) 1011 if (to)
1012 { 1012 {
1013 _gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, region); 1013 _gd.Api.CmdCopyImageToBuffer(commandBuffer, image, ImageLayout.General, buffer, 1, in region);
1014 } 1014 }
1015 else 1015 else
1016 { 1016 {
1017 _gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, region); 1017 _gd.Api.CmdCopyBufferToImage(commandBuffer, buffer, image, ImageLayout.General, 1, in region);
1018 } 1018 }
1019 } 1019 }
1020 1020
diff --git a/src/Ryujinx.Graphics.Vulkan/Vendor.cs b/src/Ryujinx.Graphics.Vulkan/Vendor.cs
index 802771ede..55ae0cd81 100644
--- a/src/Ryujinx.Graphics.Vulkan/Vendor.cs
+++ b/src/Ryujinx.Graphics.Vulkan/Vendor.cs
@@ -90,11 +90,9 @@ namespace Ryujinx.Graphics.Vulkan
90 DriverId.SamsungProprietary => "Samsung", 90 DriverId.SamsungProprietary => "Samsung",
91 DriverId.MesaVenus => "Venus", 91 DriverId.MesaVenus => "Venus",
92 DriverId.MesaDozen => "Dozen", 92 DriverId.MesaDozen => "Dozen",
93 93 DriverId.MesaNvk => "NVK",
94 // TODO: Use real enum when we have an up to date Silk.NET. 94 DriverId.ImaginationOpenSourceMesa => "Imagination (Open)",
95 (DriverId)24 => "NVK", 95 DriverId.MesaAgxv => "Honeykrisp",
96 (DriverId)25 => "Imagination (Open)",
97 (DriverId)26 => "Honeykrisp",
98 _ => id.ToString(), 96 _ => id.ToString(),
99 }; 97 };
100 } 98 }
diff --git a/src/Ryujinx.Graphics.Vulkan/Window.cs b/src/Ryujinx.Graphics.Vulkan/Window.cs
index efb0b31f9..d67362be3 100644
--- a/src/Ryujinx.Graphics.Vulkan/Window.cs
+++ b/src/Ryujinx.Graphics.Vulkan/Window.cs
@@ -160,7 +160,7 @@ namespace Ryujinx.Graphics.Vulkan
160 SwizzleComponent.Blue, 160 SwizzleComponent.Blue,
161 SwizzleComponent.Alpha); 161 SwizzleComponent.Alpha);
162 162
163 _gd.SwapchainApi.CreateSwapchain(_device, swapchainCreateInfo, null, out _swapchain).ThrowOnError(); 163 _gd.SwapchainApi.CreateSwapchain(_device, in swapchainCreateInfo, null, out _swapchain).ThrowOnError();
164 164
165 _gd.SwapchainApi.GetSwapchainImages(_device, _swapchain, &imageCount, null); 165 _gd.SwapchainApi.GetSwapchainImages(_device, _swapchain, &imageCount, null);
166 166
@@ -187,14 +187,14 @@ namespace Ryujinx.Graphics.Vulkan
187 187
188 for (int i = 0; i < _imageAvailableSemaphores.Length; i++) 188 for (int i = 0; i < _imageAvailableSemaphores.Length; i++)
189 { 189 {
190 _gd.Api.CreateSemaphore(_device, semaphoreCreateInfo, null, out _imageAvailableSemaphores[i]).ThrowOnError(); 190 _gd.Api.CreateSemaphore(_device, in semaphoreCreateInfo, null, out _imageAvailableSemaphores[i]).ThrowOnError();
191 } 191 }
192 192
193 _renderFinishedSemaphores = new Semaphore[imageCount]; 193 _renderFinishedSemaphores = new Semaphore[imageCount];
194 194
195 for (int i = 0; i < _renderFinishedSemaphores.Length; i++) 195 for (int i = 0; i < _renderFinishedSemaphores.Length; i++)
196 { 196 {
197 _gd.Api.CreateSemaphore(_device, semaphoreCreateInfo, null, out _renderFinishedSemaphores[i]).ThrowOnError(); 197 _gd.Api.CreateSemaphore(_device, in semaphoreCreateInfo, null, out _renderFinishedSemaphores[i]).ThrowOnError();
198 } 198 }
199 } 199 }
200 200
@@ -220,7 +220,7 @@ namespace Ryujinx.Graphics.Vulkan
220 SubresourceRange = subresourceRange, 220 SubresourceRange = subresourceRange,
221 }; 221 };
222 222
223 _gd.Api.CreateImageView(_device, imageCreateInfo, null, out var imageView).ThrowOnError(); 223 _gd.Api.CreateImageView(_device, in imageCreateInfo, null, out var imageView).ThrowOnError();
224 224
225 return new TextureView(_gd, _device, new DisposableImageView(_gd.Api, _device, imageView), info, format); 225 return new TextureView(_gd, _device, new DisposableImageView(_gd.Api, _device, imageView), info, format);
226 } 226 }
@@ -479,7 +479,7 @@ namespace Ryujinx.Graphics.Vulkan
479 479
480 lock (_gd.QueueLock) 480 lock (_gd.QueueLock)
481 { 481 {
482 _gd.SwapchainApi.QueuePresent(_gd.Queue, presentInfo); 482 _gd.SwapchainApi.QueuePresent(_gd.Queue, in presentInfo);
483 } 483 }
484 } 484 }
485 485
@@ -611,7 +611,7 @@ namespace Ryujinx.Graphics.Vulkan
611 0, 611 0,
612 null, 612 null,
613 1, 613 1,
614 barrier); 614 in barrier);
615 } 615 }
616 616
617 private void CaptureFrame(TextureView texture, int x, int y, int width, int height, bool isBgra, bool flipX, bool flipY) 617 private void CaptureFrame(TextureView texture, int x, int y, int width, int height, bool isBgra, bool flipX, bool flipY)
diff --git a/src/Ryujinx.Gtk3/Program.cs b/src/Ryujinx.Gtk3/Program.cs
index 745335ac9..8bad1a0c7 100644
--- a/src/Ryujinx.Gtk3/Program.cs
+++ b/src/Ryujinx.Gtk3/Program.cs
@@ -4,6 +4,7 @@ using Ryujinx.Common.Configuration;
4using Ryujinx.Common.GraphicsDriver; 4using Ryujinx.Common.GraphicsDriver;
5using Ryujinx.Common.Logging; 5using Ryujinx.Common.Logging;
6using Ryujinx.Common.SystemInterop; 6using Ryujinx.Common.SystemInterop;
7using Ryujinx.Graphics.Vulkan.MoltenVK;
7using Ryujinx.Modules; 8using Ryujinx.Modules;
8using Ryujinx.SDL2.Common; 9using Ryujinx.SDL2.Common;
9using Ryujinx.UI; 10using Ryujinx.UI;
@@ -110,6 +111,8 @@ namespace Ryujinx
110 111
111 if (OperatingSystem.IsMacOS()) 112 if (OperatingSystem.IsMacOS())
112 { 113 {
114 MVKInitialization.InitializeResolver();
115
113 string baseDirectory = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); 116 string baseDirectory = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
114 string resourcesDataDir; 117 string resourcesDataDir;
115 118
diff --git a/src/Ryujinx.Headless.SDL2/Program.cs b/src/Ryujinx.Headless.SDL2/Program.cs
index 85aff6712..5c30cd18f 100644
--- a/src/Ryujinx.Headless.SDL2/Program.cs
+++ b/src/Ryujinx.Headless.SDL2/Program.cs
@@ -18,6 +18,7 @@ using Ryujinx.Graphics.Gpu;
18using Ryujinx.Graphics.Gpu.Shader; 18using Ryujinx.Graphics.Gpu.Shader;
19using Ryujinx.Graphics.OpenGL; 19using Ryujinx.Graphics.OpenGL;
20using Ryujinx.Graphics.Vulkan; 20using Ryujinx.Graphics.Vulkan;
21using Ryujinx.Graphics.Vulkan.MoltenVK;
21using Ryujinx.Headless.SDL2.OpenGL; 22using Ryujinx.Headless.SDL2.OpenGL;
22using Ryujinx.Headless.SDL2.Vulkan; 23using Ryujinx.Headless.SDL2.Vulkan;
23using Ryujinx.HLE; 24using Ryujinx.HLE;
@@ -88,6 +89,11 @@ namespace Ryujinx.Headless.SDL2
88 }; 89 };
89 } 90 }
90 91
92 if (OperatingSystem.IsMacOS())
93 {
94 MVKInitialization.InitializeResolver();
95 }
96
91 Parser.Default.ParseArguments<Options>(args) 97 Parser.Default.ParseArguments<Options>(args)
92 .WithParsed(Load) 98 .WithParsed(Load)
93 .WithNotParsed(errors => errors.Output()); 99 .WithNotParsed(errors => errors.Output());
diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs
index 976963422..af9db7d63 100644
--- a/src/Ryujinx/Program.cs
+++ b/src/Ryujinx/Program.cs
@@ -7,6 +7,7 @@ using Ryujinx.Common.Configuration;
7using Ryujinx.Common.GraphicsDriver; 7using Ryujinx.Common.GraphicsDriver;
8using Ryujinx.Common.Logging; 8using Ryujinx.Common.Logging;
9using Ryujinx.Common.SystemInterop; 9using Ryujinx.Common.SystemInterop;
10using Ryujinx.Graphics.Vulkan.MoltenVK;
10using Ryujinx.Modules; 11using Ryujinx.Modules;
11using Ryujinx.SDL2.Common; 12using Ryujinx.SDL2.Common;
12using Ryujinx.UI.Common; 13using Ryujinx.UI.Common;
@@ -80,6 +81,11 @@ namespace Ryujinx.Ava
80 // Parse arguments 81 // Parse arguments
81 CommandLineState.ParseArguments(args); 82 CommandLineState.ParseArguments(args);
82 83
84 if (OperatingSystem.IsMacOS())
85 {
86 MVKInitialization.InitializeResolver();
87 }
88
83 // Delete backup files after updating. 89 // Delete backup files after updating.
84 Task.Run(Updater.CleanupUpdate); 90 Task.Run(Updater.CleanupUpdate);
85 91