From 801b71a12883f8a104c699a92a9aa997e2a6d609 Mon Sep 17 00:00:00 2001 From: TSRBerry <20988865+TSRBerry@users.noreply.github.com> Date: Sat, 1 Jul 2023 12:31:42 +0200 Subject: [Ryujinx.Graphics.Vulkan] Address dotnet-format issues (#5378) * dotnet format style --severity info Some changes were manually reverted. * dotnet format analyzers --serverity info Some changes have been minimally adapted. * Restore a few unused methods and variables * Silence dotnet format IDE0060 warnings * Silence dotnet format IDE0059 warnings * Address dotnet format CA1816 warnings * Fix new dotnet-format issues after rebase * Address most dotnet format whitespace warnings * Apply dotnet format whitespace formatting A few of them have been manually reverted and the corresponding warning was silenced * Format if-blocks correctly * Another rebase, another dotnet format run * Run dotnet format whitespace after rebase * Run dotnet format style after rebase * Run dotnet format analyzers after rebase * Run dotnet format style after rebase * Run dotnet format after rebase and remove unused usings - analyzers - style - whitespace * Disable 'prefer switch expression' rule * Add comments to disabled warnings * Simplify properties and array initialization, Use const when possible, Remove trailing commas * Run dotnet format after rebase * Address IDE0251 warnings * Address a few disabled IDE0060 warnings * Silence IDE0060 in .editorconfig * Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas" This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e. * dotnet format whitespace after rebase * First dotnet format pass * Fix naming rule violations * Remove redundant code * Rename generics * Address review feedback * Remove SetOrigin --- src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs') diff --git a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs index 42b46eae..17eeef68 100644 --- a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs +++ b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs @@ -2,7 +2,8 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using Thread = System.Threading.Thread; +using System.Threading; +using Semaphore = Silk.NET.Vulkan.Semaphore; namespace Ryujinx.Graphics.Vulkan { @@ -10,8 +11,8 @@ namespace Ryujinx.Graphics.Vulkan { public const int MaxCommandBuffers = 16; - private int _totalCommandBuffers; - private int _totalCommandBuffersMask; + private readonly int _totalCommandBuffers; + private readonly int _totalCommandBuffersMask; private readonly Vk _api; private readonly Device _device; @@ -36,12 +37,12 @@ namespace Ryujinx.Graphics.Vulkan public void Initialize(Vk api, Device device, CommandPool pool) { - var allocateInfo = new CommandBufferAllocateInfo() + var allocateInfo = new CommandBufferAllocateInfo { SType = StructureType.CommandBufferAllocateInfo, CommandBufferCount = 1, CommandPool = pool, - Level = CommandBufferLevel.Primary + Level = CommandBufferLevel.Primary, }; api.AllocateCommandBuffers(device, allocateInfo, out CommandBuffer); @@ -67,12 +68,12 @@ namespace Ryujinx.Graphics.Vulkan _queueLock = queueLock; _owner = Thread.CurrentThread; - var commandPoolCreateInfo = new CommandPoolCreateInfo() + var commandPoolCreateInfo = new CommandPoolCreateInfo { SType = StructureType.CommandPoolCreateInfo, QueueFamilyIndex = queueFamilyIndex, Flags = CommandPoolCreateFlags.TransientBit | - CommandPoolCreateFlags.ResetCommandBufferBit + CommandPoolCreateFlags.ResetCommandBufferBit, }; api.CreateCommandPool(device, commandPoolCreateInfo, null, out _pool).ThrowOnError(); @@ -243,9 +244,9 @@ namespace Ryujinx.Graphics.Vulkan _inUseCount++; - var commandBufferBeginInfo = new CommandBufferBeginInfo() + var commandBufferBeginInfo = new CommandBufferBeginInfo { - SType = StructureType.CommandBufferBeginInfo + SType = StructureType.CommandBufferBeginInfo, }; _api.BeginCommandBuffer(entry.CommandBuffer, commandBufferBeginInfo).ThrowOnError(); @@ -291,7 +292,7 @@ namespace Ryujinx.Graphics.Vulkan { fixed (PipelineStageFlags* pWaitDstStageMask = waitDstStageMask) { - SubmitInfo sInfo = new SubmitInfo() + SubmitInfo sInfo = new() { SType = StructureType.SubmitInfo, WaitSemaphoreCount = waitSemaphores != null ? (uint)waitSemaphores.Length : 0, @@ -300,7 +301,7 @@ namespace Ryujinx.Graphics.Vulkan CommandBufferCount = 1, PCommandBuffers = &commandBuffer, SignalSemaphoreCount = signalSemaphores != null ? (uint)signalSemaphores.Length : 0, - PSignalSemaphores = pSignalSemaphores + PSignalSemaphores = pSignalSemaphores, }; lock (_queueLock) -- cgit v1.2.3