From ac7010a730e4b090edc56c9c37a3e553596c6245 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 14 Oct 2022 15:03:46 +0200 Subject: [PATCH] Fix build errors due to .editorconfig warnings --- Directory.Build.props | 30 +++++++- .../Blas/BlasBenchmark.cs | 74 ++++++++++--------- .../Dispatching/DispatchingBenchmark.cs | 38 +++++----- .../Imaging/ImagingBenchmark.cs | 2 + .../ComputeSharp.SwapChain.Uwp.csproj | 8 +- .../ComputeSharp.SwapChain.WinUI/App.xaml.cs | 15 ++-- .../Effects/PixelShaderEffect.For{T}.cs | 2 + .../Interop/Effects/PixelShaderEffect.cs | 14 ++-- .../D2D1ResourceTextureManagerImpl.cs | 19 ++--- .../Graphics/Interop/NativeObject.cs | 4 +- .../Resources/Views/TextureView2D{T}.cs | 8 +- .../Resources/Views/TextureView3D{T}.cs | 8 +- 12 files changed, 132 insertions(+), 90 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 1e45a37a..c594698a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,9 +3,37 @@ true 11.0 enable - strict true + + + 7 + + + strict + + + + + $(NoWarn);MSB3270 + + + $(NoWarn);CA1060 diff --git a/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs b/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs index 326d0527..9f2478ba 100644 --- a/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs +++ b/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs @@ -3,6 +3,8 @@ using System.Buffers; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Engines; +#pragma warning disable CA1063 + namespace ComputeSharp.Benchmark.Blas; /// @@ -17,64 +19,64 @@ public class BlasBenchmark : IDisposable private const int C = 128; /// - /// The nummber of rows in the matrix. + /// The nummber of rows in the matrix. /// private const int N = 512; /// - /// The number of columns in the matrix (same as the number of rows in the matrix) + /// The number of columns in the matrix (same as the number of rows in the matrix) /// private const int M = 512; /// - /// The number of columns in the matrix. + /// The number of columns in the matrix. /// private const int P = 256; /// /// The input tensor. /// - private float[]? X; + private float[]? x; /// /// The weights tensor. /// - private float[]? W; + private float[]? w; /// /// The bias tensor. /// - private float[]? B; + private float[]? b; /// /// The result tensor. /// - private float[]? Y; + private float[]? y; /// /// The input tensor (GPU). /// - private ReadOnlyBuffer? BufferX; + private ReadOnlyBuffer? bufferX; /// /// The weights tensor (GPU). /// - private ReadOnlyBuffer? BufferW; + private ReadOnlyBuffer? bufferW; /// /// The bias tensor (GPU). /// - private ReadOnlyBuffer? BufferB; + private ReadOnlyBuffer? bufferB; /// /// The result tensor (GPU). /// - private ReadWriteBuffer? BufferY; + private ReadWriteBuffer? bufferY; /// /// A instance to initialize the tensors. /// - private readonly Random Random = new Random(); + private readonly Random random = new(); /// /// Initial setup for a benchmarking session. @@ -89,21 +91,21 @@ public class BlasBenchmark : IDisposable foreach (ref float x in array.AsSpan()) { - x = (float)Random.NextDouble(); + x = (float)this.random.NextDouble(); } return array; } - X = CreateRandomArray(C * N * M); - W = CreateRandomArray(M * P); - B = CreateRandomArray(P); - Y = CreateRandomArray(C * N * P); + this.x = CreateRandomArray(C * N * M); + this.w = CreateRandomArray(M * P); + this.b = CreateRandomArray(P); + this.y = CreateRandomArray(C * N * P); - BufferX = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(X); - BufferW = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(W); - BufferB = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(B); - BufferY = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(Y); + this.bufferX = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.x); + this.bufferW = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.w); + this.bufferB = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.b); + this.bufferY = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(this.y); Cpu(); GpuWithNoTemporaryBuffers(); @@ -114,15 +116,15 @@ public class BlasBenchmark : IDisposable [GlobalCleanup] public void Dispose() { - ArrayPool.Shared.Return(X!); - ArrayPool.Shared.Return(W!); - ArrayPool.Shared.Return(B!); - ArrayPool.Shared.Return(Y!); + ArrayPool.Shared.Return(this.x!); + ArrayPool.Shared.Return(this.w!); + ArrayPool.Shared.Return(this.b!); + ArrayPool.Shared.Return(this.y!); - BufferX!.Dispose(); - BufferW!.Dispose(); - BufferB!.Dispose(); - BufferY!.Dispose(); + this.bufferX!.Dispose(); + this.bufferW!.Dispose(); + this.bufferB!.Dispose(); + this.bufferY!.Dispose(); } /// @@ -131,7 +133,7 @@ public class BlasBenchmark : IDisposable [Benchmark(Baseline = true)] public void Cpu() { - BlasHelpers.FullyConnectedForwardCpu(C, N, M, P, X!, W!, B!, Y!); + BlasHelpers.FullyConnectedForwardCpu(C, N, M, P, this.x!, this.w!, this.b!, this.y!); } /// @@ -140,7 +142,7 @@ public class BlasBenchmark : IDisposable [Benchmark] public void GpuWithNoTemporaryBuffers() { - BlasHelpers.FullyConnectedForwardGpu(GraphicsDevice.GetDefault(), C, N, M, P, BufferX!, BufferW!, BufferB!, BufferY!); + BlasHelpers.FullyConnectedForwardGpu(GraphicsDevice.GetDefault(), C, N, M, P, this.bufferX!, this.bufferW!, this.bufferB!, this.bufferY!); } /// @@ -149,13 +151,13 @@ public class BlasBenchmark : IDisposable [Benchmark] public void GpuWithTemporaryBuffers() { - using ReadOnlyBuffer x = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(X!); - using ReadOnlyBuffer w = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(W!); - using ReadOnlyBuffer b = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(B!); - using ReadWriteBuffer y = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(Y!.Length); + using ReadOnlyBuffer x = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.x!); + using ReadOnlyBuffer w = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.w!); + using ReadOnlyBuffer b = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.b!); + using ReadWriteBuffer y = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(this.y!.Length); BlasHelpers.FullyConnectedForwardGpu(GraphicsDevice.GetDefault(), C, N, M, P, x, w, b, y); - y.CopyTo(Y); + y.CopyTo(this.y); } } diff --git a/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs b/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs index f7c71449..53a1f1cf 100644 --- a/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs +++ b/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs @@ -3,6 +3,8 @@ using System.Threading.Tasks; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; +#pragma warning disable CA1063 + namespace ComputeSharp.Benchmark.Blas; /// @@ -15,7 +17,7 @@ public partial class DispatchingBenchmark : IDisposable /// /// The test buffer. /// - private ReadWriteBuffer? Buffer; + private ReadWriteBuffer? buffer; /// /// Initial setup for a benchmarking session. @@ -23,14 +25,14 @@ public partial class DispatchingBenchmark : IDisposable [GlobalSetup] public void Setup() { - Buffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(128); + this.buffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(128); } /// [GlobalCleanup] public void Dispose() { - Buffer!.Dispose(); + this.buffer!.Dispose(); } /// @@ -40,7 +42,7 @@ public partial class DispatchingBenchmark : IDisposable [BenchmarkCategory("SINGLE")] public void Compute_Single() { - GraphicsDevice.GetDefault().For(64, new TestShader(Buffer!)); + GraphicsDevice.GetDefault().For(64, new TestShader(this.buffer!)); } /// @@ -50,9 +52,9 @@ public partial class DispatchingBenchmark : IDisposable [BenchmarkCategory("SINGLE")] public void Compute_Single_WithContext() { - using var context = GraphicsDevice.GetDefault().CreateComputeContext(); + using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext(); - context.For(64, new TestShader(Buffer!)); + context.For(64, new TestShader(this.buffer!)); } /// @@ -62,9 +64,9 @@ public partial class DispatchingBenchmark : IDisposable [BenchmarkCategory("SINGLE")] public async Task Compute_Single_WithContext_Async() { - await using var context = GraphicsDevice.GetDefault().CreateComputeContext(); + await using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext(); - context.For(64, new TestShader(Buffer!)); + context.For(64, new TestShader(this.buffer!)); } /// @@ -74,8 +76,8 @@ public partial class DispatchingBenchmark : IDisposable [BenchmarkCategory("MULTIPLE")] public void Compute_Multiple() { - GraphicsDevice.GetDefault().For(64, new TestShader(Buffer!)); - GraphicsDevice.GetDefault().For(64, new TestShader(Buffer!)); + GraphicsDevice.GetDefault().For(64, new TestShader(this.buffer!)); + GraphicsDevice.GetDefault().For(64, new TestShader(this.buffer!)); } /// @@ -85,11 +87,11 @@ public partial class DispatchingBenchmark : IDisposable [BenchmarkCategory("MULTIPLE")] public void Compute_Multiple_WithContext() { - using var context = GraphicsDevice.GetDefault().CreateComputeContext(); + using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext(); - context.For(64, new TestShader(Buffer!)); - context.Barrier(Buffer!); - context.For(64, new TestShader(Buffer!)); + context.For(64, new TestShader(this.buffer!)); + context.Barrier(this.buffer!); + context.For(64, new TestShader(this.buffer!)); } /// @@ -99,11 +101,11 @@ public partial class DispatchingBenchmark : IDisposable [BenchmarkCategory("MULTIPLE")] public async Task Compute_Multiple_WithContext_Async() { - await using var context = GraphicsDevice.GetDefault().CreateComputeContext(); + await using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext(); - context.For(64, new TestShader(Buffer!)); - context.Barrier(Buffer!); - context.For(64, new TestShader(Buffer!)); + context.For(64, new TestShader(this.buffer!)); + context.Barrier(this.buffer!); + context.For(64, new TestShader(this.buffer!)); } [AutoConstructor] diff --git a/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs b/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs index 12ecc013..82967c70 100644 --- a/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs +++ b/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs @@ -10,6 +10,8 @@ using SixLabors.ImageSharp.Processing; using SixLabors.ImageSharp.Processing.Processors.Convolution; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; +#pragma warning disable CA1063 + namespace ComputeSharp.Benchmark.Imaging; /// diff --git a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj index 606d4c7f..d1cedf87 100644 --- a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj +++ b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj @@ -24,7 +24,7 @@ true bin\ARM64\Debug\ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 + $(NoWarn);2008 full ARM64 false @@ -36,7 +36,7 @@ bin\ARM64\Release\ TRACE;NETFX_CORE;WINDOWS_UWP true - ;2008 + $(NoWarn);2008 pdbonly ARM64 false @@ -48,7 +48,7 @@ true bin\x64\Debug\ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 + $(NoWarn);2008 full x64 false @@ -59,7 +59,7 @@ bin\x64\Release\ TRACE;NETFX_CORE;WINDOWS_UWP true - ;2008 + $(NoWarn);2008 pdbonly x64 false diff --git a/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs b/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs index 6068c97f..9d6f7953 100644 --- a/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs +++ b/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs @@ -3,6 +3,8 @@ using System.Threading; using ComputeSharp.SwapChain.WinUI.Views; using Microsoft.UI.Xaml; +#pragma warning disable CA1001 + namespace ComputeSharp.SwapChain.WinUI; /// @@ -27,25 +29,26 @@ public sealed partial class App : Application /// public App() { - this.InitializeComponent(); + InitializeComponent(); } /// protected override void OnLaunched(LaunchActivatedEventArgs args) { - mainWindow = new MainWindow(); - mainWindow.Closed += (_, _) => + this.mainWindow = new MainWindow(); + this.mainWindow.Closed += (_, _) => { // Due to an issue (https://discord.com/channels/372137812037730304/663434534087426129/979543152853663744), the WinUI 3 app // will keep running after the window is closed if any render thread is still going. To work around this, each loaded shader // panel is tracked in a conditional weak table, and then when the window is closed they're all manually stopped by setting // their shader runners to null. After this, the app should just be able to close automatically when the panels are done. - mainWindow.OnShutdown(); + this.mainWindow.OnShutdown(); // For good measure, also start a timer of one second. If the app is still alive by then (ie. if the timer callback is // executed at all), then just force the whole process to terminate, and exit with the E_APPLICATION_EXITING error code. - shutdownTimer = new Timer(_ => Environment.Exit(unchecked((int)(0x8000001A))), this, 1000, Timeout.Infinite); + this.shutdownTimer = new Timer(_ => Environment.Exit(unchecked((int)(0x8000001A))), this, 1000, Timeout.Infinite); }; - mainWindow.Activate(); + + this.mainWindow.Activate(); } } diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.For{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.For{T}.cs index d8639943..6aa6a6cc 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.For{T}.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.For{T}.cs @@ -10,6 +10,8 @@ using RuntimeHelpers = System.Runtime.CompilerServices.RuntimeHelpers; using RuntimeHelpers = ComputeSharp.D2D1.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers; #endif +#pragma warning disable CA2002 + namespace ComputeSharp.D2D1.Interop.Effects; /// diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs index b7f146d6..46af9b82 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs @@ -43,17 +43,18 @@ internal unsafe partial struct PixelShaderEffect /// /// The shared vtable pointer for instance, for . /// - private static readonly void** VtblForID2D1EffectImpl; + private static readonly void** VtblForID2D1EffectImpl = InitVtblForID2D1EffectImplAndID2D1DrawTransform(); /// /// The shared vtable pointer for instance, for . /// - private static readonly void** VtblForID2D1DrawTransform; + private static readonly void** VtblForID2D1DrawTransform = &VtblForID2D1EffectImpl[6]; /// - /// Initializes the shared state for . + /// Initializes the combined vtable for and . /// - static PixelShaderEffect() + /// The combined vtable for and . + private static void** InitVtblForID2D1EffectImplAndID2D1DrawTransform() { void** lpVtbl = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(PixelShaderEffect), sizeof(void*) * 14); @@ -95,8 +96,7 @@ internal unsafe partial struct PixelShaderEffect lpVtbl[6 + 7] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1DrawTransformMethods.SetDrawInfoWrapper); #endif - VtblForID2D1EffectImpl = lpVtbl; - VtblForID2D1DrawTransform = &lpVtbl[6]; + return lpVtbl; } /// @@ -363,7 +363,7 @@ internal unsafe partial struct PixelShaderEffect // Then, retrieve all of them and release the ones that had been assigned (from one of the property bindings). foreach (ref readonly D2D1ResourceTextureDescription resourceTextureDescription in new ReadOnlySpan(this.resourceTextureDescriptions, this.resourceTextureDescriptionCount)) { - ID2D1ResourceTextureManager* resourceTextureManager = resourceTextureManagerBuffer[resourceTextureDescription.Index]; + ID2D1ResourceTextureManager* resourceTextureManager = this.resourceTextureManagerBuffer[resourceTextureDescription.Index]; if (resourceTextureManager is not null) { diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.cs index bf17571c..bdeb44bc 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.cs @@ -32,17 +32,18 @@ internal unsafe partial struct D2D1ResourceTextureManagerImpl /// /// The shared vtable pointer for instance, for ID2D1ResourceTextureManager. /// - private static readonly void** VtblForID2D1ResourceTextureManager; + private static readonly void** VtblForID2D1ResourceTextureManager = InitVtblForID2D1ResourceTextureManagerAndID2D1ResourceTextureManagerInternal(); /// /// The shared vtable pointer for instance, for ID2D1ResourceTextureManagerInternal. /// - private static readonly void** VtblForID2D1ResourceTextureManagerInternal; + private static readonly void** VtblForID2D1ResourceTextureManagerInternal = &VtblForID2D1ResourceTextureManager[5]; /// - /// Initializes the shared state for . + /// Initializes the combined vtable for ID2D1ResourceTextureManager and ID2D1ResourceTextureManagerInternal. /// - static D2D1ResourceTextureManagerImpl() + /// The combined vtable for ID2D1ResourceTextureManager and ID2D1ResourceTextureManagerInternal. + private static void** InitVtblForID2D1ResourceTextureManagerAndID2D1ResourceTextureManagerInternal() { void** lpVtbl = (void**)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(D2D1ResourceTextureManagerImpl), sizeof(void*) * 10); @@ -76,8 +77,7 @@ internal unsafe partial struct D2D1ResourceTextureManagerImpl lpVtbl[5 + 4] = (void*)Marshal.GetFunctionPointerForDelegate(ID2D1ResourceTextureManagerInternalMethods.GetResourceTextureWrapper); #endif - VtblForID2D1ResourceTextureManager = lpVtbl; - VtblForID2D1ResourceTextureManagerInternal = &lpVtbl[5]; + return lpVtbl; } /// @@ -249,17 +249,18 @@ internal unsafe partial struct D2D1ResourceTextureManagerImpl // Release the resource too if it has been created if (this.d2D1ResourceTexture is not null) { - this.d2D1ResourceTexture->Release(); + _ = this.d2D1ResourceTexture->Release(); } // Now that the resource, if any, has been released, the effect context can also // be released. This must be done only after any associated resource textures have // been released. Releasing an effect context first, in case it was the last reference // to it, will otherwise cause the Release() call on the resource texture to explode. - this.d2D1EffectContext->Release(); + _ = this.d2D1EffectContext->Release(); this.d2D1Multithread->Leave(); - this.d2D1Multithread->Release(); + + _ = this.d2D1Multithread->Release(); } if (this.resourceId is not null) diff --git a/src/ComputeSharp/Graphics/Interop/NativeObject.cs b/src/ComputeSharp/Graphics/Interop/NativeObject.cs index 261990ec..d3eec5c2 100644 --- a/src/ComputeSharp/Graphics/Interop/NativeObject.cs +++ b/src/ComputeSharp/Graphics/Interop/NativeObject.cs @@ -1,4 +1,6 @@ -using System; +using System; + +#pragma warning disable CA1063 namespace ComputeSharp.Interop; diff --git a/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs b/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs index 610ea99c..71b87bf9 100644 --- a/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Views/TextureView2D{T}.cs @@ -3,7 +3,7 @@ using System.ComponentModel; using System.Runtime.CompilerServices; using CommunityToolkit.Diagnostics; -#pragma warning disable CS0809 +#pragma warning disable CS0809, CA1065 namespace ComputeSharp; @@ -16,7 +16,7 @@ namespace ComputeSharp; /// It is recommended to execute as much computation on the GPU side as possible. /// /// The type of items in the current instance. -public readonly unsafe ref partial struct TextureView2D +public readonly unsafe ref struct TextureView2D where T : unmanaged { // Let's consider a representation of a 2D texture or a generic 2D memory region. @@ -339,7 +339,7 @@ public readonly unsafe ref partial struct TextureView2D /// [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Equals() on Span will always throw an exception. Use == instead.")] + [Obsolete("Equals() on TextureView2D will always throw an exception. Use == instead.")] public override bool Equals(object? obj) { throw new NotSupportedException("ComputeSharp.TextureView2D.Equals(object) is not supported"); @@ -347,7 +347,7 @@ public readonly unsafe ref partial struct TextureView2D /// [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("GetHashCode() on Span will always throw an exception.")] + [Obsolete("GetHashCode() on TextureView2D will always throw an exception.")] public override int GetHashCode() { throw new NotSupportedException("ComputeSharp.TextureView2D.GetHashCode() is not supported"); diff --git a/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs b/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs index a7ed9751..86a98c33 100644 --- a/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Views/TextureView3D{T}.cs @@ -3,7 +3,7 @@ using System.ComponentModel; using System.Runtime.CompilerServices; using CommunityToolkit.Diagnostics; -#pragma warning disable CS0809 +#pragma warning disable CS0809, CA1065 namespace ComputeSharp; @@ -13,7 +13,7 @@ namespace ComputeSharp; /// It is recommended to execute as much computation on the GPU side as possible. /// /// The type of items in the current instance. -public readonly unsafe ref partial struct TextureView3D +public readonly unsafe ref struct TextureView3D where T : unmanaged { // The internal layout of a 3D texture mapped in memory is the same as that of a @@ -396,7 +396,7 @@ public readonly unsafe ref partial struct TextureView3D /// [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Equals() on Span will always throw an exception. Use == instead.")] + [Obsolete("Equals() on TextureView3D will always throw an exception. Use == instead.")] public override bool Equals(object? obj) { throw new NotSupportedException("ComputeSharp.TextureView3D.Equals(object) is not supported"); @@ -404,7 +404,7 @@ public readonly unsafe ref partial struct TextureView3D /// [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("GetHashCode() on Span will always throw an exception.")] + [Obsolete("GetHashCode() on TextureView3D will always throw an exception.")] public override int GetHashCode() { throw new NotSupportedException("ComputeSharp.TextureView3D.GetHashCode() is not supported");