Minor code refactoring

このコミットが含まれているのは:
Sergio Pedri committed 2020-12-29 23:54:06 +01:00
1 親 c873762ef0
コミット d06e8fd3ed
6ファイル変更
+16 -10

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

@@ -13,7 +13,7 @@ namespace ComputeSharp.__Internals
/// <remarks>This attribute is not meant to be directly used by applications using ComputeSharp.</remarks>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This attribute is meant to be used from the source generator only")]
[Obsolete("This attribute is not intended to be used directly by user code")]
public sealed class IComputeShaderSourceAttribute : Attribute
{
/// <summary>
@@ -15,7 +15,7 @@ namespace ComputeSharp.__Internals
/// <remarks>This attribute is not meant to be directly used by applications using ComputeSharp.</remarks>
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This attribute is meant to be used from the source generator only")]
[Obsolete("This attribute is not intended to be used directly by user code")]
public sealed class ShaderMethodSourceAttribute : Attribute
{
/// <summary>
+7 -1
ファイルの表示
@@ -11,7 +11,7 @@ namespace ComputeSharp.__Internals
/// A helper class with some proxy methods to expose to generated code in external projects.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This type is meant to be used from the source generator only")]
[Obsolete("This type is not intended to be used directly by user code")]
public static class GraphicsResourceHelper
{
/// <summary>
@@ -19,6 +19,8 @@ namespace ComputeSharp.__Internals
/// </summary>
/// <param name="buffer">The input <see cref="Buffer{T}"/> instance to check.</param>
/// <param name="device">The target <see cref="GraphicsDevice"/> instance in use.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be called directly by user code")]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong ValidateAndGetGpuDescriptorHandle<T>(Buffer<T> buffer, GraphicsDevice device)
where T : unmanaged
@@ -34,6 +36,8 @@ namespace ComputeSharp.__Internals
/// </summary>
/// <param name="buffer">The input <see cref="Texture2D{T}"/> instance to check.</param>
/// <param name="device">The target <see cref="GraphicsDevice"/> instance in use.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be called directly by user code")]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong ValidateAndGetGpuDescriptorHandle<T>(Texture2D<T> buffer, GraphicsDevice device)
where T : unmanaged
@@ -49,6 +53,8 @@ namespace ComputeSharp.__Internals
/// </summary>
/// <param name="buffer">The input <see cref="Texture3D{T}"/> instance to check.</param>
/// <param name="device">The target <see cref="GraphicsDevice"/> instance in use.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be called directly by user code")]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static ulong ValidateAndGetGpuDescriptorHandle<T>(Texture3D<T> buffer, GraphicsDevice device)
where T : unmanaged
+3 -3
ファイルの表示
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
@@ -15,9 +15,9 @@
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\Attributes\AutoConstructorAttribute.cs" Link="Core\Attributes\AutoConstructorAttribute.cs" />
<Compile Include="..\ComputeSharp.Core\Attributes\IComputeShaderSourceAttribute.cs" Link="Core\Attributes\IComputeShaderSourceAttribute.cs" />
<Compile Include="..\ComputeSharp.Core\Attributes\ShaderMethodAttribute.cs" Link="Core\Attributes\ShaderMethodAttribute.cs" />
<Compile Include="..\ComputeSharp.Core\Attributes\ShaderMethodSourceAttribute.cs" Link="Core\Attributes\ShaderMethodSourceAttribute.cs" />
<Compile Include="..\ComputeSharp.Core\Attributes\__Internals\IComputeShaderSourceAttribute.cs" Link="Core\Attributes\__Internals\IComputeShaderSourceAttribute.cs" />
<Compile Include="..\ComputeSharp.Core\Attributes\__Internals\ShaderMethodSourceAttribute.cs" Link="Core\Attributes\__Internals\ShaderMethodSourceAttribute.cs" />
<Compile Include="..\ComputeSharp.Core\Exceptions\InvalidExecutionContextException.cs" Link="Core\Exceptions\InvalidExecutionContextException.cs" />
<Compile Include="..\ComputeSharp.Core\Exceptions\MissingMethodSourceException.cs" Link="Core\Exceptions\MissingMethodSourceException.cs" />
<Compile Include="..\ComputeSharp.Core\Extensions\MethodInfoExtensions.cs" Link="Core\Extensions\MethodInfoExtensions.cs" />
+2 -2
ファイルの表示
@@ -53,7 +53,7 @@ namespace ComputeSharp.SourceGenerators
// internal static partial class DispatchDataLoader
// {
// [System.ComponentModel.EditorBrowsable(EditorBrowsableState.Never)]
// [System.Obsolete("This method is intended for internal usage only")]
// [System.Obsolete("This method is not intended to be called directly by user code")]
// public static int LoadDispatchData(GraphicsDevice device, in ShaderType shader, ref ulong r0, ref byte r1)
// {
// ...
@@ -80,7 +80,7 @@ namespace ComputeSharp.SourceGenerators
Attribute(IdentifierName("Obsolete")).AddArgumentListArguments(
AttributeArgument(LiteralExpression(
SyntaxKind.StringLiteralExpression,
Literal("This method is intended for internal usage only"))))))).AddModifiers(
Literal("This method is not intended to be called directly by user code"))))))).AddModifiers(
Token(SyntaxKind.PublicKeyword),
Token(SyntaxKind.StaticKeyword)).AddParameterListParameters(
Parameter(Identifier("device")).WithType(IdentifierName("ComputeSharp.Graphics.GraphicsDevice")),
+2 -2
ファイルの表示
@@ -53,7 +53,7 @@ namespace ComputeSharp.SourceGenerators
// internal static partial class HashCodeProvider
// {
// [System.ComponentModel.EditorBrowsable(EditorBrowsableState.Never)]
// [System.Obsolete("This method is intended for internal usage only")]
// [System.Obsolete("This method is not intended to be called directly by user code")]
// public static int CombineHashCode(int hash, in ShaderType shader)
// {
// return ...;
@@ -79,7 +79,7 @@ namespace ComputeSharp.SourceGenerators
Attribute(IdentifierName("Obsolete")).AddArgumentListArguments(
AttributeArgument(LiteralExpression(
SyntaxKind.StringLiteralExpression,
Literal("This method is intended for internal usage only"))))))).AddModifiers(
Literal("This method is not intended to be called directly by user code"))))))).AddModifiers(
Token(SyntaxKind.PublicKeyword),
Token(SyntaxKind.StaticKeyword)).AddParameterListParameters(
Parameter(Identifier("hash")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))),