Refactor MeshInstance

This commit is contained in:
2026-03-13 15:10:25 +09:00
parent 619720feee
commit 8a3b40b4f8
15 changed files with 57 additions and 61 deletions

View File

@@ -20,7 +20,10 @@ internal sealed class SwapChainRecord
while (true)
{
int current = Volatile.Read(ref _refCount);
if (current == 0) return false; // It's dead, let it go.
if (current == 0)
{
return false; // It's dead, let it go.
}
if (Interlocked.CompareExchange(ref _refCount, current + 1, current) == current)
{
@@ -66,7 +69,10 @@ internal class SwapChainManager
if (record != null)
{
if (record.TryAddRef()) return record.SwapChain;
if (record.TryAddRef())
{
return record.SwapChain;
}
Thread.Yield();
continue;