Add parentheses for clarity where needed (IDE0048)
このコミットが含まれているのは:
1 親
553c7a4014
コミット
ce1097e7d9
47ファイル変更
+222
-198
検索条件に一致するファイルはありません
@@ -689,7 +689,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
for (int y = 0; y < updateLengthY; y++)
|
||||
{
|
||||
ReadOnlySpan<byte> source = data.AsSpan(y * updateLengthX, updateLengthX);
|
||||
Span<byte> destination = texture.AsSpan(startOffsetY * width + y * width + startOffsetX, updateLengthX);
|
||||
Span<byte> destination = texture.AsSpan((startOffsetY * width) + (y * width) + startOffsetX, updateLengthX);
|
||||
|
||||
source.CopyTo(destination);
|
||||
}
|
||||
@@ -707,7 +707,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
foreach (Bgra32 pixel in new ReadOnlySpan<Bgra32>(d2D1MappedRect.bits + d2D1MappedRect.pitch * y, width))
|
||||
foreach (Bgra32 pixel in new ReadOnlySpan<Bgra32>(d2D1MappedRect.bits + (d2D1MappedRect.pitch * y), width))
|
||||
{
|
||||
resultingBytes[i++] = pixel.B;
|
||||
}
|
||||
@@ -793,8 +793,8 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
{
|
||||
for (int y = 0; y < updateLengthY; y++)
|
||||
{
|
||||
ReadOnlySpan<byte> source = data.AsSpan(z * updateLengthX * updateLengthY + y * updateLengthX, updateLengthX);
|
||||
Span<byte> destination = texture.AsSpan((startOffsetZ + z) * (width * height) + (startOffsetY + y) * width + startOffsetX, updateLengthX);
|
||||
ReadOnlySpan<byte> source = data.AsSpan((z * updateLengthX * updateLengthY) + (y * updateLengthX), updateLengthX);
|
||||
Span<byte> destination = texture.AsSpan(((startOffsetZ + z) * (width * height)) + ((startOffsetY + y) * width) + startOffsetX, updateLengthX);
|
||||
|
||||
source.CopyTo(destination);
|
||||
}
|
||||
@@ -813,7 +813,7 @@ public partial class D2D1ResourceTextureManagerTests
|
||||
|
||||
for (int y = 0; y < height * depth; y++)
|
||||
{
|
||||
foreach (Bgra32 pixel in new ReadOnlySpan<Bgra32>(d2D1MappedRect.bits + d2D1MappedRect.pitch * y, width))
|
||||
foreach (Bgra32 pixel in new ReadOnlySpan<Bgra32>(d2D1MappedRect.bits + (d2D1MappedRect.pitch * y), width))
|
||||
{
|
||||
resultingBytes[i++] = pixel.B;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public sealed partial class BokehBlurEffect
|
||||
public BokehBlurEffect(int radius, int componentsCount)
|
||||
{
|
||||
this.radius = radius;
|
||||
this.kernelSize = this.radius * 2 + 1;
|
||||
this.kernelSize = (this.radius * 2) + 1;
|
||||
this.componentsCount = componentsCount;
|
||||
|
||||
// Reuse the initialized values from the cache, if possible
|
||||
@@ -246,8 +246,8 @@ public sealed partial class BokehBlurEffect
|
||||
ref Complex64 kRef = ref Unsafe.Add(ref valueRef, k);
|
||||
|
||||
total +=
|
||||
paramsRef.Z * (jRef.Real * kRef.Real - jRef.Imaginary * kRef.Imaginary)
|
||||
+ paramsRef.W * (jRef.Real * kRef.Imaginary + jRef.Imaginary * kRef.Real);
|
||||
(paramsRef.Z * ((jRef.Real * kRef.Real) - (jRef.Imaginary * kRef.Imaginary)))
|
||||
+ (paramsRef.W * ((jRef.Real * kRef.Imaginary) + (jRef.Imaginary * kRef.Real)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -582,8 +582,8 @@ public sealed partial class BokehBlurEffect
|
||||
float realFactor = kernelReals[i];
|
||||
float imaginaryFactor = kernelImaginaries[i];
|
||||
|
||||
result.Real += (Vector4)(realFactor * sourceReal - imaginaryFactor * sourceImaginary);
|
||||
result.Imaginary += (Vector4)(realFactor * sourceImaginary + imaginaryFactor * sourceReal);
|
||||
result.Real += (Vector4)((realFactor * sourceReal) - (imaginaryFactor * sourceImaginary));
|
||||
result.Imaginary += (Vector4)((realFactor * sourceImaginary) + (imaginaryFactor * sourceReal));
|
||||
}
|
||||
|
||||
return result.WeightedSum(z, w);
|
||||
|
||||
@@ -34,7 +34,7 @@ public readonly partial struct ZonePlateEffect : ID2D1PixelShader
|
||||
float yd = yo * yo;
|
||||
float xd = xo * xo;
|
||||
float d = xd + yd;
|
||||
float v = 1.0f + (1.0f + Hlsl.Tanh((rm - Hlsl.Sqrt(d)) / w)) * Hlsl.Sin(km * d) * 0.5f;
|
||||
float v = 1.0f + ((1.0f + Hlsl.Tanh((rm - Hlsl.Sqrt(d)) / w)) * Hlsl.Sin(km * d) * 0.5f);
|
||||
|
||||
return new Float4(v, v, v, 1.0f);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ internal static class ImageHelper
|
||||
|
||||
for (int i = 0; i < (int)height; i++)
|
||||
{
|
||||
ReadOnlySpan<byte> source = new(buffer + i * (int)strideInBytes, (int)width * sizeof(Bgra32));
|
||||
ReadOnlySpan<byte> source = new(buffer + (i * (int)strideInBytes), (int)width * sizeof(Bgra32));
|
||||
|
||||
source.CopyTo(pixelData.AsSpan(i * (int)width * sizeof(Bgra32)));
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public partial class DeviceDisposalTests
|
||||
public float4 Execute()
|
||||
{
|
||||
float2 uv = ThreadIds.Normalized.XY;
|
||||
float3 col = 0.5f + 0.5f * Hlsl.Cos(new float3(uv, uv.X) + new float3(0, 2, 4));
|
||||
float3 col = 0.5f + (0.5f * Hlsl.Cos(new float3(uv, uv.X) + new float3(0, 2, 4)));
|
||||
|
||||
return new(col, 1f);
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ public partial class BufferTests
|
||||
|
||||
for (int i = 0; i < 128; i++)
|
||||
{
|
||||
Assert.IsTrue(Math.Abs(result[i] - (array[i] * 2.0 + 3.14)) < 0.00001);
|
||||
Assert.IsTrue(Math.Abs(result[i] - ((array[i] * 2.0) + 3.14)) < 0.00001);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ public partial class BufferTests
|
||||
/// <inheritdoc/>
|
||||
public void Execute()
|
||||
{
|
||||
buffer[ThreadIds.X] = buffer[ThreadIds.X] * factor + 3.14;
|
||||
buffer[ThreadIds.X] = (buffer[ThreadIds.X] * factor) + 3.14;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ public partial class DispatchTests
|
||||
Assert.AreEqual(x % 4, value[0]);
|
||||
Assert.AreEqual(y % 4, value[1]);
|
||||
Assert.AreEqual(z % 4, value[2]);
|
||||
Assert.AreEqual(value[2] * 4 * 4 + value[1] * 4 + value[0], value[3]);
|
||||
Assert.AreEqual((value[2] * 4 * 4) + (value[1] * 4) + value[0], value[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace ComputeSharp.Tests
|
||||
float exp = Hlsl.Exp(dword * row_major[ThreadIds.X]);
|
||||
float log = Hlsl.Log(1 + exp);
|
||||
|
||||
row_major[ThreadIds.X] = log / dword + float2 + int2x2;
|
||||
row_major[ThreadIds.X] = (log / dword) + float2 + int2x2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,10 +144,10 @@ namespace ComputeSharp.Tests
|
||||
float s2 = s1 + this.intensity + Hlsl.Tan(s1 * this.scale);
|
||||
float t2 = t1 + this.intensity + Hlsl.Tan(t1 * this.scale);
|
||||
|
||||
float u2 = this.cos * s2 - this.sin * t2;
|
||||
float v2 = this.sin * s2 - this.cos * t2;
|
||||
float u2 = (this.cos * s2) - (this.sin * t2);
|
||||
float v2 = (this.sin * s2) - (this.cos * t2);
|
||||
|
||||
row_major[ThreadIds.X] = log / dword + float2 + int2x2 + u2 + v2;
|
||||
row_major[ThreadIds.X] = (log / dword) + float2 + int2x2 + u2 + v2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace ComputeSharp.Tests
|
||||
{
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
buffer[ThreadIds.X * 10 + i] = i;
|
||||
buffer[(ThreadIds.X * 10) + i] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -486,7 +486,7 @@ namespace ExternalNamespace
|
||||
{
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
buffer[ThreadIds.X * 10 + i] = i;
|
||||
buffer[(ThreadIds.X * 10) + i] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ public partial class ShaderRewriterTests
|
||||
internal readonly partial struct ConstantsInShaderConstantFieldsShader : IComputeShader
|
||||
{
|
||||
public const float rot_angle = (float)(137.2 / 180.0 * Math.PI);
|
||||
public const float rot_angle2 = rot_angle + (float)Math.E * 100;
|
||||
public const float rot_angle2 = rot_angle + ((float)Math.E * 100);
|
||||
public const float sin = 42;
|
||||
public const float exponentLowercase = 1234567e-4f;
|
||||
public const float exponentUppercase = 1234567E-4f;
|
||||
@@ -743,7 +743,7 @@ public partial class ShaderRewriterTests
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
Assert.AreEqual(i * 2 + 1, results1[i].value);
|
||||
Assert.AreEqual((i * 2) + 1, results1[i].value);
|
||||
Assert.AreEqual(results1[i].value, results2[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#pragma warning disable IDE0048
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -435,7 +435,7 @@ public partial class Texture2DTests
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
destination[ThreadIds.Y * 32 + ThreadIds.X] = source[ThreadIds.XY];
|
||||
destination[(ThreadIds.Y * 32) + ThreadIds.X] = source[ThreadIds.XY];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -540,7 +540,7 @@ public partial class Texture3DTests
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
destination[ThreadIds.Z * 32 * 32 + ThreadIds.Y * 32 + ThreadIds.X] = source[ThreadIds.XYZ];
|
||||
destination[(ThreadIds.Z * 32 * 32) + (ThreadIds.Y * 32) + ThreadIds.X] = source[ThreadIds.XYZ];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ public partial class TransferTexture3DTests
|
||||
{
|
||||
for (int j = 0; j < uploadTexture3D.Height; j++)
|
||||
{
|
||||
new Random(i * 5381 + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes());
|
||||
new Random((i * 5381) + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public partial class TransferTexture3DTests
|
||||
{
|
||||
for (int j = 0; j < uploadTexture3D.Height; j++)
|
||||
{
|
||||
new Random(i * 5381 + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes());
|
||||
new Random((i * 5381) + j).NextBytes(uploadTexture3D.View.GetRowSpan(j, i).AsBytes());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする