Add explicit discards to all value returning expressions

このコミットが含まれているのは:
Sergio Pedri committed 2022-10-15 09:10:18 -07:00
1 親 38adbe6087
コミット 9343ac7f7b
47ファイル変更
+144 -144

検索条件に一致するファイルはありません

+12 -12
ファイルの表示
@@ -147,7 +147,7 @@ internal sealed class SwapChainApplication<T> : Win32Application
// Create the command allocator to use
fixed (ID3D12CommandAllocator** d3D12CommandAllocator = this.d3D12CommandAllocator)
{
this.d3D12Device.Get()->CreateCommandAllocator(
_ = this.d3D12Device.Get()->CreateCommandAllocator(
D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT,
Windows.__uuidof<ID3D12CommandAllocator>(),
(void**)d3D12CommandAllocator);
@@ -156,7 +156,7 @@ internal sealed class SwapChainApplication<T> : Win32Application
// Create the reusable command list to copy data to the back buffers
fixed (ID3D12GraphicsCommandList** d3D12GraphicsCommandList = this.d3D12GraphicsCommandList)
{
this.d3D12Device.Get()->CreateCommandList(
_ = this.d3D12Device.Get()->CreateCommandList(
0,
D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT,
d3D12CommandAllocator,
@@ -166,7 +166,7 @@ internal sealed class SwapChainApplication<T> : Win32Application
}
// Close the command list to prepare it for future use
this.d3D12GraphicsCommandList.Get()->Close();
_ = this.d3D12GraphicsCommandList.Get()->Close();
}
/// <inheritdoc/>
@@ -180,10 +180,10 @@ internal sealed class SwapChainApplication<T> : Win32Application
/// </summary>
private unsafe void ApplyResize()
{
this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue);
_ = this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue);
// Wait for the fence again to ensure there are no pending operations
this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default);
_ = this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default);
this.nextD3D12FenceValue++;
@@ -192,7 +192,7 @@ internal sealed class SwapChainApplication<T> : Win32Application
this.d3D12Resource1.Dispose();
// Resize the swap chain buffers
this.dxgiSwapChain1.Get()->ResizeBuffers(0, 0, 0, DXGI_FORMAT.DXGI_FORMAT_UNKNOWN, 0);
_ = this.dxgiSwapChain1.Get()->ResizeBuffers(0, 0, 0, DXGI_FORMAT.DXGI_FORMAT_UNKNOWN, 0);
// Get the index of the initial back buffer
using (ComPtr<IDXGISwapChain3> dxgiSwapChain3 = default)
@@ -249,8 +249,8 @@ internal sealed class SwapChainApplication<T> : Win32Application
this.currentBufferIndex ^= 1;
// Reset the command list and command allocator
this.d3D12CommandAllocator.Get()->Reset();
this.d3D12GraphicsCommandList.Get()->Reset(this.d3D12CommandAllocator.Get(), null);
_ = this.d3D12CommandAllocator.Get()->Reset();
_ = this.d3D12GraphicsCommandList.Get()->Reset(this.d3D12CommandAllocator.Get(), null);
D3D12_RESOURCE_BARRIER* d3D12ResourceBarriers = stackalloc D3D12_RESOURCE_BARRIER[]
{
@@ -283,18 +283,18 @@ internal sealed class SwapChainApplication<T> : Win32Application
// Transition the resources back to COMMON and UNORDERED_ACCESS respectively
d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers);
d3D12GraphicsCommandList.Get()->Close();
_ = d3D12GraphicsCommandList.Get()->Close();
// Execute the command list to perform the copy
this.d3D12CommandQueue.Get()->ExecuteCommandLists(1, (ID3D12CommandList**)d3D12GraphicsCommandList.GetAddressOf());
this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue);
_ = this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue);
// Present the new frame
this.dxgiSwapChain1.Get()->Present(0, 0);
_ = this.dxgiSwapChain1.Get()->Present(0, 0);
if (this.nextD3D12FenceValue > this.d3D12Fence.Get()->GetCompletedValue())
{
this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default);
_ = this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default);
}
this.nextD3D12FenceValue++;
+2 -2
ファイルの表示
@@ -196,11 +196,11 @@ internal unsafe static class Win32ApplicationRunner
if (isPaused)
{
Windows.SetCapture(hwnd);
_ = Windows.SetCapture(hwnd);
}
else
{
Windows.ReleaseCapture();
_ = Windows.ReleaseCapture();
}
isPaused = !isPaused;
+1 -1
ファイルの表示
@@ -61,7 +61,7 @@ class Program
Console.WriteLine();
Console.WriteLine($"Starting {Samples[index].ShaderName}...");
Win32ApplicationRunner.Run(Samples[index].Application);
_ = Win32ApplicationRunner.Run(Samples[index].Application);
}
}
while (index >= 0 && index < Samples.Length);