using System.Numerics;
#pragma warning disable CS0660, CS0661
namespace ComputeSharp;
///
/// A that maps the HLSL type.
///
public partial struct Float4
{
///
/// 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 Float4(float x, float y, float z, float 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 Float4(Float2 xy, float z, float 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 Float4(float x, float y, Float2 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 Float4(Float2 xy, Float2 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 Float4(Float3 xyz, float 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 Float4(float x, Float3 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 Float4(float x) => new(x, x, x, x);
///
/// Casts a value to a one.
///
/// The input value to cast.
public static unsafe implicit operator Vector4(Float4 xyzw) => *(Vector4*)&xyzw;
///
/// Casts a value to a one.
///
/// The input value to cast.
public static unsafe implicit operator Float4(Vector4 xyzw) => *(Float4*)&xyzw;
///
/// 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(Float4 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 explicit operator Int4(Float4 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 explicit operator UInt4(Float4 xyzw) => default;
}