Add D2D1 shader interfaces

このコミットが含まれているのは:
Sergio Pedri committed 2022-04-24 21:03:13 +02:00
1 親 8aa6a5936a
コミット 4f6c0f2d82
5ファイル変更
+116 -40

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

+18
ファイルの表示
@@ -0,0 +1,18 @@
using ComputeSharp.D2D1Interop.__Internals;
#pragma warning disable CS0618
namespace ComputeSharp.D2D1Interop;
/// <summary>
/// An <see langword="interface"/> representing a pixel shader.
/// </summary>
public interface IPixelShader<TPixel> : ID2D1Shader
where TPixel : unmanaged
{
/// <summary>
/// Executes the current pixel shader.
/// </summary>
/// <returns>The pixel value for the current invocation.</returns>
TPixel Execute();
}
+26
ファイルの表示
@@ -0,0 +1,26 @@
using System;
using System.ComponentModel;
namespace ComputeSharp.__Internals;
/// <summary>
/// A base <see langword="interface"/> representing a bytecode loader for a D2D1 shader.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This interface is not intended to be used directly by user code")]
public interface ID2D1BytecodeLoader
{
/// <summary>
/// Loads a dynamic shader bytecode.
/// </summary>
/// <param name="handle">An opaque handle to the shader bytecode.</param>
/// <exception cref="InvalidOperationException">Thrown if the shader has already been initialized.</exception>
void LoadDynamicBytecode(IntPtr handle);
/// <summary>
/// Loads the embedded shader bytecode for the shader.
/// </summary>
/// <param name="bytecode">The shader bytecode.</param>
/// <exception cref="InvalidOperationException">Thrown if the shader has already been initialized.</exception>
void LoadEmbeddedBytecode(ReadOnlySpan<byte> bytecode);
}
+18
ファイルの表示
@@ -0,0 +1,18 @@
using System;
using System.ComponentModel;
namespace ComputeSharp.__Internals;
/// <summary>
/// A base <see langword="interface"/> representing a data loader for a D2D1 shader being dispatched.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This interface is not intended to be used directly by user code")]
public interface ID2D1DispatchDataLoader
{
/// <summary>
/// Loads the captured values used by the D2D1 shader to be dispatched.
/// </summary>
/// <param name="data">The sequence of serialized captured values.</param>
void LoadConstantBuffer(ReadOnlySpan<uint> data);
}
+49
ファイルの表示
@@ -0,0 +1,49 @@
using System;
using System.ComponentModel;
using ComputeSharp.__Internals;
namespace ComputeSharp.D2D1Interop.__Internals;
/// <summary>
/// A base <see langword="interface"/> representing a given shader that can be dispatched.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This interface is not intended to be used directly by user code")]
public interface ID2D1Shader
{
/// <summary>
/// Gets a unique dispatch identifier for the shader.
/// </summary>
/// <returns>The unique dispatch identifier for the shader.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be used directly by user code")]
int GetDispatchId();
/// <summary>
/// Loads the dispatch data for the shader.
/// </summary>
/// <typeparam name="TLoader">The type of data loader being used.</typeparam>
/// <param name="loader">The <typeparamref name="TLoader"/> instance to use to load the data.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be called directly by user code")]
void LoadDispatchData<TLoader>(ref TLoader loader)
where TLoader : struct, ID2D1DispatchDataLoader;
/// <summary>
/// Builds the HLSL source code for the current shader instance.
/// </summary>
/// <param name="builder">The resulting <see cref="ArrayPoolStringBuilder"/> instance containing the HLSL source.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be called directly by user code")]
void BuildHlslString(out ArrayPoolStringBuilder builder);
/// <summary>
/// Loads the bytecode for the current shader.
/// </summary>
/// <typeparam name="TLoader">The type of bytecode loader being used.</typeparam>
/// <param name="loader">The <typeparamref name="TLoader"/> instance to use to load the bytecode.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be used directly by user code")]
void LoadBytecode<TLoader>(ref TLoader loader)
where TLoader : struct, ID2D1BytecodeLoader;
}
+5 -40
ファイルの表示
@@ -16,14 +16,7 @@ public interface IShader
/// <returns>The unique dispatch identifier for the shader.</returns>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be used directly by user code")]
int GetDispatchId()
#if NET6_0_OR_GREATER
{
throw new NotImplementedException();
}
#else
;
#endif
int GetDispatchId();
/// <summary>
/// Loads the dispatch data for the shader.
@@ -37,14 +30,7 @@ public interface IShader
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be called directly by user code")]
void LoadDispatchData<TLoader>(ref TLoader loader, GraphicsDevice device, int x, int y, int z)
where TLoader : struct, IDispatchDataLoader
#if NET6_0_OR_GREATER
{
throw new NotImplementedException();
}
#else
;
#endif
where TLoader : struct, IDispatchDataLoader;
/// <summary>
/// Loads an opaque metadata handle from the metadata of the current shader.
@@ -55,14 +41,7 @@ public interface IShader
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be called directly by user code")]
void LoadDispatchMetadata<TLoader>(ref TLoader loader, out IntPtr result)
where TLoader : struct, IDispatchMetadataLoader
#if NET6_0_OR_GREATER
{
throw new NotImplementedException();
}
#else
;
#endif
where TLoader : struct, IDispatchMetadataLoader;
/// <summary>
/// Builds the HLSL source code for the current shader instance.
@@ -73,14 +52,7 @@ public interface IShader
/// <param name="threadsZ">The number of threads in each thread group for the Z axis.</param>
[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)
#if NET6_0_OR_GREATER
{
throw new NotImplementedException();
}
#else
;
#endif
void BuildHlslString(out ArrayPoolStringBuilder builder, int threadsX, int threadsY, int threadsZ);
/// <summary>
/// Loads the bytecode for the current shader.
@@ -93,12 +65,5 @@ public interface IShader
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be used directly by user code")]
void LoadBytecode<TLoader>(ref TLoader loader, int threadsX, int threadsY, int threadsZ)
where TLoader : struct, IBytecodeLoader
#if NET6_0_OR_GREATER
{
throw new NotImplementedException();
}
#else
;
#endif
where TLoader : struct, IBytecodeLoader;
}