Set EnforceExtendedAnalyzerRules in analyzers

このコミットが含まれているのは:
Sergio Pedri committed 2023-06-06 21:18:33 +02:00
1 親 fde55833f6
コミット 75cb16384c
5ファイル変更
+9 -79

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

+2 -1
ファイルの表示
@@ -631,7 +631,8 @@ partial class DiagnosticDescriptors
defaultSeverity: DiagnosticSeverity.Error,
isEnabledByDefault: true,
description: "A D2D1 shader generated with ComputeSharp.D2D1 (or an assembly) cannot use the PackMatrixColumnMajor option, as that is not compatible with the generated code used to load shader constant buffers.",
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp");
helpLinkUri: "https://github.com/Sergio0694/ComputeSharp",
customTags: WellKnownDiagnosticTags.CompilationEnd);
/// <summary>
/// Gets a <see cref="DiagnosticDescriptor"/> for when the <c>[D2DRequiresScenePosition]</c> attribute is missing.
+2
ファイルの表示
@@ -8,6 +8,8 @@ using System;
using System.Runtime.CompilerServices;
using System.Threading;
#pragma warning disable RS1035
namespace ComputeSharp.SourceGeneration.Helpers;
/// <summary>
+2
ファイルの表示
@@ -20,6 +20,8 @@ using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors;
#pragma warning disable RS1035
namespace ComputeSharp.SourceGenerators;
/// <inheritdoc/>
+3
ファイルの表示
@@ -49,6 +49,9 @@
<!-- Disable packing symbols for source generators -->
<PackSymbols Condition="$(IsSourceGeneratorProject)">false</PackSymbols>
<!-- Enable extended analyzer rules for all source generators -->
<EnforceExtendedAnalyzerRules Condition="$(IsSourceGeneratorProject)">true</EnforceExtendedAnalyzerRules>
<!-- Check whether the project has a .targets file to bundle -->
<IsTargetsFileAvailableForPacking>false</IsTargetsFileAvailableForPacking>
<IsTargetsFileAvailableForPacking Condition="$(IsPackagedProject) AND Exists('$(MSBuildProjectName).targets')">true</IsTargetsFileAvailableForPacking>
@@ -3,10 +3,6 @@
// Ported from d3dx12.h in DirectX-Graphics-Samples commit a7a87f1853b5540f10920518021d91ae641033fb
// Original source is Copyright © Microsoft. All rights reserved. Licensed under the MIT License (MIT).
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using static TerraFX.Interop.DirectX.D3D_ROOT_SIGNATURE_VERSION;
using static TerraFX.Interop.DirectX.D3D12_ROOT_SIGNATURE_FLAGS;
@@ -14,75 +10,6 @@ namespace TerraFX.Interop.DirectX;
internal unsafe partial struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC
{
public D3D12_VERSIONED_ROOT_SIGNATURE_DESC([NativeTypeName("const D3D12_ROOT_SIGNATURE_DESC &")] in D3D12_ROOT_SIGNATURE_DESC o)
{
Unsafe.SkipInit(out this);
Version = D3D_ROOT_SIGNATURE_VERSION_1_0;
Anonymous.Desc_1_0 = o;
}
public D3D12_VERSIONED_ROOT_SIGNATURE_DESC([NativeTypeName("const D3D12_ROOT_SIGNATURE_DESC1 &")] in D3D12_ROOT_SIGNATURE_DESC1 o)
{
Unsafe.SkipInit(out this);
Version = D3D_ROOT_SIGNATURE_VERSION_1_1;
Anonymous.Desc_1_1 = o;
}
public D3D12_VERSIONED_ROOT_SIGNATURE_DESC(uint numParameters, [NativeTypeName("const D3D12_ROOT_PARAMETER *")] D3D12_ROOT_PARAMETER* _pParameters, uint numStaticSamplers = 0, [NativeTypeName("const D3D12_STATIC_SAMPLER_DESC *")] D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = null, D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
{
Init_1_0(out this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
}
public D3D12_VERSIONED_ROOT_SIGNATURE_DESC(uint numParameters, [NativeTypeName("const D3D12_ROOT_PARAMETER1 *")] D3D12_ROOT_PARAMETER1* _pParameters, uint numStaticSamplers = 0, [NativeTypeName("const D3D12_STATIC_SAMPLER_DESC *")] D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = null, D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
{
Init_1_1(out this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
}
public static ref readonly D3D12_VERSIONED_ROOT_SIGNATURE_DESC DEFAULT
{
get
{
ReadOnlySpan<byte> data;
if (Environment.Is64BitProcess)
{
data = new byte[] {
0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
}
else
{
data = new byte[] {
0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
}
Debug.Assert(data.Length == Unsafe.SizeOf<D3D12_VERSIONED_ROOT_SIGNATURE_DESC>());
return ref Unsafe.As<byte, D3D12_VERSIONED_ROOT_SIGNATURE_DESC>(ref MemoryMarshal.GetReference(data));
}
}
public void Init_1_0(uint numParameters, [NativeTypeName("const D3D12_ROOT_PARAMETER *")] D3D12_ROOT_PARAMETER* _pParameters, uint numStaticSamplers = 0, [NativeTypeName("const D3D12_STATIC_SAMPLER_DESC *")] D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = null, D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
{
Init_1_0(out this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
}
public static void Init_1_0([NativeTypeName("D3D12_VERSIONED_ROOT_SIGNATURE_DESC &")] out D3D12_VERSIONED_ROOT_SIGNATURE_DESC desc, uint numParameters, [NativeTypeName("const D3D12_ROOT_PARAMETER *")] D3D12_ROOT_PARAMETER* _pParameters, uint numStaticSamplers = 0, [NativeTypeName("const D3D12_STATIC_SAMPLER_DESC *")] D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = null, D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
{
desc = default;
@@ -95,11 +22,6 @@ internal unsafe partial struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC
desc.Anonymous.Desc_1_0.Flags = flags;
}
public void Init_1_1(uint numParameters, [NativeTypeName("const D3D12_ROOT_PARAMETER1 *")] D3D12_ROOT_PARAMETER1* _pParameters, uint numStaticSamplers = 0, [NativeTypeName("const D3D12_STATIC_SAMPLER_DESC *")] D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = null, D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
{
Init_1_1(out this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
}
public static void Init_1_1([NativeTypeName("D3D12_VERSIONED_ROOT_SIGNATURE_DESC &")] out D3D12_VERSIONED_ROOT_SIGNATURE_DESC desc, uint numParameters, [NativeTypeName("const D3D12_ROOT_PARAMETER1 *")] D3D12_ROOT_PARAMETER1* _pParameters, uint numStaticSamplers = 0, [NativeTypeName("const D3D12_STATIC_SAMPLER_DESC *")] D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = null, D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
{
desc = default;