Updated D3D12Renderer for testing.

This commit is contained in:
2025-11-11 16:10:17 +09:00
parent 56f73e774b
commit fb003da26a
7 changed files with 107 additions and 87 deletions

View File

@@ -1,5 +1,6 @@
using Ghost.Core;
using Ghost.Core.Utilities;
using Ghost.Graphics.Core;
using Ghost.Graphics.Contracts;
using Ghost.Graphics.D3D12.Utilities;
using Ghost.Graphics.RHI;
@@ -11,8 +12,6 @@ using TerraFX.Interop.Windows;
using static TerraFX.Aliases.DXGI_Alias;
using Ghost.Graphics.Core;
namespace Ghost.Graphics.D3D12;
/// <summary>
@@ -120,7 +119,7 @@ internal unsafe class D3D12SwapChain : ISwapChain
_swapChain.Get()->GetBuffer(i, backBuffer.IID(), backBuffer.PPV());
backBuffer.Get()->SetName($"SwapChain_BackBuffer_{i}");
_backBuffers[i] = _resourceDatabase.ImportExternalResource(backBuffer, ResourceState.Present).AsTexture();
_backBuffers[i] = _resourceDatabase.ImportExternalResource(backBuffer.Move(), ResourceState.Present).AsTexture();
}
}
@@ -135,10 +134,7 @@ internal unsafe class D3D12SwapChain : ISwapChain
var presentFlags = 0u;
var syncInterval = vsync ? 1u : 0u;
if (_swapChain.Get()->Present(syncInterval, presentFlags).FAILED)
{
throw new InvalidOperationException("Failed to present swap chain.");
}
ThrowIfFailed(_swapChain.Get()->Present(syncInterval, presentFlags));
}
public void Resize(uint width, uint height)