Enable 'IDE0060' warnings, fix issues

このコミットが含まれているのは:
Sergio Pedri committed 2025-03-13 16:56:40 -07:00
1 親 043f8ddcaf
コミット 0a187f64bc
14ファイル変更
+18 -28

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

-2
ファイルの表示
@@ -69,11 +69,9 @@ dotnet_diagnostic.CA2242.severity = warning
dotnet_diagnostic.IDE0010.severity = none
dotnet_diagnostic.IDE0130.severity = none
dotnet_diagnostic.IDE0060.severity = none
dotnet_diagnostic.IDE1006.severity = warning
dotnet_diagnostic.IDE0023.severity = none
dotnet_diagnostic.IDE0024.severity = none
dotnet_diagnostic.IDE0060.severity = none
dotnet_diagnostic.IDE0057.severity = none
dotnet_diagnostic.IDE0046.severity = none
dotnet_diagnostic.IDE0072.severity = none
+2 -2
ファイルの表示
@@ -67,7 +67,7 @@ internal readonly partial struct ProteanClouds(float time, int2 dispatchSize) :
return new float2(d + (cl * 0.2f) + 0.25f, cl);
}
private float4 Render(float3 ro, float3 rd, float time, float prm1, float2 bsMo)
private float4 Render(float3 ro, float3 rd, float prm1, float2 bsMo)
{
float4 rez = 0;
float t = 1.5f;
@@ -162,7 +162,7 @@ internal readonly partial struct ProteanClouds(float time, int2 dispatchSize) :
rd.XY = Hlsl.Mul(rd.XY, Rotate((-Disp(scaledTime + 3.5f).X * 0.2f) + bsMo.X));
float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f));
float4 scn = Render(ro, rd, scaledTime, prm1, bsMo);
float4 scn = Render(ro, rd, prm1, bsMo);
float3 col = scn.RGB;
col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f));
+2 -2
ファイルの表示
@@ -62,7 +62,7 @@ internal readonly partial struct ProteanClouds(float time) : IComputeShader<floa
return new float2(d + (cl * 0.2f) + 0.25f, cl);
}
private float4 Render(float3 ro, float3 rd, float time, float prm1, float2 bsMo)
private float4 Render(float3 ro, float3 rd, float prm1, float2 bsMo)
{
float4 rez = 0;
float t = 1.5f;
@@ -156,7 +156,7 @@ internal readonly partial struct ProteanClouds(float time) : IComputeShader<floa
rd.XY = Hlsl.Mul(rd.XY, Rotate((-Disp(scaledTime + 3.5f).X * 0.2f) + bsMo.X));
float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f));
float4 scn = Render(ro, rd, scaledTime, prm1, bsMo);
float4 scn = Render(ro, rd, prm1, bsMo);
float3 col = scn.RGB;
col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f));
+1 -1
ファイルの表示
@@ -1,6 +1,6 @@
using ComputeSharp.Core.Intrinsics;
#pragma warning disable IDE0022
#pragma warning disable IDE0022, IDE0060
namespace ComputeSharp;
+2
ファイルの表示
@@ -1,6 +1,8 @@
using System;
using System.Runtime.InteropServices;
#pragma warning disable IDE0060
namespace ComputeSharp;
/// <summary>
+2
ファイルの表示
@@ -59,6 +59,8 @@ partial class CanvasEffectPropertyGenerator
return false;
}
token.ThrowIfCancellationRequested();
// The property must be in a type with a base type (as it must derive from CanvasEffect)
return node.Parent?.IsTypeDeclarationWithOrPotentiallyWithBaseTypes<ClassDeclarationSyntax>() == true;
}
+1 -1
ファイルの表示
@@ -145,7 +145,7 @@ unsafe partial class PixelShaderEffect<T>
Span<ComPtr<ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect>> canvasEffects = sourceEffects.Length <= 16
? stackalloc ComPtr<ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect>[16]
: MemoryMarshal.Cast<IntPtr, ComPtr<ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect>>(
canvasEffectsAbiArray = ArrayPool<IntPtr>.Shared.Rent(sourceEffects.Length));
(canvasEffectsAbiArray = ArrayPool<IntPtr>.Shared.Rent(sourceEffects.Length)).AsSpan());
// Clear the span to ensure no false positives are accidentally disposed
canvasEffects.Clear();
@@ -6,6 +6,8 @@ using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
using ComputeSharp.D2D1.Shaders.Interop.Extensions;
using ComputeSharp.Win32;
#pragma warning disable IDE0060
namespace ComputeSharp.D2D1.Interop.Effects;
/// <summary>
+1 -9
ファイルの表示
@@ -229,12 +229,6 @@ internal struct ImmutableArrayBuilder<T> : IDisposable
this.index += items.Length;
}
/// <inheritdoc cref="ImmutableArrayBuilder{T}.Clear"/>
public void Clear(ReadOnlySpan<T> items)
{
this.index = 0;
}
/// <inheritdoc cref="ImmutableArrayBuilder{T}.Insert"/>
public void Insert(int index, T item)
{
@@ -254,9 +248,7 @@ internal struct ImmutableArrayBuilder<T> : IDisposable
this.index++;
}
/// <summary>
/// Clears the items in the current writer.
/// </summary>
/// <inheritdoc cref="ImmutableArrayBuilder{T}.Clear"/>
public void Clear()
{
if (typeof(T) != typeof(byte) &&
+1 -1
ファイルの表示
@@ -8,7 +8,7 @@ using System.Globalization;
using System.Runtime.CompilerServices;
using System.Text;
#pragma warning disable IDE0290
#pragma warning disable IDE0060, IDE0290
namespace ComputeSharp.SourceGeneration.Helpers;
-3
ファイルの表示
@@ -84,7 +84,6 @@ partial class ComputeShaderDescriptorGenerator
token.ThrowIfCancellationRequested();
ImmutableArray<HlslSharedBuffer> sharedBuffers = GetSharedBuffers(
diagnostics,
structDeclarationSymbol,
discoveredTypes);
@@ -323,12 +322,10 @@ partial class ComputeShaderDescriptorGenerator
/// <summary>
/// Gets a sequence of captured members and their mapped names.
/// </summary>
/// <param name="diagnostics">The collection of produced <see cref="DiagnosticInfo"/> instances.</param>
/// <param name="structDeclarationSymbol">The input <see cref="INamedTypeSymbol"/> instance to process.</param>
/// <param name="types">The collection of currently discovered types.</param>
/// <returns>A sequence of captured members in <paramref name="structDeclarationSymbol"/>.</returns>
private static ImmutableArray<HlslSharedBuffer> GetSharedBuffers(
ImmutableArrayBuilder<DiagnosticInfo> diagnostics,
INamedTypeSymbol structDeclarationSymbol,
ICollection<INamedTypeSymbol> types)
{
@@ -1003,10 +1003,7 @@ public class Test_D2DPixelShaderDescriptorGenerator_Analyzers
}
[TestMethod]
[DataRow(-1)]
[DataRow(6)]
[DataRow(int.MaxValue)]
public async Task OutOfRangeInputIndex_OutOfRange_BothInputTypes_WarnsOnce(int inputIndex)
public async Task OutOfRangeInputIndex_OutOfRange_BothInputTypes_WarnsOnce()
{
const string source = """
using ComputeSharp.D2D1;
+1 -1
ファイルの表示
@@ -5,7 +5,7 @@ using ComputeSharp.Interop;
using ComputeSharp.Tests.Misc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
#pragma warning disable IDE0008, IDE0022, IDE0009, IDE0290
#pragma warning disable IDE0008, IDE0022, IDE0009, IDE0060, IDE0290
namespace ComputeSharp.Tests
{
+2 -2
ファイルの表示
@@ -74,7 +74,7 @@ internal readonly partial struct ProteanClouds : IComputeShader
return new float2(d + cl * 0.2f + 0.25f, cl);
}
private float4 Render(float3 ro, float3 rd, float time, float prm1, float2 bsMo)
private float4 Render(float3 ro, float3 rd, float prm1, float2 bsMo)
{
float4 rez = 0;
float t = 1.5f;
@@ -165,7 +165,7 @@ internal readonly partial struct ProteanClouds : IComputeShader
rd.XY = Hlsl.Mul(rd.XY, Rotate(-Disp(scaledTime + 3.5f).X * 0.2f + bsMo.X));
float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f));
float4 scn = Render(ro, rd, scaledTime, prm1, bsMo);
float4 scn = Render(ro, rd, prm1, bsMo);
float3 col = scn.RGB;
col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f));