using System; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using ComputeSharp.D2D1.Interop; namespace ComputeSharp.D2D1.__Internals; /// /// A base representing a given shader that can be dispatched. /// [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This interface is not intended to be used directly by user code")] public interface ID2D1Shader { /// /// Gets the effect id of the D2D effect using this shader. /// /// /// This only applies to effects created from . /// ref readonly Guid EffectId { get; } /// /// Gets the display name of the D2D effect using this shader, if specified. /// /// /// This only applies to effects created from . /// string? EffectDisplayName { get; } /// /// Gets the description of the D2D effect using this shader, if specified. /// /// /// This only applies to effects created from . /// string? EffectDescription { get; } /// /// Gets the category of the D2D effect using this shader, if specified. /// /// /// This only applies to effects created from . /// string? EffectCategory { get; } /// /// Gets the author of the D2D effect using this shader, if specified. /// /// /// This only applies to effects created from . /// string? EffectAuthor { get; } /// /// Initializes the current shader from a buffer with the serialized dispatch data. /// /// The input buffer with the serialized dispatch data. /// The input buffer must be retrieved from . [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be called directly by user code")] void InitializeFromDispatchData(ReadOnlySpan data); /// /// Gets the pixel options for the current shader. /// [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] D2D1PixelOptions PixelOptions { get; } /// /// Gets the number of inputs for the current shader. /// /// The number of inputs for the current shader. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] uint GetInputCount(); /// /// Gets the input types for the current shader. /// [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] ReadOnlyMemory InputTypes { get; } /// /// Gets the input descriptions for the current shader. /// [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] ReadOnlyMemory InputDescriptions { get; } /// /// Gets the resource texture descriptions for the shader. /// [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] ReadOnlyMemory ResourceTextureDescriptions { get; } /// /// Gets the buffer precision for the shader. /// [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] D2D1BufferPrecision BufferPrecision { get; } /// /// Gets the output buffer precision and depth for the shader. /// /// The output buffer precision. /// The output buffer channel depth. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] void GetOutputBuffer(out uint precision, out uint depth); /// /// Loads the dispatch data for the shader. /// /// The type of data loader being used. /// The instance to use to load the data. [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; /// /// Builds the HLSL source code for the current shader instance. /// /// The resulting HLSL source. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be called directly by user code")] void BuildHlslSource(out string hlslSource); /// /// Loads the bytecode for the current shader. /// /// The type of bytecode loader being used. /// The instance to use to load the bytecode. /// The shader profile to use to get the shader bytecode (if , the precompiled shader will be used). /// The compile options to use to get the shader bytecode (if , the precompiled shader will be used). /// Thrown if a precompiled bytecode was requested ( is ), but it wasn't availablle. /// When this method returns, and will be set to the effective laues used to create the shader bytecode that was loaded. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] void LoadBytecode(ref TLoader loader, [NotNull] ref D2D1ShaderProfile? shaderProfile, [NotNull] ref D2D1CompileOptions? compileOptions) where TLoader : struct, ID2D1BytecodeLoader; }