Add explicit discards to all value returning expressions
このコミットが含まれているのは:
1 親
38adbe6087
コミット
9343ac7f7b
47ファイル変更
+144
-144
検索条件に一致するファイルはありません
@@ -47,7 +47,7 @@ internal static partial class BlasHelpers
|
||||
}
|
||||
}
|
||||
|
||||
Parallel.For(0, c, Kernel);
|
||||
_ = Parallel.For(0, c, Kernel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -92,7 +92,7 @@ public sealed partial class HlslBokehBlurProcessor
|
||||
NormalizeKernels();
|
||||
|
||||
// Store them in the cache for future use
|
||||
Cache.TryAdd(parameters, (kernelParameters, kernelsScale, kernels));
|
||||
_ = Cache.TryAdd(parameters, (kernelParameters, kernelsScale, kernels));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,13 @@ public sealed class DebugAnalyticsService : IAnalyticsService
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
|
||||
builder.AppendLine($"[EVENT]: \"{title}\"");
|
||||
_ = builder.AppendLine($"[EVENT]: \"{title}\"");
|
||||
|
||||
if (data is not null)
|
||||
{
|
||||
foreach (var info in data)
|
||||
{
|
||||
builder.AppendLine($">> {info.Property}: \"{info.Value ?? "<NULL>"}\"");
|
||||
_ = builder.AppendLine($">> {info.Property}: \"{info.Value ?? "<NULL>"}\"");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,15 +34,15 @@ public sealed class DebugAnalyticsService : IAnalyticsService
|
||||
{
|
||||
StringBuilder builder = new();
|
||||
|
||||
builder.AppendLine($"[EXCEPTION]: \"{exception.GetType()}\"");
|
||||
builder.AppendLine(">> Stack trace");
|
||||
builder.AppendLine(exception.StackTrace);
|
||||
_ = builder.AppendLine($"[EXCEPTION]: \"{exception.GetType()}\"");
|
||||
_ = builder.AppendLine(">> Stack trace");
|
||||
_ = builder.AppendLine(exception.StackTrace);
|
||||
|
||||
if (data is not null)
|
||||
{
|
||||
foreach (var info in data)
|
||||
{
|
||||
builder.AppendLine($">> {info.Property}: \"{info.Value ?? "<NULL>"}\"");
|
||||
_ = builder.AppendLine($">> {info.Property}: \"{info.Value ?? "<NULL>"}\"");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public sealed partial class MainView : UserControl
|
||||
{
|
||||
Ioc.Default.GetRequiredService<IAnalyticsService>().Log(Event.OpenShaderSelectionPanel);
|
||||
|
||||
Root.Resources.Remove("ShaderSelectionPanel");
|
||||
_ = Root.Resources.Remove("ShaderSelectionPanel");
|
||||
Root.Children.Add(ShaderSelectionPanel);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public sealed partial class MainView : UserControl
|
||||
{
|
||||
Ioc.Default.GetRequiredService<IAnalyticsService>().Log(Event.CloseShaderSelectionPanel);
|
||||
|
||||
Root.Children.Remove(ShaderSelectionPanel);
|
||||
_ = Root.Children.Remove(ShaderSelectionPanel);
|
||||
}
|
||||
|
||||
// Updates the size of the shaders list panel
|
||||
|
||||
@@ -49,14 +49,14 @@ public sealed partial class MainWindow : Window
|
||||
// Opens the shader selection panel
|
||||
private void OpenShaderSelectionPanelButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Root.Resources.Remove("ShaderSelectionPanel");
|
||||
_ = Root.Resources.Remove("ShaderSelectionPanel");
|
||||
Root.Children.Add(ShaderSelectionPanel);
|
||||
}
|
||||
|
||||
// Hides the shader selection panel
|
||||
private void ShaderSelectionPanel_Tapped(object sender, TappedRoutedEventArgs e)
|
||||
{
|
||||
Root.Children.Remove(ShaderSelectionPanel);
|
||||
_ = Root.Children.Remove(ShaderSelectionPanel);
|
||||
}
|
||||
|
||||
// Updates the size of the shaders list panel
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -196,11 +196,11 @@ internal unsafe static class Win32ApplicationRunner
|
||||
|
||||
if (isPaused)
|
||||
{
|
||||
Windows.SetCapture(hwnd);
|
||||
_ = Windows.SetCapture(hwnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
Windows.ReleaseCapture();
|
||||
_ = Windows.ReleaseCapture();
|
||||
}
|
||||
|
||||
isPaused = !isPaused;
|
||||
|
||||
@@ -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);
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする