public static float FieldStoreByOutFloat4()
        {
            float4 v;

            OutputFloat4(out v);
            return(Vectors.ConvertToFloat(v));
        }
        public static float FieldLoadStoreLocalByRefFloat3()
        {
            var v = new float3(2);

            ChangeFloat3(ref v);
            return(Vectors.ConvertToFloat(v));
        }
예제 #3
0
        public static float Normalize()
        {
            var v4     = new quaternion(1.0f, 2.0f, 3.0f, 4.0f);
            var result = math.normalize(v4);

            return(Vectors.ConvertToFloat(result.value));
        }
        public static float FieldLoadStoreIndirectFloat4()
        {
            var localStruct = new StructWithFloat4();

            localStruct.Vec4 = new float4(1.0f, 2.0f, 3.0f, 4.0f);
            return(Vectors.ConvertToFloat(localStruct.Vec4));
        }
        public static float Mul()
        {
            var left   = new float4(2.0f, 1.0f, 3.0f, 5.0f);
            var right  = new float4(1.0f, 2.0f, 3.0f, 4.0f);
            var result = left * right;

            return(Vectors.ConvertToFloat(result));
        }
        public static float SubFloatRight()
        {
            var left   = new float4(1.0f, 2.0f, 3.0f, 4.0f);
            var right  = 2.0f;
            var result = left - right;

            return(Vectors.ConvertToFloat(result));
        }
        public static float AddFloatLeft()
        {
            var left   = 2.0f;
            var right  = new float4(1.0f);
            var result = left + right;

            return(Vectors.ConvertToFloat(result));
        }
        public static float MulFloatLeft()
        {
            var left   = 2.0f;
            var right  = new float3(1.0f, 2.0f, 3.0f);
            var result = left * right;

            return(Vectors.ConvertToFloat(result));
        }
예제 #9
0
        public static float Sub()
        {
            var left   = new float2(1.0f);
            var right  = new float2(1.0f, 2.0f);
            var result = left - right;

            return(Vectors.ConvertToFloat(result));
        }
        public static float DivFloatRight()
        {
            var left   = new float3(2.0f, 1.0f, 3.0f);
            var right  = 15.0f;
            var result = left / right;

            return(Vectors.ConvertToFloat(result));
        }
        public static float Add()
        {
            var left   = new float3(1.0f);
            var right  = new float3(1.0f, 2.0f, 3.0f);
            var result = left + right;

            return(Vectors.ConvertToFloat(result));
        }
        public static float FieldLoadStoreByRefFloat3()
        {
            var    v = new float3(2);
            float3 result;

            LoadAndChangeFloat3(ref v, out result);
            return(Vectors.ConvertToFloat(result));
        }
        public static float Neg()
        {
            var left = new float3(1.0f, 2.0f, 3.0f);

            return(Vectors.ConvertToFloat((-left)));
        }
        public static float AddByArgs(ref float4 left, ref float4 right)
        {
            var result = left + right;

            return(Vectors.ConvertToFloat(result));
        }
 public static float Float44Floats(float a)
 {
     return(Vectors.ConvertToFloat(new float4(1.0f, 2.0f, 3.0f + a, 4.0f)));
 }
 public static float Float3Float2Float(float a)
 {
     return(Vectors.ConvertToFloat(new float3(new float2(a), 5.0f)));
 }
 public static float ImplicitInt4(ref int4 a)
 {
     // Let int4 -> float3 implicit conversion
     return(Vectors.ConvertToFloat(a));
 }
 public static float Float3Int(int a)
 {
     return(Vectors.ConvertToFloat(new float3(a)));
 }
예제 #19
0
 public static float IdentityValue()
 {
     // Force ldsflda
     return(Vectors.ConvertToFloat(PassByRef(quaternion.identity.value)));
 }
        public static float Float4Half4(ref float4 a)
        {
            var h = new half4(a);

            return(Vectors.ConvertToFloat((float4) new float4(h).x));
        }
 public static float Float4Int4(ref int4 a)
 {
     return(Vectors.ConvertToFloat((float4) new float4(a).x));
 }
 public static float Float4Float(float a)
 {
     return(Vectors.ConvertToFloat(new float4(a)));
 }
        public static float Positive()
        {
            var left = new float3(1.0f, 2.0f, 3.0f);

            return(Vectors.ConvertToFloat((+left)));
        }
        public static float Float3Half(float a)
        {
            var h = new half(a);

            return(Vectors.ConvertToFloat((float3) new float3(h).x));
        }
 public static float ImplicitFloat(float a)
 {
     // Let float -> float3 implicit conversion
     return(Vectors.ConvertToFloat((float3)a));
 }
 public static float Float4Float3Float(float x)
 {
     return(Vectors.ConvertToFloat(new float4(new float3(x), 5.0f)));
 }
        public static float SubByArgs(ref float3 left, ref float3 right)
        {
            var result = left - right;

            return(Vectors.ConvertToFloat(result));
        }
        public static float Float2Half2(ref float2 a)
        {
            var h = new half2(a);

            return(Vectors.ConvertToFloat((float2) new float2(h).x));
        }
 public static float Float33Floats(float a)
 {
     return(Vectors.ConvertToFloat(new float3(1.0f, 2.0f, 3.0f + a)));
 }
 public static float Float4Float2Float2(float x)
 {
     return(Vectors.ConvertToFloat(new float4(new float2(x), new float2(5.0f))));
 }