Resolve remaining build warnings

このコミットが含まれているのは:
Sergio Pedri committed 2022-10-15 09:10:18 -07:00
1 親 b9a133b74c
コミット 5c4479a0e1
26ファイル変更
+106 -103

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

+12 -12
ファイルの表示
@@ -314,12 +314,12 @@ public sealed partial class HlslBokehBlurProcessor
/// Kernel for the vertical convolution pass.
/// </summary>
[AutoConstructor]
internal partial struct VerticalConvolutionProcessor : IComputeShader
internal readonly partial struct VerticalConvolutionProcessor : IComputeShader
{
private IReadWriteNormalizedTexture2D<float4> source;
private ReadWriteTexture2D<float4> reals;
private ReadWriteTexture2D<float4> imaginaries;
private ReadOnlyBuffer<Complex64> kernel;
private readonly IReadWriteNormalizedTexture2D<float4> source;
private readonly ReadWriteTexture2D<float4> reals;
private readonly ReadWriteTexture2D<float4> imaginaries;
private readonly ReadOnlyBuffer<Complex64> kernel;
/// <inheritdoc/>
public void Execute()
@@ -351,15 +351,15 @@ public sealed partial class HlslBokehBlurProcessor
/// Kernel for the horizontal convolution pass.
/// </summary>
[AutoConstructor]
internal partial struct HorizontalConvolutionAndAccumulatePartialsProcessor : IComputeShader
internal readonly partial struct HorizontalConvolutionAndAccumulatePartialsProcessor : IComputeShader
{
private float z;
private float w;
private readonly float z;
private readonly float w;
private ReadWriteTexture2D<float4> reals;
private ReadWriteTexture2D<float4> imaginaries;
private ReadWriteTexture2D<float4> target;
private ReadOnlyBuffer<Complex64> kernel;
private readonly ReadWriteTexture2D<float4> reals;
private readonly ReadWriteTexture2D<float4> imaginaries;
private readonly ReadWriteTexture2D<float4> target;
private readonly ReadOnlyBuffer<Complex64> kernel;
/// <inheritdoc/>
public void Execute()
+1
ファイルの表示
@@ -19,6 +19,7 @@
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<AppxBundlePlatforms>x64;ARM64</AppxBundlePlatforms>
<NoWarn>$(NoWarn);IDE0240</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
<DebugSymbols>true</DebugSymbols>
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@ using System.Threading;
using ComputeSharp.SwapChain.WinUI.Views;
using Microsoft.UI.Xaml;
#pragma warning disable CA1001
#pragma warning disable CA1001, IDE0052
namespace ComputeSharp.SwapChain.WinUI;
+2 -1
ファイルの表示
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
@@ -11,6 +11,7 @@
<UseWinUI>true</UseWinUI>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<DefineConstants>$(DefineConstants);SAMPLE_APP</DefineConstants>
<NoWarn>$(NoWarn);IDE0240</NoWarn>
</PropertyGroup>
<ItemGroup>
+1 -1
ファイルの表示
@@ -230,7 +230,7 @@ internal static unsafe class Win32ApplicationRunner
// Size update
case WM.WM_SIZE:
{
if (!isResizing && wParam != (byte)Windows.SIZE_MINIMIZED)
if (!isResizing && wParam != Windows.SIZE_MINIMIZED)
{
application.OnResize();
}
+1 -1
ファイルの表示
@@ -35,7 +35,7 @@ internal ref struct ArrayPoolBufferWriter<T>
/// <summary>
/// The starting offset within <see cref="array"/>.
/// </summary>
private int index;
private readonly int index;
/// <summary>
/// Initializes a new instance of the <see cref="ArrayPoolBufferWriter{T}"/> class.
+3 -3
ファイルの表示
@@ -8,17 +8,17 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Helpers;
/// <summary>
/// A 64-bit version of the <see cref="Point"/> type.
/// </summary>
internal struct Point64
internal readonly struct Point64
{
/// <summary>
/// The left coordinate of the current point.
/// </summary>
private long x;
private readonly long x;
/// <summary>
/// The top coordinate of the current point.
/// </summary>
private long y;
private readonly long y;
/// <summary>
/// Creates a new <see cref="Point64"/> instance with the specified parameters.
+7 -8
ファイルの表示
@@ -110,7 +110,7 @@ internal sealed unsafe partial class SwapChainManager<TOwner> : NativeObject
/// <summary>
/// The awaitable object for <see cref="IDXGISwapChain3.Present"/> calls.
/// </summary>
private HANDLE frameLatencyWaitableObject;
private readonly HANDLE frameLatencyWaitableObject;
/// <summary>
/// The first buffer within <see cref="dxgiSwapChain3"/>.
@@ -241,20 +241,19 @@ internal sealed unsafe partial class SwapChainManager<TOwner> : NativeObject
// IDXGISwapChain reference just created and set that as the swap chain panel to use.
fixed (ISwapChainPanelNative** swapChainPanelNative = this.swapChainPanelNative)
{
using (ComPtr<IUnknown> swapChainPanel = default)
{
using ComPtr<IUnknown> swapChainPanel = default;
#if WINDOWS_UWP
swapChainPanel.Attach((IUnknown*)Marshal.GetIUnknownForObject(owner));
swapChainPanel.CopyTo(swapChainPanelNative).Assert();
#else
swapChainPanel.Attach((IUnknown*)((IWinRTObject)owner).NativeObject.GetRef());
swapChainPanel.Attach((IUnknown*)((IWinRTObject)owner).NativeObject.GetRef());
swapChainPanel.CopyTo(
(Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(new Guid(0x63AAD0B8, 0x7C24, 0x40FF, 0x85, 0xA8, 0x64, 0x0D, 0x94, 0x4C, 0xC3, 0x25))),
(void**)swapChainPanelNative).Assert();
swapChainPanel.CopyTo(
(Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(new Guid(0x63AAD0B8, 0x7C24, 0x40FF, 0x85, 0xA8, 0x64, 0x0D, 0x94, 0x4C, 0xC3, 0x25))),
(void**)swapChainPanelNative).Assert();
#endif
}
}
// Get the underlying ID3D12Device in use
+2 -2
ファイルの表示
@@ -111,9 +111,9 @@ public partial class D2D1EffectRegistrationDataTests
[D2DInputCount(2)]
[D2DRequiresScenePosition]
[AutoConstructor]
private partial struct TestRegistrationBlobShader : ID2D1PixelShader
private readonly partial struct TestRegistrationBlobShader : ID2D1PixelShader
{
private float a;
private readonly float a;
public float4 Execute()
{
+1 -1
ファイルの表示
@@ -8,7 +8,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
using Win32;
using Win32.Graphics.Direct2D;
#pragma warning disable IDE0022
#pragma warning disable IDE0022, IDE0044
namespace ComputeSharp.D2D1.Tests;
+2
ファイルの表示
@@ -5,6 +5,8 @@ using ComputeSharp.D2D1.Interop;
using ComputeSharp.D2D1.Tests.Effects;
using Microsoft.VisualStudio.TestTools.UnitTesting;
#pragma warning disable IDE0059, IDE0044
namespace ComputeSharp.D2D1.Tests;
[TestClass]
+3 -3
ファイルの表示
@@ -13,12 +13,12 @@ using SixLabors.ImageSharp.PixelFormats;
using Win32;
using Win32.Graphics.Direct2D;
#pragma warning disable CS0649
#pragma warning disable CS0649, IDE0044, IDE0065
namespace ComputeSharp.D2D1.Tests;
using HRESULT = Win32.HResult;
using D2D1_MAPPED_RECT = Win32.Graphics.Direct2D.MappedRect;
using HRESULT = HResult;
using D2D1_MAPPED_RECT = MappedRect;
[TestClass]
[TestCategory("D2D1ResourceTextureManager")]
+10 -8
ファイルの表示
@@ -13,17 +13,19 @@ using SixLabors.ImageSharp;
using Win32;
using Win32.Graphics.Direct2D;
#pragma warning disable IDE0065
namespace ComputeSharp.BokehBlur.Processors;
using D2D1_BORDER_EDGE_MODE = Win32.Graphics.Direct2D.BorderEdgeMode;
using D2D1_BORDER_PROP = Win32.Graphics.Direct2D.BorderProp;
using D2D1_BUFFER_PRECISION = Win32.Graphics.Direct2D.BufferPrecision;
using D2D1_BORDER_EDGE_MODE = BorderEdgeMode;
using D2D1_BORDER_PROP = BorderProp;
using D2D1_BUFFER_PRECISION = BufferPrecision;
using D2D1_COMPOSITE_MODE = Win32.Graphics.Direct2D.Common.CompositeMode;
using D2D1_COMPOSITE_PROP = Win32.Graphics.Direct2D.CompositeProp;
using D2D1_INTERPOLATION_MODE = Win32.Graphics.Direct2D.InterpolationMode;
using D2D1_PROPERTY = Win32.Graphics.Direct2D.Property;
using D2D1_MAPPED_RECT = Win32.Graphics.Direct2D.MappedRect;
using D2D1_RENDERING_CONTROLS = Win32.Graphics.Direct2D.RenderingControls;
using D2D1_COMPOSITE_PROP = CompositeProp;
using D2D1_INTERPOLATION_MODE = InterpolationMode;
using D2D1_PROPERTY = Property;
using D2D1_MAPPED_RECT = MappedRect;
using D2D1_RENDERING_CONTROLS = RenderingControls;
using D2D1 = Win32.Graphics.Direct2D.Apis;
/// <summary>
+2
ファイルの表示
@@ -5,6 +5,8 @@ using System.Diagnostics.CodeAnalysis;
#endif
using System.Runtime.CompilerServices;
#pragma warning disable IDE0065
namespace ComputeSharp.D2D1.Tests.Extensions;
using HRESULT = Win32.HResult;
+11 -9
ファイルの表示
@@ -6,23 +6,25 @@ using Win32.Graphics.Direct2D;
using Win32.Graphics.Direct3D11;
using Win32.Graphics.Dxgi;
#pragma warning disable IDE0065
namespace ComputeSharp.D2D1.Tests.Helpers;
using D2D1_ALPHA_MODE = Win32.Graphics.Direct2D.Common.AlphaMode;
using D2D1_BITMAP_OPTIONS = Win32.Graphics.Direct2D.BitmapOptions;
using D2D1_DEVICE_CONTEXT_OPTIONS = Win32.Graphics.Direct2D.DeviceContextOptions;
using D2D1_FACTORY_OPTIONS = Win32.Graphics.Direct2D.FactoryOptions;
using D2D1_FACTORY_TYPE = Win32.Graphics.Direct2D.FactoryType;
using D2D1_INTERPOLATION_MODE = Win32.Graphics.Direct2D.InterpolationMode;
using D2D1_BITMAP_OPTIONS = BitmapOptions;
using D2D1_DEVICE_CONTEXT_OPTIONS = DeviceContextOptions;
using D2D1_FACTORY_OPTIONS = FactoryOptions;
using D2D1_FACTORY_TYPE = FactoryType;
using D2D1_INTERPOLATION_MODE = InterpolationMode;
using D2D1_COMPOSITE_MODE = Win32.Graphics.Direct2D.Common.CompositeMode;
using D2D1_MAP_OPTIONS = Win32.Graphics.Direct2D.MapOptions;
using D2D1_MAP_OPTIONS = MapOptions;
using D2D_RECT_U = Win32.Graphics.Direct2D.Common.RectU;
using D2D1_MAPPED_RECT = Win32.Graphics.Direct2D.MappedRect;
using D2D1_BITMAP_PROPERTIES = Win32.Graphics.Direct2D.BitmapProperties;
using D2D1_BITMAP_PROPERTIES1 = Win32.Graphics.Direct2D.BitmapProperties1;
using D2D1_BITMAP_PROPERTIES = BitmapProperties;
using D2D1_BITMAP_PROPERTIES1 = BitmapProperties1;
using D3D_FEATURE_LEVEL = Win32.Graphics.Direct3D.FeatureLevel;
using D3D_DRIVER_TYPE = Win32.Graphics.Direct3D.DriverType;
using D3D11_CREATE_DEVICE_FLAG = Win32.Graphics.Direct3D11.CreateDeviceFlags;
using D3D11_CREATE_DEVICE_FLAG = CreateDeviceFlags;
using DXGI_FORMAT = Win32.Graphics.Dxgi.Common.Format;
using Win32 = Win32.Apis;
using D2D1 = Win32.Graphics.Direct2D.Apis;
+3 -1
ファイルの表示
@@ -7,9 +7,11 @@ using ComputeSharp.Tests.Helpers;
using Win32;
using Win32.Graphics.Direct2D;
#pragma warning disable IDE0065
namespace ComputeSharp.D2D1.Tests.Helpers;
using D2D1_MAPPED_RECT = Win32.Graphics.Direct2D.MappedRect;
using D2D1_MAPPED_RECT = MappedRect;
/// <summary>
/// A test helper for D2D1 pixel shaders.
-1
ファイルの表示
@@ -33,7 +33,6 @@ public static class DeviceExtensions
case Device.Discrete: Assert.Inconclusive(); break;
case Device.Warp: Assert.Fail(); break;
}
}
return device!;
+1 -1
ファイルの表示
@@ -79,7 +79,7 @@ public class GetDefaultDeviceTests
}
// Calling GraphicsDevice.GetDefault() will now throw, because the native device has not been disposed properly
_ = Assert.ThrowsException<InvalidOperationException>(() => GraphicsDevice.GetDefault());
_ = Assert.ThrowsException<InvalidOperationException>(GraphicsDevice.GetDefault);
}
}
+14 -15
ファイルの表示
@@ -9,24 +9,23 @@ using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace TerraFX.Interop.DirectX
namespace TerraFX.Interop.DirectX;
[Guid("8B4F173B-2FEA-4B80-8F58-4307191AB95D")]
public unsafe partial struct ID3D12Device5
{
[Guid("8B4F173B-2FEA-4B80-8F58-4307191AB95D")]
public unsafe partial struct ID3D12Device5
public void** lpVtbl;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public uint Release()
{
public void** lpVtbl;
return ((delegate* unmanaged[Stdcall]<ID3D12Device5*, uint>)this.lpVtbl[2])((ID3D12Device5*)Unsafe.AsPointer(ref this));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public uint Release()
{
return ((delegate* unmanaged[Stdcall]<ID3D12Device5*, uint>)this.lpVtbl[2])((ID3D12Device5*)Unsafe.AsPointer(ref this));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RemoveDevice()
{
((delegate* unmanaged[Stdcall]<ID3D12Device5*, void>)this.lpVtbl[58])((ID3D12Device5*)Unsafe.AsPointer(ref this));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RemoveDevice()
{
((delegate* unmanaged[Stdcall]<ID3D12Device5*, void>)this.lpVtbl[58])((ID3D12Device5*)Unsafe.AsPointer(ref this));
}
}
+1 -1
ファイルの表示
@@ -41,7 +41,7 @@ public class ShaderCompilerTests
[ExpectedException(typeof(DxcCompilationException))]
public void CompileTest_Fail()
{
var faultyShader = ShaderSource.Replace("ids.x", "ids.X");
string faultyShader = ShaderSource.Replace("ids.x", "ids.X");
using ComPtr<IDxcBlob> dxcBlob = ShaderCompiler.Instance.Compile(faultyShader.AsSpan());
}
-1
ファイルの表示
@@ -52,7 +52,6 @@ public static class DeviceExtensions
case Device.Discrete: Assert.Inconclusive(); break;
case Device.Warp: Assert.Fail(); break;
}
}
return device!;
+1 -1
ファイルの表示
@@ -68,7 +68,7 @@ namespace ComputeSharp.Tests
float log = Hlsl.Log(1 + exp);
float temp = log + cellData.dword + cellData.int2x2;
row_major[ThreadIds.X] = (log / dword) + float2 + int2x2 + cbuffer.float2;
row_major[ThreadIds.X] = (log / dword) + float2 + int2x2 + cbuffer.float2 + temp;
}
}
-2
ファイルの表示
@@ -211,8 +211,6 @@ internal readonly partial struct TriangleGridContouring : IComputeShader
d2 = Hlsl.Min(d2, DistEdge(p - p0, p - p1));
float oldD2 = d2;
if (iTh2 == 7) d2 = 0.0f;
if (iTh == 7) d2 = 1e5f;
+9 -10
ファイルの表示
@@ -117,21 +117,20 @@ partial class Texture1DTests
{
using ReadWriteTexture1D<T, TPixel> texture = device.Get().AllocateReadWriteTexture1D<T, TPixel>(64);
using (ComputeContext context = device.Get().CreateComputeContext())
{
context.Transition(texture, ResourceState.ReadOnly);
using ComputeContext context = device.Get().CreateComputeContext();
IReadOnlyNormalizedTexture1D<TPixel> wrapper1 = texture.AsReadOnly();
context.Transition(texture, ResourceState.ReadOnly);
Assert.IsNotNull(wrapper1);
IReadOnlyNormalizedTexture1D<TPixel> wrapper1 = texture.AsReadOnly();
IReadOnlyNormalizedTexture1D<TPixel> wrapper2 = texture.AsReadOnly();
Assert.IsNotNull(wrapper1);
Assert.IsNotNull(wrapper2);
Assert.AreSame(wrapper1, wrapper2);
IReadOnlyNormalizedTexture1D<TPixel> wrapper2 = texture.AsReadOnly();
context.Transition(texture, ResourceState.ReadWrite);
}
Assert.IsNotNull(wrapper2);
Assert.AreSame(wrapper1, wrapper2);
context.Transition(texture, ResourceState.ReadWrite);
}
TestHelper.Run(Test<Rgba32, float4>, t, tPixel, device);
+9 -10
ファイルの表示
@@ -132,21 +132,20 @@ partial class Texture2DTests
{
using ReadWriteTexture2D<T, TPixel> texture = device.Get().AllocateReadWriteTexture2D<T, TPixel>(64, 64);
using (ComputeContext context = device.Get().CreateComputeContext())
{
context.Transition(texture, ResourceState.ReadOnly);
using ComputeContext context = device.Get().CreateComputeContext();
IReadOnlyNormalizedTexture2D<TPixel> wrapper1 = texture.AsReadOnly();
context.Transition(texture, ResourceState.ReadOnly);
Assert.IsNotNull(wrapper1);
IReadOnlyNormalizedTexture2D<TPixel> wrapper1 = texture.AsReadOnly();
IReadOnlyNormalizedTexture2D<TPixel> wrapper2 = texture.AsReadOnly();
Assert.IsNotNull(wrapper1);
Assert.IsNotNull(wrapper2);
Assert.AreSame(wrapper1, wrapper2);
IReadOnlyNormalizedTexture2D<TPixel> wrapper2 = texture.AsReadOnly();
context.Transition(texture, ResourceState.ReadWrite);
}
Assert.IsNotNull(wrapper2);
Assert.AreSame(wrapper1, wrapper2);
context.Transition(texture, ResourceState.ReadWrite);
}
TestHelper.Run(Test<Rgba32, float4>, t, tPixel, device);
+9 -10
ファイルの表示
@@ -64,21 +64,20 @@ partial class Texture3DTests
{
using ReadWriteTexture3D<T, TPixel> texture = device.Get().AllocateReadWriteTexture3D<T, TPixel>(32, 32, 2);
using (ComputeContext context = device.Get().CreateComputeContext())
{
context.Transition(texture, ResourceState.ReadOnly);
using ComputeContext context = device.Get().CreateComputeContext();
IReadOnlyNormalizedTexture3D<TPixel> wrapper1 = texture.AsReadOnly();
context.Transition(texture, ResourceState.ReadOnly);
Assert.IsNotNull(wrapper1);
IReadOnlyNormalizedTexture3D<TPixel> wrapper1 = texture.AsReadOnly();
IReadOnlyNormalizedTexture3D<TPixel> wrapper2 = texture.AsReadOnly();
Assert.IsNotNull(wrapper1);
Assert.IsNotNull(wrapper2);
Assert.AreSame(wrapper1, wrapper2);
IReadOnlyNormalizedTexture3D<TPixel> wrapper2 = texture.AsReadOnly();
context.Transition(texture, ResourceState.ReadWrite);
}
Assert.IsNotNull(wrapper2);
Assert.AreSame(wrapper1, wrapper2);
context.Transition(texture, ResourceState.ReadWrite);
}
TestHelper.Run(Test<Rgba32, float4>, t, tPixel, device);