#pragma warning disable CS0660, CS0661 namespace ComputeSharp; /// /// A that maps the HLSL type. /// public partial struct Int4 { /// /// Gets an value with all components set to 0. /// public static Int4 Zero => 0; /// /// Gets an value with all components set to 1. /// public static Int4 One => 1; /// /// Gets an value with the component set to 1, and the others to 0. /// public static Int4 UnitX => new(1, 0, 0, 0); /// /// Gets an value with the component set to 1, and the others to 0. /// public static Int4 UnitY => new(0, 1, 0, 0); /// /// Gets an value with the component set to 1, and the others to 0. /// public static Int4 UnitZ => new(0, 0, 1, 0); /// /// Gets an value with the component set to 1, and the others to 0. /// public static Int4 UnitW => new(0, 0, 0, 1); /// /// Creates a new instance with the specified parameters. /// /// The value to assign to the first vector component. /// The value to assign to the second vector component. /// The value to assign to the third vector component. /// The value to assign to the fourth vector component. public Int4(int x, int y, int z, int w) { this.x = x; this.y = y; this.z = z; this.w = w; } /// /// Creates a new instance with the specified parameters. /// /// The value to assign to the first and second vector components. /// The value to assign to the third vector component. /// The value to assign to the fourth vector component. public Int4(Int2 xy, int z, int w) { this.x = xy.X; this.y = xy.Y; this.z = z; this.w = w; } /// /// Creates a new instance with the specified parameters. /// /// The value to assign to the first vector component. /// The value to assign to the second vector component. /// The value to assign to the third and fourth vector components. public Int4(int x, int y, Int2 zw) { this.x = x; this.y = y; this.z = zw.X; this.w = zw.Y; } /// /// Creates a new instance with the specified parameters. /// /// The value to assign to the first and second vector components. /// The value to assign to the third and fourth vector components. public Int4(Int2 xy, Int2 zw) { this.x = xy.X; this.y = xy.Y; this.z = zw.X; this.w = zw.Y; } /// /// Creates a new instance with the specified parameters. /// /// The value to assign to the first, second and third vector components. /// The value to assign to the fourth vector component. public Int4(Int3 xyz, int w) { this.x = xyz.X; this.y = xyz.Y; this.z = xyz.Z; this.w = w; } /// /// Creates a new instance with the specified parameters. /// /// The value to assign to the first vector component. /// The value to assign to the second, third and fourth vector components. public Int4(int x, Int3 yzw) { this.x = x; this.y = yzw.X; this.z = yzw.Y; this.w = yzw.Z; } /// /// Creates a new value with the same value for all its components. /// /// The value to use for the components of the new instance. public static implicit operator Int4(int x) => new(x, x, x, x); /// /// Casts a value to a one. /// /// The input value to cast. /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static explicit operator UInt4(Int4 xyzw) => default; /// /// Casts a value to a one. /// /// The input value to cast. /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static implicit operator Float4(Int4 xyzw) => default; /// /// Casts a value to a one. /// /// The input value to cast. /// This method is an intrinsic and can only be used within a shader on the GPU. Using it on the CPU is undefined behavior. public static implicit operator Double4(Int4 xyzw) => default; }