From 942d5bd3c56916ff4e77f26b5848e53023ce796a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 3 Apr 2022 19:45:40 +0200 Subject: [PATCH] Restore DIMs for private shader APIs --- .../Interfaces/__Internals/ID2D1Shader.cs | 18 +++++++- .../Core/Interfaces/__Internals/IShader.cs | 45 ++++++++++++++++--- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/src/ComputeSharp.D2D1Interop/Interfaces/__Internals/ID2D1Shader.cs b/src/ComputeSharp.D2D1Interop/Interfaces/__Internals/ID2D1Shader.cs index 1f607349..c7559db7 100644 --- a/src/ComputeSharp.D2D1Interop/Interfaces/__Internals/ID2D1Shader.cs +++ b/src/ComputeSharp.D2D1Interop/Interfaces/__Internals/ID2D1Shader.cs @@ -19,7 +19,14 @@ public interface ID2D1Shader [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be called directly by user code")] void LoadDispatchData(ref TLoader loader) - where TLoader : struct, ID2D1DispatchDataLoader; + where TLoader : struct, ID2D1DispatchDataLoader +#if NET6_0_OR_GREATER + { + throw new NotImplementedException(); + } +#else + ; +#endif /// /// Loads the bytecode for the current shader. @@ -30,5 +37,12 @@ public interface ID2D1Shader [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] void LoadBytecode(ref TLoader loader, out string hlslSource) - where TLoader : struct, ID2D1BytecodeLoader; + where TLoader : struct, ID2D1BytecodeLoader +#if NET6_0_OR_GREATER + { + throw new NotImplementedException(); + } +#else + ; +#endif } diff --git a/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs b/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs index 4fa1fb21..262b7d0d 100644 --- a/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs +++ b/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs @@ -16,7 +16,14 @@ public interface IShader /// The unique dispatch identifier for the shader. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] - int GetDispatchId(); + int GetDispatchId() +#if NET6_0_OR_GREATER + { + throw new NotImplementedException(); + } +#else + ; +#endif /// /// Loads the dispatch data for the shader. @@ -30,7 +37,14 @@ public interface IShader [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be called directly by user code")] void LoadDispatchData(ref TLoader loader, GraphicsDevice device, int x, int y, int z) - where TLoader : struct, IDispatchDataLoader; + where TLoader : struct, IDispatchDataLoader +#if NET6_0_OR_GREATER + { + throw new NotImplementedException(); + } +#else + ; +#endif /// /// Loads an opaque metadata handle from the metadata of the current shader. @@ -41,7 +55,14 @@ public interface IShader [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be called directly by user code")] void LoadDispatchMetadata(ref TLoader loader, out IntPtr result) - where TLoader : struct, IDispatchMetadataLoader; + where TLoader : struct, IDispatchMetadataLoader +#if NET6_0_OR_GREATER + { + throw new NotImplementedException(); + } +#else + ; +#endif /// /// Builds the HLSL source code for the current shader instance. @@ -52,7 +73,14 @@ public interface IShader /// The number of threads in each thread group for the Z axis. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be called directly by user code")] - void BuildHlslString(out ArrayPoolStringBuilder builder, int threadsX, int threadsY, int threadsZ); + void BuildHlslString(out ArrayPoolStringBuilder builder, int threadsX, int threadsY, int threadsZ) +#if NET6_0_OR_GREATER + { + throw new NotImplementedException(); + } +#else + ; +#endif /// /// Loads the bytecode for the current shader. @@ -65,5 +93,12 @@ public interface IShader [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] void LoadBytecode(ref TLoader loader, int threadsX, int threadsY, int threadsZ) - where TLoader : struct, IBytecodeLoader; + where TLoader : struct, IBytecodeLoader +#if NET6_0_OR_GREATER + { + throw new NotImplementedException(); + } +#else + ; +#endif }