// Generated API outline. Implementation bodies omitted. #nullable enable using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Net.Http; using System.Threading.Tasks; using System.Threading; using System; using nfloat = System.Runtime.InteropServices.NFloat; using static Xui.Core.Math2D.Constants; namespace Xui.GPU.Shaders.Types { /// /// Represents texture sampling addressing modes. /// public enum AddressMode { /// /// Texture coordinates wrap at the boundaries (repeat). /// Repeat, /// /// Texture coordinates are clamped to the edge. /// ClampToEdge, /// /// Texture coordinates mirror at the boundaries. /// MirroredRepeat, /// /// Texture coordinates outside [0, 1] return a border color. /// ClampToBorder, } /// /// Shader boolean type. /// public readonly struct Bool { /// /// Initializes a new instance of the struct. /// /// The bool value. public Bool(bool value); /// /// Gets the false constant. /// public static Bool False { get; } /// /// Gets the true constant. /// public static Bool True { get; } /// /// Converts from bool to Bool. /// public static implicit operator Bool(bool value); /// /// Converts from Bool to bool. /// public static implicit operator bool (Bool value); /// /// Tests equality of two Bool values. /// public static Bool operator ==(Bool left, Bool right); /// /// Tests inequality of two Bool values. /// public static Bool operator !=(Bool left, Bool right); /// /// Performs logical AND of two Bool values. /// public static Bool operator &(Bool left, Bool right); /// /// Performs logical OR of two Bool values. /// public static Bool operator |(Bool left, Bool right); /// /// Performs logical NOT of a Bool value. /// public static Bool operator !(Bool value); /// Indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// /// if and this instance are the same type and represent the same value; otherwise, . public override bool Equals(object? obj); /// Returns the hash code for this instance. /// A 32-bit signed integer that is the hash code for this instance. public override int GetHashCode(); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } /// /// A 4-component RGBA color value. /// public struct Color4 { /// /// The red component. /// public F32 R; /// /// The green component. /// public F32 G; /// /// The blue component. /// public F32 B; /// /// The alpha component. /// public F32 A; /// /// Initializes a new instance of the struct. /// public Color4(F32 r, F32 g, F32 b, F32 a); /// /// Initializes a new instance from RGB values with alpha set to 1. /// public Color4(F32 r, F32 g, F32 b); /// /// Gets a white color (1, 1, 1, 1). /// public static Color4 White { get; } /// /// Gets a black color (0, 0, 0, 1). /// public static Color4 Black { get; } /// /// Gets a transparent color (0, 0, 0, 0). /// public static Color4 Transparent { get; } /// Adds color components without clamping. public static Color4 operator +(Color4 a, Color4 b); /// /// Multiplies two colors component-wise. /// public static Color4 operator *(Color4 left, Color4 right); /// /// Multiplies a color by a scalar. /// public static Color4 operator *(Color4 left, F32 right); /// /// Implicitly converts from to . /// public static implicit operator Color4(Xui.Core.Canvas.Color color); /// /// Implicitly converts a packed 32-bit RGBA value (0xRRGGBBAA) to a . /// Compatible with Xui.Core.Canvas.Colors web color constants. /// public static implicit operator Color4(uint rgba); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } /// /// Shader 32-bit floating-point scalar type. /// This is the fundamental scalar type for shader math operations. /// /// /// In CPU execution, this may be represented as a single float (in vertex stage) /// or as a quad of floats (in fragment stage for derivative support). /// public readonly struct F32 { /// /// Initializes a new instance of the struct. /// /// The float value. public F32(float value); /// /// Gets the zero constant. /// public static F32 Zero { get; } /// /// Gets the one constant. /// public static F32 One { get; } /// /// Converts from float to F32. /// public static implicit operator F32(float value); /// /// Converts from double to F32 (narrowing). /// public static implicit operator F32(double value); /// /// Converts from nfloat to F32. /// public static implicit operator F32(nfloat value); /// /// Converts from F32 to float. /// public static implicit operator float (F32 value); /// /// Converts from F32 to double. /// public static implicit operator double (F32 value); /// /// Converts from F32 to nfloat. /// public static implicit operator nfloat(F32 value); /// /// Adds two F32 values. /// public static F32 operator +(F32 left, F32 right); /// /// Subtracts two F32 values. /// public static F32 operator -(F32 left, F32 right); /// /// Multiplies two F32 values. /// public static F32 operator *(F32 left, F32 right); /// /// Divides two F32 values. /// public static F32 operator /(F32 left, F32 right); /// /// Negates an F32 value. /// public static F32 operator -(F32 value); /// /// Tests equality of two F32 values. /// public static Bool operator ==(F32 left, F32 right); /// /// Tests inequality of two F32 values. /// public static Bool operator !=(F32 left, F32 right); /// /// Tests if left is less than right. /// public static Bool operator <(F32 left, F32 right); /// /// Tests if left is greater than right. /// public static Bool operator>(F32 left, F32 right); /// /// Tests if left is less than or equal to right. /// public static Bool operator <=(F32 left, F32 right); /// /// Tests if left is greater than or equal to right. /// public static Bool operator >=(F32 left, F32 right); /// Indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// /// if and this instance are the same type and represent the same value; otherwise, . public override bool Equals(object? obj); /// Returns the hash code for this instance. /// A 32-bit signed integer that is the hash code for this instance. public override int GetHashCode(); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } /// /// Represents texture sampling filter modes. /// public enum FilterMode { /// /// Point (nearest neighbor) sampling. /// Point, /// /// Linear (bilinear) sampling. /// Linear, } /// /// A 2-component vector of 32-bit floats. /// public struct Float2 { /// /// The X component. /// public F32 X; /// /// The Y component. /// public F32 Y; /// /// Initializes a new instance of the struct. /// public Float2(F32 x, F32 y); /// /// Initializes a new instance with both components set to the same value. /// public Float2(F32 value); /// /// Gets the zero vector. /// public static Float2 Zero { get; } /// /// Gets the one vector. /// public static Float2 One { get; } /// /// Adds two vectors. /// public static Float2 operator +(Float2 left, Float2 right); /// /// Subtracts two vectors. /// public static Float2 operator -(Float2 left, Float2 right); /// /// Multiplies two vectors component-wise. /// public static Float2 operator *(Float2 left, Float2 right); /// /// Multiplies a vector by a scalar. /// public static Float2 operator *(Float2 left, F32 right); /// /// Multiplies a scalar by a vector. /// public static Float2 operator *(F32 left, Float2 right); /// /// Divides two vectors component-wise. /// public static Float2 operator /(Float2 left, Float2 right); /// /// Divides a vector by a scalar. /// public static Float2 operator /(Float2 left, F32 right); /// /// Negates a vector. /// public static Float2 operator -(Float2 value); /// /// Gets the XX swizzle (X, X). /// public readonly Float2 XX { get; } /// /// Gets the XY swizzle (X, Y). /// public readonly Float2 XY { get; } /// /// Gets the YX swizzle (Y, X). /// public readonly Float2 YX { get; } /// /// Gets the YY swizzle (Y, Y). /// public readonly Float2 YY { get; } /// /// Implicitly converts from to . /// public static implicit operator Float2(Xui.Core.Math2D.Point point); /// /// Implicitly converts from to . /// public static implicit operator Float2(Xui.Core.Math2D.Vector vector); /// /// Implicitly converts from to . /// public static implicit operator Float2(Xui.Core.Math2D.Size size); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } /// /// A 3-component vector of 32-bit floats. /// public struct Float3 { /// /// The X component. /// public F32 X; /// /// The Y component. /// public F32 Y; /// /// The Z component. /// public F32 Z; /// /// Initializes a new instance of the struct. /// public Float3(F32 x, F32 y, F32 z); /// /// Initializes a new instance with all components set to the same value. /// public Float3(F32 value); /// /// Gets the zero vector. /// public static Float3 Zero { get; } /// /// Gets the one vector. /// public static Float3 One { get; } /// /// Adds two vectors. /// public static Float3 operator +(Float3 left, Float3 right); /// /// Subtracts two vectors. /// public static Float3 operator -(Float3 left, Float3 right); /// /// Multiplies two vectors component-wise. /// public static Float3 operator *(Float3 left, Float3 right); /// /// Multiplies a vector by a scalar. /// public static Float3 operator *(Float3 left, F32 right); /// /// Multiplies a scalar by a vector. /// public static Float3 operator *(F32 left, Float3 right); /// /// Divides two vectors component-wise. /// public static Float3 operator /(Float3 left, Float3 right); /// /// Divides a vector by a scalar. /// public static Float3 operator /(Float3 left, F32 right); /// /// Negates a vector. /// public static Float3 operator -(Float3 value); /// /// Computes the cross product of two vectors. /// public static Float3 Cross(Float3 a, Float3 b); /// /// Normalizes the vector to unit length. /// public static Float3 Normalize(Float3 v); /// /// Gets the XY swizzle (X, Y). /// public readonly Float2 XY { get; } /// /// Gets the XZ swizzle (X, Z). /// public readonly Float2 XZ { get; } /// /// Gets the YX swizzle (Y, X). /// public readonly Float2 YX { get; } /// /// Gets the YZ swizzle (Y, Z). /// public readonly Float2 YZ { get; } /// /// Gets the ZX swizzle (Z, X). /// public readonly Float2 ZX { get; } /// /// Gets the ZY swizzle (Z, Y). /// public readonly Float2 ZY { get; } /// /// Gets the XYZ swizzle (X, Y, Z). /// public readonly Float3 XYZ { get; } /// /// Gets the XZY swizzle (X, Z, Y). /// public readonly Float3 XZY { get; } /// /// Gets the YXZ swizzle (Y, X, Z). /// public readonly Float3 YXZ { get; } /// /// Gets the YZX swizzle (Y, Z, X). /// public readonly Float3 YZX { get; } /// /// Gets the ZXY swizzle (Z, X, Y). /// public readonly Float3 ZXY { get; } /// /// Gets the ZYX swizzle (Z, Y, X). /// public readonly Float3 ZYX { get; } /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } /// /// A 4-component vector of 32-bit floats. /// public struct Float4 { /// /// The X component. /// public F32 X; /// /// The Y component. /// public F32 Y; /// /// The Z component. /// public F32 Z; /// /// The W component. /// public F32 W; /// /// Initializes a new instance of the struct. /// public Float4(F32 x, F32 y, F32 z, F32 w); /// /// Initializes a new instance from a Float2 and z, w components. /// public Float4(Float2 xy, F32 z, F32 w); /// /// Initializes a new instance from a Float3 and w component. /// public Float4(Float3 xyz, F32 w); /// /// Initializes a new instance with all components set to the same value. /// public Float4(F32 value); /// /// Gets the zero vector. /// public static Float4 Zero { get; } /// /// Gets the one vector. /// public static Float4 One { get; } /// /// Adds two vectors. /// public static Float4 operator +(Float4 left, Float4 right); /// /// Subtracts two vectors. /// public static Float4 operator -(Float4 left, Float4 right); /// /// Multiplies two vectors component-wise. /// public static Float4 operator *(Float4 left, Float4 right); /// /// Multiplies a vector by a scalar. /// public static Float4 operator *(Float4 left, F32 right); /// /// Multiplies a scalar by a vector. /// public static Float4 operator *(F32 left, Float4 right); /// /// Divides two vectors component-wise. /// public static Float4 operator /(Float4 left, Float4 right); /// /// Divides a vector by a scalar. /// public static Float4 operator /(Float4 left, F32 right); /// /// Negates a vector. /// public static Float4 operator -(Float4 value); /// /// Gets the XY swizzle (X, Y). /// public readonly Float2 XY { get; } /// /// Gets the XZ swizzle (X, Z). /// public readonly Float2 XZ { get; } /// /// Gets the XW swizzle (X, W). /// public readonly Float2 XW { get; } /// /// Gets the YZ swizzle (Y, Z). /// public readonly Float2 YZ { get; } /// /// Gets the YW swizzle (Y, W). /// public readonly Float2 YW { get; } /// /// Gets the ZW swizzle (Z, W). /// public readonly Float2 ZW { get; } /// /// Gets the XYZ swizzle (X, Y, Z). /// public readonly Float3 XYZ { get; } /// /// Gets the XYW swizzle (X, Y, W). /// public readonly Float3 XYW { get; } /// /// Gets the XZW swizzle (X, Z, W). /// public readonly Float3 XZW { get; } /// /// Gets the YZW swizzle (Y, Z, W). /// public readonly Float3 YZW { get; } /// /// Gets the RGB swizzle (X, Y, Z) - color alias for XYZ. /// public readonly Float3 RGB { get; } /// /// Gets the XYZW swizzle (X, Y, Z, W). /// public readonly Float4 XYZW { get; } /// /// Gets the RGBA swizzle (X, Y, Z, W) - color alias for XYZW. /// public readonly Float4 RGBA { get; } /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } /// /// A 4x4 matrix of 32-bit floats. /// Used for transformations in shader code. /// public struct Float4x4 { /// /// First row of the matrix. /// public Float4 Row0; /// /// Second row of the matrix. /// public Float4 Row1; /// /// Third row of the matrix. /// public Float4 Row2; /// /// Fourth row of the matrix. /// public Float4 Row3; /// /// Initializes a new instance of the struct. /// public Float4x4(Float4 row0, Float4 row1, Float4 row2, Float4 row3); /// /// Gets the identity matrix. /// public static Float4x4 Identity { get; } /// /// Multiplies a matrix by a vector. /// public static Float4 operator *(Float4x4 matrix, Float4 vector); /// /// Multiplies two matrices. /// public static Float4x4 operator *(Float4x4 left, Float4x4 right); /// /// Creates a translation matrix. /// public static Float4x4 CreateTranslation(F32 x, F32 y, F32 z); /// /// Creates a rotation matrix around the X axis. /// public static Float4x4 CreateRotationX(F32 angle); /// /// Creates a rotation matrix around the Y axis. /// public static Float4x4 CreateRotationY(F32 angle); /// /// Creates a rotation matrix around the Z axis. /// public static Float4x4 CreateRotationZ(F32 angle); /// /// Creates a perspective projection matrix. /// /// Field of view in the Y direction (in radians). /// Aspect ratio (width / height). /// Near clipping plane distance. /// Far clipping plane distance. /// /// This uses a [0, 1] depth range (DirectX/Vulkan style) instead of OpenGL's [-1, 1]. /// The matrix maps the near plane to NDC Z = 0 and far plane to NDC Z = 1. /// public static Float4x4 CreatePerspective(F32 fovY, F32 aspectRatio, F32 nearPlane, F32 farPlane); /// /// Creates a view matrix (look-at matrix). /// public static Float4x4 CreateLookAt(Float3 eye, Float3 target, Float3 up); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } /// /// Shader 32-bit signed integer scalar type. /// public readonly struct I32 { /// /// Initializes a new instance of the struct. /// /// The int value. public I32(int value); /// /// Gets the zero constant. /// public static I32 Zero { get; } /// /// Gets the one constant. /// public static I32 One { get; } /// /// Converts from int to I32. /// public static implicit operator I32(int value); /// /// Converts from I32 to int. /// public static implicit operator int (I32 value); /// /// Adds two I32 values. /// public static I32 operator +(I32 left, I32 right); /// /// Subtracts two I32 values. /// public static I32 operator -(I32 left, I32 right); /// /// Multiplies two I32 values. /// public static I32 operator *(I32 left, I32 right); /// /// Divides two I32 values. /// public static I32 operator /(I32 left, I32 right); /// /// Negates an I32 value. /// public static I32 operator -(I32 value); /// /// Tests equality of two I32 values. /// public static Bool operator ==(I32 left, I32 right); /// /// Tests inequality of two I32 values. /// public static Bool operator !=(I32 left, I32 right); /// /// Tests if left is less than right. /// public static Bool operator <(I32 left, I32 right); /// /// Tests if left is greater than right. /// public static Bool operator>(I32 left, I32 right); /// /// Tests if left is less than or equal to right. /// public static Bool operator <=(I32 left, I32 right); /// /// Tests if left is greater than or equal to right. /// public static Bool operator >=(I32 left, I32 right); /// /// Performs bitwise AND of two I32 values. /// public static I32 operator &(I32 left, I32 right); /// /// Performs bitwise OR of two I32 values. /// public static I32 operator |(I32 left, I32 right); /// /// Performs bitwise XOR of two I32 values. /// public static I32 operator ^(I32 left, I32 right); /// /// Performs bitwise NOT of an I32 value. /// public static I32 operator ~(I32 value); /// /// Left shifts an I32 value. /// public static I32 operator <<(I32 left, int right); /// /// Right shifts an I32 value. /// public static I32 operator >>(I32 left, int right); /// Indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// /// if and this instance are the same type and represent the same value; otherwise, . public override bool Equals(object? obj); /// Returns the hash code for this instance. /// A 32-bit signed integer that is the hash code for this instance. public override int GetHashCode(); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } /// CPU implementation of a shader texture resource; pixel storage belongs to the renderer. /// Pixel result type. public interface ISampledTexture where TPixel : unmanaged { /// Samples normalized coordinates at an explicit mip level. TPixel Sample(Sampler sampler, Float2 uv, F32 level); } /// /// A 2-component vector of 32-bit signed integers. /// public struct Int2 { /// /// The X component. /// public I32 X; /// /// The Y component. /// public I32 Y; /// /// Initializes a new instance of the struct. /// public Int2(I32 x, I32 y); /// /// Initializes a new instance with both components set to the same value. /// public Int2(I32 value); /// /// Gets the zero vector. /// public static Int2 Zero { get; } /// /// Gets the one vector. /// public static Int2 One { get; } /// /// Adds two vectors. /// public static Int2 operator +(Int2 left, Int2 right); /// /// Subtracts two vectors. /// public static Int2 operator -(Int2 left, Int2 right); /// /// Multiplies two vectors component-wise. /// public static Int2 operator *(Int2 left, Int2 right); /// /// Multiplies a vector by a scalar. /// public static Int2 operator *(Int2 left, I32 right); /// /// Multiplies a scalar by a vector. /// public static Int2 operator *(I32 left, Int2 right); /// /// Divides two vectors component-wise. /// public static Int2 operator /(Int2 left, Int2 right); /// /// Divides a vector by a scalar. /// public static Int2 operator /(Int2 left, I32 right); /// /// Negates a vector. /// public static Int2 operator -(Int2 value); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } /// /// Represents a texture sampler that controls how textures are sampled. /// /// /// Samplers define the filtering and addressing behavior when reading from textures. /// public readonly struct Sampler { /// /// Gets the minification filter mode. /// public FilterMode MinFilter { get; init; } /// /// Gets the magnification filter mode. /// public FilterMode MagFilter { get; init; } /// /// Gets the addressing mode for the U coordinate. /// public AddressMode AddressU { get; init; } /// /// Gets the addressing mode for the V coordinate. /// public AddressMode AddressV { get; init; } /// /// Initializes a new instance of the struct. /// public Sampler(FilterMode minFilter = FilterMode.Linear, FilterMode magFilter = FilterMode.Linear, AddressMode addressU = AddressMode.Repeat, AddressMode addressV = AddressMode.Repeat); /// /// Gets a default linear sampler with repeat addressing. /// public static Sampler LinearRepeat { get; } /// /// Gets a default linear sampler with clamp-to-edge addressing. /// public static Sampler LinearClamp { get; } /// /// Gets a default point sampler with repeat addressing. /// public static Sampler PointRepeat { get; } /// /// Gets a default point sampler with clamp-to-edge addressing. /// public static Sampler PointClamp { get; } } /// /// Represents a 2D texture resource in shader code. /// /// The pixel format type (typically Color4). /// /// In CPU execution, this wraps actual texture data. /// In GPU execution, this will be translated to the appropriate backend texture type. /// public readonly struct Texture2D where TPixel : unmanaged { /// /// Initializes a new instance of the struct. /// /// The underlying texture data (implementation-specific). public Texture2D(object? data); } /// /// Shader 32-bit unsigned integer scalar type. /// public readonly struct U32 { /// /// Initializes a new instance of the struct. /// /// The uint value. public U32(uint value); /// /// Gets the zero constant. /// public static U32 Zero { get; } /// /// Gets the one constant. /// public static U32 One { get; } /// /// Converts from uint to U32. /// public static implicit operator U32(uint value); /// /// Converts from U32 to uint. /// public static implicit operator uint (U32 value); /// /// Adds two U32 values. /// public static U32 operator +(U32 left, U32 right); /// /// Subtracts two U32 values. /// public static U32 operator -(U32 left, U32 right); /// /// Multiplies two U32 values. /// public static U32 operator *(U32 left, U32 right); /// /// Divides two U32 values. /// public static U32 operator /(U32 left, U32 right); /// /// Tests equality of two U32 values. /// public static Bool operator ==(U32 left, U32 right); /// /// Tests inequality of two U32 values. /// public static Bool operator !=(U32 left, U32 right); /// /// Tests if left is less than right. /// public static Bool operator <(U32 left, U32 right); /// /// Tests if left is greater than right. /// public static Bool operator>(U32 left, U32 right); /// /// Tests if left is less than or equal to right. /// public static Bool operator <=(U32 left, U32 right); /// /// Tests if left is greater than or equal to right. /// public static Bool operator >=(U32 left, U32 right); /// /// Performs bitwise AND of two U32 values. /// public static U32 operator &(U32 left, U32 right); /// /// Performs bitwise OR of two U32 values. /// public static U32 operator |(U32 left, U32 right); /// /// Performs bitwise XOR of two U32 values. /// public static U32 operator ^(U32 left, U32 right); /// /// Performs bitwise NOT of a U32 value. /// public static U32 operator ~(U32 value); /// /// Left shifts a U32 value. /// public static U32 operator <<(U32 left, int right); /// /// Right shifts a U32 value. /// public static U32 operator >>(U32 left, int right); /// Indicates whether this instance and a specified object are equal. /// The object to compare with the current instance. /// /// if and this instance are the same type and represent the same value; otherwise, . public override bool Equals(object? obj); /// Returns the hash code for this instance. /// A 32-bit signed integer that is the hash code for this instance. public override int GetHashCode(); /// Returns the fully qualified type name of this instance. /// The fully qualified type name. public override string ToString(); } }