Remove unnecessary parentheses
このコミットが含まれているのは:
1 親
d910922ef5
コミット
8be9203a1c
18ファイル変更
+35
-36
検索条件に一致するファイルはありません
@@ -165,7 +165,7 @@ internal readonly partial struct ContouredLayers : IPixelShader<float4>
|
||||
|
||||
float4 c = MapLayer(new float3(uv, 1.0f), fi);
|
||||
float4 cSh = MapLayer(new float3(uv - (new float2(0.03f, -0.03f) * (((flNum - fi) / flNum * 0.5f) + 0.5f)), 1.0f), fi);
|
||||
float sh = (fi + 1.0f) / (flNum);
|
||||
float sh = (fi + 1.0f) / flNum;
|
||||
float3 lCol = GetColor(uv, sh, fi + 1.0f);
|
||||
float3 ld = Hlsl.Normalize(new float3(-1, 1, -0.25f));
|
||||
float3 n = Hlsl.Normalize(new float3(0.0f, 0.0f, -1.0f) + c.YZW);
|
||||
@@ -181,8 +181,8 @@ internal readonly partial struct ContouredLayers : IPixelShader<float4>
|
||||
col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfLSh, Hlsl.Max(cSh.X, pL))) * shF);
|
||||
col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL * 3.0f, c.X)) * 0.25f);
|
||||
col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X)) * 0.85f);
|
||||
col = Hlsl.Lerp(col, eCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + (Hlsl.Length(c.YZX) * 0.003f))));
|
||||
col = Hlsl.Lerp(col, lCol * hatch, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + (Hlsl.Length(c.YZX) * 0.006f))));
|
||||
col = Hlsl.Lerp(col, eCol * hatch, 1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + (Hlsl.Length(c.YZX) * 0.003f)));
|
||||
col = Hlsl.Lerp(col, lCol * hatch, 1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + (Hlsl.Length(c.YZX) * 0.006f)));
|
||||
|
||||
pL = c.X;
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ internal readonly partial struct MengerJourney : IPixelShader<float4>
|
||||
float diffuse2 = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir2));
|
||||
|
||||
return
|
||||
((diffuse * Diffuse) * (LightColor * color)) +
|
||||
((diffuse2 * Diffuse) * (LightColor2 * color));
|
||||
(diffuse * Diffuse * (LightColor * color)) +
|
||||
(diffuse2 * Diffuse * (LightColor2 * color));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -84,7 +84,7 @@ internal readonly partial struct ProteanClouds : IPixelShader<float4>
|
||||
float3 pos = ro + (t * rd);
|
||||
float2 mpv = Map(pos, prm1, bsMo);
|
||||
float den = Hlsl.Clamp(mpv.X - 0.3f, 0.0f, 1.0f) * 1.12f;
|
||||
float dn = Hlsl.Clamp((mpv.X + 2.0f), 0.0f, 3.0f);
|
||||
float dn = Hlsl.Clamp(mpv.X + 2.0f, 0.0f, 3.0f);
|
||||
float4 col = 0f;
|
||||
|
||||
if (mpv.X > 0.6f)
|
||||
|
||||
@@ -84,7 +84,7 @@ internal readonly partial struct PyramidPattern : IPixelShader<float4>
|
||||
|
||||
p -= ip + 0.5f;
|
||||
|
||||
float ang = (-3.14159f * 3.0f / 5.0f) + ((FBM((ip / 8.0f) + (time / 3.0f))) * 6.2831f * 2.0f);
|
||||
float ang = (-3.14159f * 3.0f / 5.0f) + (FBM((ip / 8.0f) + (time / 3.0f)) * 6.2831f * 2.0f);
|
||||
|
||||
float2 offs = new float2(Hlsl.Cos(ang), Hlsl.Sin(ang)) * 0.35f;
|
||||
|
||||
@@ -121,7 +121,7 @@ internal readonly partial struct PyramidPattern : IPixelShader<float4>
|
||||
float fx2 = BMap(p + e.XY);
|
||||
float fy2 = BMap(p + e.YX);
|
||||
|
||||
float3 grad = (new float3(fx - fx2, fy - fx2, 0)) / e.X / 2.0f;
|
||||
float3 grad = new float3(fx - fx2, fy - fx2, 0) / e.X / 2.0f;
|
||||
|
||||
edge = Hlsl.Length(new float2(fx, fy) + new float2(fx2, fy2) - (f * 2.0f));
|
||||
edge = Hlsl.SmoothStep(0.0f, 1.0f, edge / e.X);
|
||||
|
||||
@@ -205,7 +205,7 @@ internal readonly partial struct TriangleGridContouring : IPixelShader<float4>
|
||||
d = 0;
|
||||
}
|
||||
|
||||
d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1)));
|
||||
d3 = Hlsl.Min(d3, DistLine(p - p0, p - p1));
|
||||
d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1)));
|
||||
|
||||
float tri = Hlsl.Min(Hlsl.Min(DistLine(p - ip0, p - ip1), DistLine(p - ip1, p - ip2)), DistLine(p - ip2, p - ip0));
|
||||
@@ -229,7 +229,7 @@ internal readonly partial struct TriangleGridContouring : IPixelShader<float4>
|
||||
}
|
||||
|
||||
d2 = Hlsl.Max(d2, -d);
|
||||
d3 = Hlsl.Min(d3, DistLine((p - p0), (p - p1)));
|
||||
d3 = Hlsl.Min(d3, DistLine(p - p0, p - p1));
|
||||
d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1)));
|
||||
d4 -= 0.075f;
|
||||
d3 -= 0.0125f;
|
||||
@@ -249,12 +249,12 @@ internal readonly partial struct TriangleGridContouring : IPixelShader<float4>
|
||||
|
||||
if (d > 0.0f)
|
||||
{
|
||||
col = Hlsl.Lerp(col, new float3(1, 1.85f, 3) * 0.3f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d2 - 0.012f)));
|
||||
col = Hlsl.Lerp(col, new float3(1, 1.85f, 3) * 0.3f, 1.0f - Hlsl.SmoothStep(0.0f, sf, d2 - 0.012f));
|
||||
}
|
||||
|
||||
col = Hlsl.Lerp(col, new float3(1.1f, 0.85f, 0.6f), (1.0f - Hlsl.SmoothStep(0.0f, sf, d2)));
|
||||
col = Hlsl.Lerp(col, new float3(1.5f, 0.9f, 0.6f) * 0.6f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d - 0.012f)));
|
||||
col = Hlsl.Lerp(col, new float3(1, 0.8f, 0.6f) * new float3(0.7f, 1.0f, 0.75f) * 0.95f, (1.0f - Hlsl.SmoothStep(0.0f, sf, d)));
|
||||
col = Hlsl.Lerp(col, new float3(1.1f, 0.85f, 0.6f), 1.0f - Hlsl.SmoothStep(0.0f, sf, d2));
|
||||
col = Hlsl.Lerp(col, new float3(1.5f, 0.9f, 0.6f) * 0.6f, 1.0f - Hlsl.SmoothStep(0.0f, sf, d - 0.012f));
|
||||
col = Hlsl.Lerp(col, new float3(1, 0.8f, 0.6f) * new float3(0.7f, 1.0f, 0.75f) * 0.95f, 1.0f - Hlsl.SmoothStep(0.0f, sf, d));
|
||||
|
||||
if (d2 > 0.0f)
|
||||
{
|
||||
@@ -269,9 +269,9 @@ internal readonly partial struct TriangleGridContouring : IPixelShader<float4>
|
||||
|
||||
col *= (pat * 0.425f) + 0.75f;
|
||||
col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d5)) * 0.95f);
|
||||
col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d3)));
|
||||
col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4)));
|
||||
col = Hlsl.Lerp(col, float3.One, (1.0f - Hlsl.SmoothStep(0.0f, sf, d4 + 0.005f)));
|
||||
col = Hlsl.Lerp(col, float3.Zero, 1.0f - Hlsl.SmoothStep(0.0f, sf, d3));
|
||||
col = Hlsl.Lerp(col, float3.Zero, 1.0f - Hlsl.SmoothStep(0.0f, sf, d4));
|
||||
col = Hlsl.Lerp(col, float3.One, 1.0f - Hlsl.SmoothStep(0.0f, sf, d4 + 0.005f));
|
||||
|
||||
float2 q = oP * 1.5f;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public sealed partial class App : Application
|
||||
|
||||
// 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.
|
||||
this.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);
|
||||
};
|
||||
|
||||
this.mainWindow.Activate();
|
||||
|
||||
@@ -214,7 +214,7 @@ internal sealed partial class ShaderSourceRewriter : HlslSourceRewriter
|
||||
/// <inheritdoc/>
|
||||
public override SyntaxNode VisitLocalDeclarationStatement(LocalDeclarationStatementSyntax node)
|
||||
{
|
||||
LocalDeclarationStatementSyntax updatedNode = ((LocalDeclarationStatementSyntax)base.VisitLocalDeclarationStatement(node)!);
|
||||
LocalDeclarationStatementSyntax updatedNode = (LocalDeclarationStatementSyntax)base.VisitLocalDeclarationStatement(node)!;
|
||||
|
||||
if (SemanticModel.For(node).GetOperation(node) is IOperation { Kind: OperationKind.UsingDeclaration })
|
||||
{
|
||||
|
||||
+3
-3
@@ -63,7 +63,7 @@ public sealed class InvalidComputeContextCopyAnalyzer : DiagnosticAnalyzer
|
||||
{
|
||||
// In the absence of data flow analysis we can treat
|
||||
// return of a local variable or a parameter as a "move"
|
||||
if (operation.ReturnedValue.Kind is (OperationKind.LocalReference or OperationKind.ParameterReference) &&
|
||||
if (operation.ReturnedValue.Kind is OperationKind.LocalReference or OperationKind.ParameterReference &&
|
||||
operation.Kind == OperationKind.Return)
|
||||
{
|
||||
ISymbol? varScope = operation.ReturnedValue.Kind switch
|
||||
@@ -355,7 +355,7 @@ public sealed class InvalidComputeContextCopyAnalyzer : DiagnosticAnalyzer
|
||||
}
|
||||
|
||||
return
|
||||
kind is (OperationKind.ObjectCreation or OperationKind.DefaultValue or OperationKind.Literal or OperationKind.Invocation) ||
|
||||
(kind is (OperationKind.None or OperationKind.Invalid) && operation.Syntax is InvocationExpressionSyntax); // Workaround for https://github.com/dotnet/roslyn/issues/49751
|
||||
kind is OperationKind.ObjectCreation or OperationKind.DefaultValue or OperationKind.Literal or OperationKind.Invocation ||
|
||||
(kind is OperationKind.None or OperationKind.Invalid && operation.Syntax is InvocationExpressionSyntax); // Workaround for https://github.com/dotnet/roslyn/issues/49751
|
||||
}
|
||||
}
|
||||
@@ -396,8 +396,8 @@ internal sealed unsafe partial class SwapChainManager<TOwner> : NativeObject
|
||||
|
||||
// Apply the necessary scale transform
|
||||
DXGI_MATRIX_3X2_F transformMatrix = default;
|
||||
transformMatrix._11 = (1 / this.compositionScaleX) * (1 / targetResolutionScale);
|
||||
transformMatrix._22 = (1 / this.compositionScaleY) * (1 / targetResolutionScale);
|
||||
transformMatrix._11 = 1 / this.compositionScaleX * (1 / targetResolutionScale);
|
||||
transformMatrix._22 = 1 / this.compositionScaleY * (1 / targetResolutionScale);
|
||||
|
||||
this.dxgiSwapChain3.Get()->SetMatrixTransform(&transformMatrix).Assert();
|
||||
|
||||
|
||||
@@ -217,10 +217,7 @@ partial class NativeObject
|
||||
|
||||
this.nativeObject = null;
|
||||
|
||||
if (nativeObject is not null)
|
||||
{
|
||||
nativeObject.ReturnReferenceTrackingLease();
|
||||
}
|
||||
nativeObject?.ReturnReferenceTrackingLease();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -794,7 +794,7 @@ 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);
|
||||
Span<byte> destination = texture.AsSpan(((startOffsetZ + z) * width * height) + ((startOffsetY + y) * width) + startOffsetX, updateLengthX);
|
||||
|
||||
source.CopyTo(destination);
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@ namespace TerraFX.Interop.DirectX
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public uint Release()
|
||||
{
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D12Device5*, uint>)(lpVtbl[2]))((ID3D12Device5*)Unsafe.AsPointer(ref this));
|
||||
return ((delegate* unmanaged[Stdcall]<ID3D12Device5*, uint>)lpVtbl[2])((ID3D12Device5*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void RemoveDevice()
|
||||
{
|
||||
((delegate* unmanaged[Stdcall]<ID3D12Device5*, void>)(lpVtbl[58]))((ID3D12Device5*)Unsafe.AsPointer(ref this));
|
||||
((delegate* unmanaged[Stdcall]<ID3D12Device5*, void>)lpVtbl[58])((ID3D12Device5*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using SixLabors.ImageSharp;
|
||||
using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32;
|
||||
|
||||
#pragma warning disable IDE0047
|
||||
|
||||
namespace ComputeSharp.Tests;
|
||||
|
||||
[TestClass]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma warning disable IDE0048, IDE0011
|
||||
#pragma warning disable IDE0048, IDE0011, IDE0047
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma warning disable IDE0048, IDE0011
|
||||
#pragma warning disable IDE0048, IDE0011, IDE0047
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma warning disable IDE0048, IDE0011
|
||||
#pragma warning disable IDE0048, IDE0011, IDE0047
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma warning disable IDE0048, IDE0011
|
||||
#pragma warning disable IDE0048, IDE0011, IDE0047
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma warning disable IDE0048, IDE0011
|
||||
#pragma warning disable IDE0048, IDE0011, IDE0047
|
||||
|
||||
namespace ComputeSharp.SwapChain.Shaders.Compute;
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする