diff --git a/Directory.Packages.props b/Directory.Packages.props
index c3af18ceec..ef274125a4 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -42,7 +42,7 @@
-
+
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
index 3c10c95e02..a1dde673b9 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
@@ -770,7 +770,7 @@ namespace Ryujinx.Graphics.Gpu.Image
? _channel.BufferManager.GetComputeUniformBufferAddress(textureBufferIndex)
: _channel.BufferManager.GetGraphicsUniformBufferAddress(stageIndex, textureBufferIndex);
- int handle = textureBufferAddress != 0
+ int handle = textureBufferAddress != MemoryManager.PteUnmapped
? _channel.MemoryManager.Physical.Read(textureBufferAddress + (uint)textureWordOffset * 4)
: 0;
@@ -790,7 +790,7 @@ namespace Ryujinx.Graphics.Gpu.Image
? _channel.BufferManager.GetComputeUniformBufferAddress(samplerBufferIndex)
: _channel.BufferManager.GetGraphicsUniformBufferAddress(stageIndex, samplerBufferIndex);
- samplerHandle = samplerBufferAddress != 0
+ samplerHandle = samplerBufferAddress != MemoryManager.PteUnmapped
? _channel.MemoryManager.Physical.Read(samplerBufferAddress + (uint)samplerWordOffset * 4)
: 0;
}
diff --git a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs
index 61cfbb6ec9..278dbecfa5 100644
--- a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs
+++ b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs
@@ -302,12 +302,12 @@ namespace Ryujinx.Graphics.Vulkan
SubmitInfo sInfo = new()
{
SType = StructureType.SubmitInfo,
- WaitSemaphoreCount = waitSemaphores != null ? (uint)waitSemaphores.Length : 0,
+ WaitSemaphoreCount = !waitSemaphores.IsEmpty ? (uint)waitSemaphores.Length : 0,
PWaitSemaphores = pWaitSemaphores,
PWaitDstStageMask = pWaitDstStageMask,
CommandBufferCount = 1,
PCommandBuffers = &commandBuffer,
- SignalSemaphoreCount = signalSemaphores != null ? (uint)signalSemaphores.Length : 0,
+ SignalSemaphoreCount = !signalSemaphores.IsEmpty ? (uint)signalSemaphores.Length : 0,
PSignalSemaphores = pSignalSemaphores,
};
diff --git a/src/Ryujinx.HLE/HOS/Services/Fatal/IService.cs b/src/Ryujinx.HLE/HOS/Services/Fatal/IService.cs
index 21daf87580..155077745a 100644
--- a/src/Ryujinx.HLE/HOS/Services/Fatal/IService.cs
+++ b/src/Ryujinx.HLE/HOS/Services/Fatal/IService.cs
@@ -60,7 +60,7 @@ namespace Ryujinx.HLE.HOS.Services.Fatal
errorReport.AppendLine($"\tResultCode: {((int)resultCode & 0x1FF) + 2000}-{((int)resultCode >> 9) & 0x3FFF:d4}");
errorReport.AppendLine($"\tFatalPolicy: {fatalPolicy}");
- if (cpuContext != null)
+ if (!cpuContext.IsEmpty)
{
errorReport.AppendLine("CPU Context:");
diff --git a/src/Ryujinx.HLE/HOS/TamperMachine.cs b/src/Ryujinx.HLE/HOS/TamperMachine.cs
index f234e540e6..609221535d 100644
--- a/src/Ryujinx.HLE/HOS/TamperMachine.cs
+++ b/src/Ryujinx.HLE/HOS/TamperMachine.cs
@@ -143,7 +143,7 @@ namespace Ryujinx.HLE.HOS
try
{
- ControllerKeys pressedKeys = (ControllerKeys)Thread.VolatileRead(ref _pressedKeys);
+ ControllerKeys pressedKeys = (ControllerKeys)Volatile.Read(ref _pressedKeys);
program.Process.TamperedCodeMemory = false;
program.Execute(pressedKeys);
@@ -175,14 +175,14 @@ namespace Ryujinx.HLE.HOS
{
if (input.PlayerId == PlayerIndex.Player1 || input.PlayerId == PlayerIndex.Handheld)
{
- Thread.VolatileWrite(ref _pressedKeys, (long)input.Buttons);
+ Volatile.Write(ref _pressedKeys, (long)input.Buttons);
return;
}
}
// Clear the input because player one is not conected.
- Thread.VolatileWrite(ref _pressedKeys, 0);
+ Volatile.Write(ref _pressedKeys, 0);
}
}
}
diff --git a/src/Ryujinx.Tests/Memory/PartialUnmaps.cs b/src/Ryujinx.Tests/Memory/PartialUnmaps.cs
index 04f7f40e66..ace68e5c24 100644
--- a/src/Ryujinx.Tests/Memory/PartialUnmaps.cs
+++ b/src/Ryujinx.Tests/Memory/PartialUnmaps.cs
@@ -388,14 +388,14 @@ namespace Ryujinx.Tests.Memory
{
rwLock.AcquireReaderLock();
- int originalValue = Thread.VolatileRead(ref value);
+ int originalValue = Volatile.Read(ref value);
count++;
// Spin a bit.
for (int i = 0; i < 100; i++)
{
- if (Thread.VolatileRead(ref readersAllowed) == 0)
+ if (Volatile.Read(ref readersAllowed) == 0)
{
error = true;
running = false;
@@ -403,7 +403,7 @@ namespace Ryujinx.Tests.Memory
}
// Should not change while the lock is held.
- if (Thread.VolatileRead(ref value) != originalValue)
+ if (Volatile.Read(ref value) != originalValue)
{
error = true;
running = false;