From 9a3a33298fdbfe2410f3425ffca361bac3391ca7 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 12 Jul 2021 22:20:07 +0200 Subject: [PATCH] Minor code refactoring, removed unnecessary attributes --- .../__Internals/IDispatchDataLoader.cs | 4 ---- .../__Internals/IDispatchMetadataLoader.cs | 2 -- .../__Internals/GraphicsResourceHelper.cs | 18 ------------------ .../Interop/__Internals/ResourceDescriptor.cs | 2 -- .../__Internals/ArrayPoolStringBuilder.cs | 0 5 files changed, 26 deletions(-) rename src/ComputeSharp/Shaders/{Renderer => Translation}/__Internals/ArrayPoolStringBuilder.cs (100%) diff --git a/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchDataLoader.cs b/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchDataLoader.cs index c74fc4a7..29af4b67 100644 --- a/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchDataLoader.cs +++ b/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchDataLoader.cs @@ -14,16 +14,12 @@ namespace ComputeSharp.__Internals /// Loads the captured values used by the shader to be dispatched. /// /// The sequence of serialized captured values. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] void LoadCapturedValues(ReadOnlySpan data); /// /// Loads the captured resources used by the shader to be dispatched. /// /// The sequence of serialized resources. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] void LoadCapturedResources(ReadOnlySpan data); } } diff --git a/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchMetadataLoader.cs b/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchMetadataLoader.cs index 9095e60e..4ad4b3ce 100644 --- a/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchMetadataLoader.cs +++ b/src/ComputeSharp/Core/Interfaces/__Internals/IDispatchMetadataLoader.cs @@ -16,8 +16,6 @@ namespace ComputeSharp.__Internals /// The serialized metadata for the current shader. /// The sequence of resource descriptors for the current shader. /// The resulting opaque metadata handle. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] void LoadMetadataHandle(ReadOnlySpan serializedMetadata, ReadOnlySpan resourceDescriptors, out IntPtr result); } } diff --git a/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs b/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs index fdf9a066..17eaea5f 100644 --- a/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs +++ b/src/ComputeSharp/Graphics/Helpers/__Internals/GraphicsResourceHelper.cs @@ -34,8 +34,6 @@ namespace ComputeSharp.__Internals /// The input instance to check. /// The target instance in use. /// The GPU descriptor handle for the buffer. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong ValidateAndGetGpuDescriptorHandle(Buffer buffer, GraphicsDevice device) where T : unmanaged @@ -53,8 +51,6 @@ namespace ComputeSharp.__Internals /// The input instance to check. /// The target instance in use. /// The GPU descriptor handle for the texture. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong ValidateAndGetGpuDescriptorHandle(ReadOnlyTexture2D texture, GraphicsDevice device) where T : unmanaged @@ -72,8 +68,6 @@ namespace ComputeSharp.__Internals /// The input instance to check. /// The target instance in use. /// The GPU descriptor handle for the texture. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong ValidateAndGetGpuDescriptorHandle(ReadWriteTexture2D texture, GraphicsDevice device) where T : unmanaged @@ -91,8 +85,6 @@ namespace ComputeSharp.__Internals /// The input instance to check. /// The target instance in use. /// The GPU descriptor handle for the texture. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadOnlyTexture2D texture, GraphicsDevice device) where TPixel : unmanaged @@ -114,8 +106,6 @@ namespace ComputeSharp.__Internals /// The input instance to check. /// The target instance in use. /// The GPU descriptor handle for the texture. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadWriteTexture2D texture, GraphicsDevice device) where TPixel : unmanaged @@ -137,8 +127,6 @@ namespace ComputeSharp.__Internals /// The input instance to check. /// The target instance in use. /// The GPU descriptor handle for the texture. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong ValidateAndGetGpuDescriptorHandle(ReadOnlyTexture3D texture, GraphicsDevice device) where T : unmanaged @@ -156,8 +144,6 @@ namespace ComputeSharp.__Internals /// The input instance to check. /// The target instance in use. /// The GPU descriptor handle for the texture. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static ulong ValidateAndGetGpuDescriptorHandle(ReadWriteTexture3D texture, GraphicsDevice device) where T : unmanaged @@ -175,8 +161,6 @@ namespace ComputeSharp.__Internals /// The input instance to check. /// The target instance in use. /// The GPU descriptor handle for the texture. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadOnlyTexture3D texture, GraphicsDevice device) where TPixel : unmanaged @@ -198,8 +182,6 @@ namespace ComputeSharp.__Internals /// The input instance to check. /// The target instance in use. /// The GPU descriptor handle for the texture. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static unsafe ulong ValidateAndGetGpuDescriptorHandle(IReadWriteTexture3D texture, GraphicsDevice device) where TPixel : unmanaged diff --git a/src/ComputeSharp/Graphics/Resources/Interop/__Internals/ResourceDescriptor.cs b/src/ComputeSharp/Graphics/Resources/Interop/__Internals/ResourceDescriptor.cs index 6b2d9422..fbe2853f 100644 --- a/src/ComputeSharp/Graphics/Resources/Interop/__Internals/ResourceDescriptor.cs +++ b/src/ComputeSharp/Graphics/Resources/Interop/__Internals/ResourceDescriptor.cs @@ -39,8 +39,6 @@ namespace ComputeSharp.__Internals /// The type of resource to create the descriptor for. /// The offset in the resource from the start of the shader mapping. /// The resulting instance. - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This method is not intended to be called directly by user code")] public static void Create(int type, uint offset, out ResourceDescriptor descriptor) { descriptor.RangeType = (D3D12_DESCRIPTOR_RANGE_TYPE)type; diff --git a/src/ComputeSharp/Shaders/Renderer/__Internals/ArrayPoolStringBuilder.cs b/src/ComputeSharp/Shaders/Translation/__Internals/ArrayPoolStringBuilder.cs similarity index 100% rename from src/ComputeSharp/Shaders/Renderer/__Internals/ArrayPoolStringBuilder.cs rename to src/ComputeSharp/Shaders/Translation/__Internals/ArrayPoolStringBuilder.cs