Switch to PolySharp, remove local polyfills
このコミットが含まれているのは:
1 親
d4b0ddb8bd
コミット
786cf599f4
43ファイル変更
+27
-523
検索条件に一致するファイルはありません
@@ -9,10 +9,6 @@
|
||||
<Import_RootNamespace>ComputeSharp.Core.NetStandard</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime.CompilerServices\InterpolatedStringHandlerArgumentAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime.CompilerServices\InterpolatedStringHandlerAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime.CompilerServices\IsExternalInit.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime.CompilerServices\RuntimeHelpers.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime.CompilerServices\SkipLocalsInitAttribute.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates which arguments to a method involving an interpolated string handler should be passed to that handler.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
|
||||
internal sealed class InterpolatedStringHandlerArgumentAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InterpolatedStringHandlerArgumentAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="argument">The name of the argument that should be passed to the handler.</param>
|
||||
/// <remarks><see langword="null"/> may be used as the name of the receiver in an instance method.</remarks>
|
||||
public InterpolatedStringHandlerArgumentAttribute(string argument)
|
||||
{
|
||||
Arguments = new string[] { argument };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InterpolatedStringHandlerArgumentAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="arguments">The names of the arguments that should be passed to the handler.</param>
|
||||
/// <remarks><see langword="null"/> may be used as the name of the receiver in an instance method.</remarks>
|
||||
public InterpolatedStringHandlerArgumentAttribute(params string[] arguments)
|
||||
{
|
||||
Arguments = arguments;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the names of the arguments that should be passed to the handler.
|
||||
/// </summary>
|
||||
/// <remarks><see langword="null"/> may be used as the name of the receiver in an instance method.</remarks>
|
||||
public string[] Arguments { get; }
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the attributed type is to be used as an interpolated string handler.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)]
|
||||
internal sealed class InterpolatedStringHandlerAttribute : Attribute
|
||||
{
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved to be used by the compiler for tracking metadata.
|
||||
/// This class should not be used by developers in source code.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
internal static class IsExternalInit
|
||||
{
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// Used to indicate to the compiler that the <c>.locals init</c>
|
||||
/// flag should not be set in method headers.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This attribute is unsafe because it may reveal uninitialized memory to
|
||||
/// the application in certain instances (e.g., reading from uninitialized
|
||||
/// stackalloc'd memory). If applied to a method directly, the attribute
|
||||
/// applies to that method and all nested functions (lambdas, local
|
||||
/// functions) below it. If applied to a type or module, it applies to all
|
||||
/// methods nested inside. This attribute is intentionally not permitted on
|
||||
/// assemblies. Use at the module level instead to apply to multiple type
|
||||
/// declarations.
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.Module
|
||||
| AttributeTargets.Class
|
||||
| AttributeTargets.Struct
|
||||
| AttributeTargets.Interface
|
||||
| AttributeTargets.Constructor
|
||||
| AttributeTargets.Method
|
||||
| AttributeTargets.Property
|
||||
| AttributeTargets.Event, Inherited = false)]
|
||||
internal sealed class SkipLocalsInitAttribute : Attribute
|
||||
{
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
@@ -15,7 +15,6 @@
|
||||
manually linking the source files from ComputeSharp\Core in here. We only need them to extract metadata
|
||||
and to match members based on full name, so the types being in the generator assembly are not an issue.-->
|
||||
<ItemGroup>
|
||||
<Compile Include="..\ComputeSharp.Core\Properties\Polyfills\UnscopedRefAttribute.cs" Link="ComputeSharp.Core\Properties\Polyfills\UnscopedRefAttribute.cs.cs" />
|
||||
<Compile Include="..\ComputeSharp.Core\Attributes\AutoConstructorAttribute.cs" Link="ComputeSharp.Core\Attributes\AutoConstructorAttribute.cs" />
|
||||
<Compile Include="..\ComputeSharp.Core\Attributes\Internals\AutoConstructorBehaviorAttribute.cs" Link="ComputeSharp.Core\Attributes\Internals\AutoConstructorBehaviorAttribute.cs" />
|
||||
<Compile Include="..\ComputeSharp.Core\Attributes\Internals\AutoConstructorBehavior.cs" Link="ComputeSharp.Core\Attributes\Internals\AutoConstructorBehavior.cs" />
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// Used to indicate a byref escapes and is not scoped.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// There are several cases where the C# compiler treats a <see langword="ref"/> as implicitly
|
||||
/// <see langword="scoped"/> - where the compiler does not allow the <see langword="ref"/> to escape the method.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// For example:
|
||||
/// <list type="number">
|
||||
/// <item><see langword="this"/> for <see langword="struct"/> instance methods.</item>
|
||||
/// <item><see langword="ref"/> parameters that refer to <see langword="ref"/> <see langword="struct"/> types.</item>
|
||||
/// <item><see langword="out"/> parameters.</item>
|
||||
/// </list>
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// This attribute is used in those instances where the <see langword="ref"/> should be allowed to escape.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Applying this attribute, in any form, has impact on consumers of the applicable API. It is necessary for
|
||||
/// API authors to understand the lifetime implications of applying this attribute and how it may impact their users.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter,
|
||||
AllowMultiple = false,
|
||||
Inherited = false)]
|
||||
internal sealed class UnscopedRefAttribute : Attribute
|
||||
{
|
||||
}
|
||||
@@ -10,16 +10,9 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Buffers\BitOperations.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\DoesNotReturnAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\DisallowNullAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\NotNullAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\NotNullIfNotNullAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Math.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeHelpers.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)..\ComputeSharp.NetStandard\System\Runtime\InteropServices\NativeMemory.cs" Link="System\Runtime\InteropServices\NativeMemory.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)..\ComputeSharp.NetStandard\System\Runtime\InteropServices\UnmanagedCallersOnlyAttribute.cs" Link="System\Runtime\InteropServices\UnmanagedCallersOnlyAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)..\ComputeSharp.NetStandard\System\Runtime\Versioning\OSPlatformAttribute.cs" Link="System\Runtime\Versioning\OSPlatformAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)..\ComputeSharp.NetStandard\System\Runtime\Versioning\SupportedOSPlatformAttribute.cs" Link="System\Runtime\Versioning\SupportedOSPlatformAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Text\EncodingExtensions.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that null is disallowed as an input even if the corresponding type allows it.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
|
||||
internal sealed class DisallowNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
-14
@@ -1,14 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// Applied to a method that will never return under any circumstance.
|
||||
/// </summary>
|
||||
/// <remarks>Internal copy from the BCL attribute.</remarks>
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
|
||||
internal sealed class DoesNotReturnAttribute : Attribute
|
||||
{
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that an output will not be null even if the corresponding type allows it.
|
||||
/// Specifies that an input argument was not null when the call returns.
|
||||
/// </summary>
|
||||
/// <remarks>Internal copy from the BCL attribute.</remarks>
|
||||
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
|
||||
internal sealed class NotNullAttribute : Attribute
|
||||
{
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the output will be non-null if the named parameter is non-null.
|
||||
/// </summary>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Parameter |
|
||||
AttributeTargets.Property |
|
||||
AttributeTargets.ReturnValue,
|
||||
AllowMultiple = true, Inherited = false)]
|
||||
internal sealed class NotNullIfNotNullAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the attribute with the associated parameter name.
|
||||
/// </summary>
|
||||
/// <param name="parameterName">The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.</param>
|
||||
public NotNullIfNotNullAttribute(string parameterName)
|
||||
{
|
||||
ParameterName = parameterName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the associated parameter name.
|
||||
/// </summary>
|
||||
public string ParameterName { get; }
|
||||
}
|
||||
@@ -15,7 +15,6 @@
|
||||
<ItemGroup>
|
||||
|
||||
<!-- ComputeSharp.Core APIs -->
|
||||
<Compile Include="..\ComputeSharp.Core\Properties\Polyfills\UnscopedRefAttribute.cs" Link="ComputeSharp.Core\Properties\Polyfills\UnscopedRefAttribute.cs.cs" />
|
||||
<Compile Include="..\ComputeSharp.Core\Attributes\AutoConstructorAttribute.cs" Link="ComputeSharp.Core\Attributes\AutoConstructorAttribute.cs" />
|
||||
<Compile Include="..\ComputeSharp.Core\Exceptions\InvalidExecutionContextException.cs" Link="ComputeSharp.Core\Exceptions\InvalidExecutionContextException.cs" />
|
||||
<Compile Include="..\ComputeSharp.Core\Intrinsics\Attributes\HlslIntrinsicNameAttribute.cs" Link="ComputeSharp.Core\Intrinsics\Attributes\HlslIntrinsicNameAttribute.cs" />
|
||||
@@ -65,7 +64,6 @@
|
||||
<Compile Include="..\ComputeSharp\Core\Helpers\AlignmentHelper.cs" Link="ComputeSharp\Core\Helpers\AlignmentHelper.cs" />
|
||||
|
||||
<!-- ComputeSharp.D2D1 APIs -->
|
||||
<Compile Include="..\ComputeSharp.D2D1\Properties\Polyfills\StringSyntaxAttribute.cs" Link="ComputeSharp.D2D1\Properties\Polyfills\StringSyntaxAttribute.cs" />
|
||||
<Compile Include="..\ComputeSharp.D2D1\Attributes\Enums\D2D1ShaderProfile.cs" Link="ComputeSharp.D2D1\Attributes\Enums\D2D1ShaderProfile.cs" />
|
||||
<Compile Include="..\ComputeSharp.D2D1\Attributes\Enums\D2D1BufferPrecision.cs" Link="ComputeSharp.D2D1\Attributes\Enums\D2D1BufferPrecision.cs" />
|
||||
<Compile Include="..\ComputeSharp.D2D1\Attributes\Enums\D2D1ChannelDepth.cs" Link="ComputeSharp.D2D1\Attributes\Enums\D2D1ChannelDepth.cs" />
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that compiler support for a particular feature is required for the location where this attribute is applied.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
|
||||
internal sealed class CompilerFeatureRequiredAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="CompilerFeatureRequiredAttribute"/> with the identifier of the syntax used.
|
||||
/// </summary>
|
||||
/// <param name="featureName">The name of the compiler feature.</param>
|
||||
public CompilerFeatureRequiredAttribute(string featureName)
|
||||
{
|
||||
FeatureName = featureName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The name of the compiler feature.
|
||||
/// </summary>
|
||||
public string FeatureName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// If true, the compiler can choose to allow access to the location where this attribute is applied if it does not understand <see cref="FeatureName"/>.
|
||||
/// </summary>
|
||||
public bool IsOptional { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="FeatureName"/> used for the ref structs C# feature.
|
||||
/// </summary>
|
||||
public const string RefStructs = nameof(RefStructs);
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="FeatureName"/> used for the required members C# feature.
|
||||
/// </summary>
|
||||
public const string RequiredMembers = nameof(RequiredMembers);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
namespace System.Runtime.CompilerServices;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that a type has required members or that a member is required.
|
||||
/// </summary>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Class |
|
||||
AttributeTargets.Struct |
|
||||
AttributeTargets.Field |
|
||||
AttributeTargets.Property,
|
||||
AllowMultiple = false,
|
||||
Inherited = false)]
|
||||
internal sealed class RequiredMemberAttribute : Attribute
|
||||
{
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the syntax used in a string.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
|
||||
internal sealed class StringSyntaxAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="StringSyntaxAttribute"/> with the identifier of the syntax used.
|
||||
/// </summary>
|
||||
/// <param name="syntax">The syntax identifier.</param>
|
||||
public StringSyntaxAttribute(string syntax)
|
||||
{
|
||||
Syntax = syntax;
|
||||
Arguments = Array.Empty<object?>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="StringSyntaxAttribute"/> with the identifier of the syntax used.
|
||||
/// </summary>
|
||||
/// <param name="syntax">The syntax identifier.</param>
|
||||
/// <param name="arguments">Optional arguments associated with the specific syntax employed.</param>
|
||||
public StringSyntaxAttribute(string syntax, params object?[] arguments)
|
||||
{
|
||||
Syntax = syntax;
|
||||
Arguments = arguments;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the identifier of the syntax used.
|
||||
/// </summary>
|
||||
public string Syntax { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Optional arguments associated with the specific syntax employed.
|
||||
/// </summary>
|
||||
public object?[] Arguments { get; }
|
||||
}
|
||||
-3
@@ -4,9 +4,6 @@ using ComputeSharp.D2D1.Extensions;
|
||||
using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Interop.Effects;
|
||||
|
||||
|
||||
-3
@@ -4,9 +4,6 @@ using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
|
||||
using ComputeSharp.D2D1.Shaders.Interop.Extensions;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Interop.Effects;
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@ using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
|
||||
using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Interop.Effects;
|
||||
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.CompilerServices;
|
||||
#if !NET6_OR_GREATER
|
||||
using System.Runtime.InteropServices;
|
||||
#endif
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Interop.Effects;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<#@ template debug="false" hostspecific="false" language="C#" #>
|
||||
<#@ template debug="false" hostspecific="false" language="C#" #>
|
||||
<#@ assembly name="System.Core" #>
|
||||
<#@ output extension=".g.cs"#>
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -7,9 +7,6 @@ using System.Runtime.InteropServices;
|
||||
#endif
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Interop.Effects;
|
||||
|
||||
|
||||
-3
@@ -2,9 +2,6 @@ using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
|
||||
|
||||
|
||||
-3
@@ -3,9 +3,6 @@ using System.Runtime.InteropServices;
|
||||
using ComputeSharp.D2D1.Shaders.Interop.Extensions;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
|
||||
|
||||
|
||||
-3
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
|
||||
|
||||
|
||||
-3
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
|
||||
|
||||
|
||||
-3
@@ -5,9 +5,6 @@ using System.Runtime.InteropServices;
|
||||
using ComputeSharp.D2D1.Extensions;
|
||||
using ComputeSharp.D2D1.Interop.Effects;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
|
||||
|
||||
|
||||
-3
@@ -1,9 +1,6 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ using TerraFX.Interop.Windows;
|
||||
using RuntimeHelpers = System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.D2D1.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.D2D1.Shaders.Translation;
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Collections.Generic\DictionaryExtensions.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Collections.Generic\QueueExtensions.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\MemberNotNullAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\RequiresUnreferencedCodeAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Enum.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\GC.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\IntPtrExtensions.cs" />
|
||||
@@ -21,9 +19,6 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Path.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\MemoryMarshal.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\RuntimeHelpers.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\UnmanagedCallersOnlyAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\InteropServices\NativeMemory.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\OSPlatformAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\SupportedOSPlatformAttribute.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,34 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies that the method or property will ensure that the listed field and property members have not-null values.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
|
||||
internal sealed class MemberNotNullAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes the attribute with a field or property member.
|
||||
/// </summary>
|
||||
/// <param name="member">The field or property member that is promised to be not-null.</param>
|
||||
public MemberNotNullAttribute(string member)
|
||||
{
|
||||
Members = new[] { member };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the attribute with the list of field and property members.
|
||||
/// </summary>
|
||||
/// <param name="members">The list of field and property members that are promised to be not-null.</param>
|
||||
public MemberNotNullAttribute(params string[] members)
|
||||
{
|
||||
Members = members;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets field or property member names.
|
||||
/// </summary>
|
||||
public string[] Members { get; }
|
||||
}
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
namespace System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the specified method requires dynamic access to code that is not referenced
|
||||
/// statically, for example through <see cref="System.Reflection"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This allows tools to understand which methods are unsafe to call when removing unreferenced
|
||||
/// code from an application.
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class, Inherited = false)]
|
||||
internal sealed class RequiresUnreferencedCodeAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RequiresUnreferencedCodeAttribute"/> class
|
||||
/// with the specified message.
|
||||
/// </summary>
|
||||
/// <param name="message">
|
||||
/// A message that contains information about the usage of unreferenced code.
|
||||
/// </param>
|
||||
public RequiresUnreferencedCodeAttribute(string message)
|
||||
{
|
||||
Message = message;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a message that contains information about the usage of unreferenced code.
|
||||
/// </summary>
|
||||
public string Message { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an optional URL that contains more information about the method,
|
||||
/// why it requires unreferenced code, and what options a consumer has to deal with it.
|
||||
/// </summary>
|
||||
public string? Url { get; set; }
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System;
|
||||
|
||||
#pragma warning disable CS0649
|
||||
|
||||
namespace ComputeSharp.NetStandard.System.Runtime.InteropServices; // This cannot be in System.Runtime.InteropServices, or Roslyn will recognize it
|
||||
|
||||
/// <summary>
|
||||
/// Any method marked with <see cref="UnmanagedCallersOnlyAttribute" /> can be directly called from native code.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This polyfill is deliberately in the wrong namespace to avoid the C# compiler failing to build below .NET 5.
|
||||
/// </remarks>
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
|
||||
internal sealed class UnmanagedCallersOnlyAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Optional. If omitted, the runtime will use the default platform calling convention.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Supplied types must be from the official "System.Runtime.CompilerServices" namespace and be of the form "CallConvXXX".
|
||||
/// </remarks>
|
||||
public Type[]? CallConvs;
|
||||
|
||||
/// <summary>
|
||||
/// Optional. If omitted, no named export is emitted during compilation.
|
||||
/// </summary>
|
||||
public string? EntryPoint;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace System.Runtime.Versioning;
|
||||
|
||||
/// <summary>
|
||||
/// Base type for all platform-specific API attributes.
|
||||
/// </summary>
|
||||
[Conditional("DEBUG")]
|
||||
internal abstract class OSPlatformAttribute : Attribute
|
||||
{
|
||||
private protected OSPlatformAttribute(string platformName)
|
||||
{
|
||||
PlatformName = platformName;
|
||||
}
|
||||
|
||||
public string PlatformName { get; }
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace System.Runtime.Versioning;
|
||||
|
||||
/// <summary>
|
||||
/// Records the operating system (and minimum version) that supports an API. Multiple
|
||||
/// attributes can be applied to indicate support on multiple operating systems.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Callers can apply a <see cref="SupportedOSPlatformAttribute " />
|
||||
/// or use guards to prevent calls to APIs on unsupported operating systems.
|
||||
/// A given platform should only be specified once.
|
||||
/// </remarks>
|
||||
[AttributeUsage(
|
||||
AttributeTargets.Assembly |
|
||||
AttributeTargets.Class |
|
||||
AttributeTargets.Constructor |
|
||||
AttributeTargets.Enum |
|
||||
AttributeTargets.Event |
|
||||
AttributeTargets.Field |
|
||||
AttributeTargets.Interface |
|
||||
AttributeTargets.Method |
|
||||
AttributeTargets.Module |
|
||||
AttributeTargets.Property |
|
||||
AttributeTargets.Struct,
|
||||
AllowMultiple = true,
|
||||
Inherited = false)]
|
||||
[Conditional("DEBUG")]
|
||||
internal sealed class SupportedOSPlatformAttribute : OSPlatformAttribute
|
||||
{
|
||||
public SupportedOSPlatformAttribute(string platformName)
|
||||
: base(platformName)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
@@ -17,7 +17,6 @@
|
||||
<!-- ComputeSharp.Core.SourceGenerator APIs -->
|
||||
|
||||
<!-- ComputeSharp.Core APIs -->
|
||||
<Compile Include="..\ComputeSharp.Core\Properties\Polyfills\UnscopedRefAttribute.cs" Link="ComputeSharp.Core\Properties\Polyfills\UnscopedRefAttribute.cs.cs" />
|
||||
<Compile Include="..\ComputeSharp.Core\Attributes\AutoConstructorAttribute.cs" Link="ComputeSharp.Core\Attributes\AutoConstructorAttribute.cs" />
|
||||
<Compile Include="..\ComputeSharp.Core\Exceptions\InvalidExecutionContextException.cs" Link="ComputeSharp.Core\Exceptions\InvalidExecutionContextException.cs" />
|
||||
<Compile Include="..\ComputeSharp.Core\Intrinsics\Attributes\HlslIntrinsicNameAttribute.cs" Link="ComputeSharp.Core\Intrinsics\Attributes\HlslIntrinsicNameAttribute.cs" />
|
||||
|
||||
@@ -19,7 +19,6 @@ using static TerraFX.Interop.Windows.STGTY;
|
||||
using RuntimeHelpers = System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.Graphics.Extensions;
|
||||
|
||||
@@ -19,7 +19,6 @@ using static TerraFX.Interop.Windows.STGTY;
|
||||
using RuntimeHelpers = System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp.Graphics.Extensions;
|
||||
|
||||
@@ -6,9 +6,6 @@ using ComputeSharp.Core.Extensions;
|
||||
using ComputeSharp.Interop;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
|
||||
@@ -12,9 +12,6 @@ using ComputeSharp.Graphics.Commands.Interop;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
using static TerraFX.Interop.DirectX.D3D12_COMMAND_LIST_TYPE;
|
||||
#if !NET6_0_OR_GREATER
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ using TerraFX.Interop.Windows;
|
||||
using RuntimeHelpers = System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
#else
|
||||
using RuntimeHelpers = ComputeSharp.NetStandard.System.Runtime.CompilerServices.RuntimeHelpers;
|
||||
using UnmanagedCallersOnlyAttribute = ComputeSharp.NetStandard.System.Runtime.InteropServices.UnmanagedCallersOnlyAttribute;
|
||||
#endif
|
||||
|
||||
#pragma warning disable CA1416
|
||||
|
||||
@@ -1,7 +1,30 @@
|
||||
<Project>
|
||||
<Import Project="..\Directory.Build.props" />
|
||||
|
||||
<!-- Reference NuGetizer to manage the packaging process -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NuGetizer" Version="0.9.1" PrivateAssets="all" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
Reference PolySharp for all .NET Standard 2.0 polyfills.
|
||||
Only needed for the .Core project and all source generators.
|
||||
-->
|
||||
<ItemGroup Condition="'$(MSBuildProjectName)' == 'ComputeSharp.Core' OR $(MSBuildProjectName.EndsWith('.SourceGenerators'))">
|
||||
<PackageReference Include="PolySharp" Version="1.10.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>build;analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Define the type alias for [UnmanagedCallersOnly] when on the .NET Standard 2.0 target -->
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
|
||||
<Using Include="System.Runtime.InteropServices2.UnmanagedCallersOnlyAttribute" Alias="UnmanagedCallersOnlyAttribute" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Configure PolySharp options -->
|
||||
<PropertyGroup>
|
||||
<PolySharpIncludeRuntimeSupportedAttributes>true</PolySharpIncludeRuntimeSupportedAttributes>
|
||||
<PolySharpUseInteropServices2NamespaceForUnmanagedCallersOnlyAttribute>true</PolySharpUseInteropServices2NamespaceForUnmanagedCallersOnlyAttribute>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -22,7 +22,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\src\ComputeSharp.Core\Properties\Polyfills\UnscopedRefAttribute.cs" Link="Properties\Polyfills\UnscopedRefAttribute.cs" />
|
||||
<Compile Include="..\ComputeSharp.Tests\Attributes\AdditionalDataAttribute.cs" Link="Attributes\AdditionalDataAttribute.cs" />
|
||||
<Compile Include="..\ComputeSharp.Tests\Attributes\AdditionalResourceAttribute.cs" Link="Attributes\AdditionalResourceAttribute.cs" />
|
||||
<Compile Include="..\ComputeSharp.Tests\Attributes\AllDevicesAttribute.cs" Link="Attributes\AllDevicesAttribute.cs" />
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
<Compile Include="..\..\samples\ComputeSharp.ImageProcessing\Processors\HlslBokehBlurProcessor{TPixel}.cs" Link="Imaging\Processors\HlslBokehBlurProcessor{TPixel}.cs" />
|
||||
<Compile Include="..\..\samples\ComputeSharp.ImageProcessing\Processors\HlslGaussianBlurProcessor.cs" Link="Imaging\Processors\HlslGaussianBlurProcessor.cs" />
|
||||
<Compile Include="..\..\samples\ComputeSharp.ImageProcessing\Processors\HlslGaussianBlurProcessor{TPixel}.cs" Link="Imaging\Processors\HlslGaussianBlurProcessor{TPixel}.cs" />
|
||||
<Compile Include="..\..\src\ComputeSharp.Core\Properties\Polyfills\UnscopedRefAttribute.cs" Link="Properties\Polyfills\UnscopedRefAttribute.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする