Пример #1
0
        internal static bool select_shuffle_component(bool3 a, bool3 b, ShuffleComponent component)
        {
            switch (component)
            {
            case ShuffleComponent.LeftX:
                return(a.x);

            case ShuffleComponent.LeftY:
                return(a.y);

            case ShuffleComponent.LeftZ:
                return(a.z);

            case ShuffleComponent.RightX:
                return(b.x);

            case ShuffleComponent.RightY:
                return(b.y);

            case ShuffleComponent.RightZ:
                return(b.z);

            default:
                throw new System.ArgumentException("Invalid shuffle component: " + component);
            }
        }
Пример #2
0
 public static bool3 shuffle(bool2 left, bool2 right, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
 {
     return(bool3(
                select_shuffle_component(left, right, x),
                select_shuffle_component(left, right, y),
                select_shuffle_component(left, right, z)));
 }
Пример #3
0
 public static fp3 shuffle(fp2 a, fp2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
 {
     return(fp3(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z)));
 }
Пример #4
0
 public static double3 shuffle(double2 a, double2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
 {
     return(double3(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z)));
 }
Пример #5
0
 public static float3 shuffle(float2 a, float2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
 {
     return(float3(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z)));
 }
Пример #6
0
        private static float pickShuffleComponent(float4 a, float4 b, ShuffleComponent component)
        {
            switch (component)
            {
            case ShuffleComponent.LeftX:
                return(a.x);

            case ShuffleComponent.LeftY:
                return(a.y);

            case ShuffleComponent.LeftZ:
                return(a.z);

            case ShuffleComponent.LeftW:
                return(a.w);

            case ShuffleComponent.RightX:
                return(b.x);

            case ShuffleComponent.RightY:
                return(b.y);

            case ShuffleComponent.RightZ:
                return(b.z);

            case ShuffleComponent.RightW:
                return(b.w);

            default:
                throw new System.ArgumentException("Invalid shuffle component: " + (int)component);
            }
        }
Пример #7
0
 public static uint3 shuffle(uint2 a, uint2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
 {
     return(uint3(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z)));
 }
Пример #8
0
 public static bool3 shuffle(bool3 a, bool3 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z)
 {
     return(bool3(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z)));
 }
Пример #9
0
 public static bool4 shuffle(bool2 a, bool2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
 {
     return(bool4(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z),
                select_shuffle_component(a, b, w)));
 }
Пример #10
0
 public static float4 shuffle(float4 a, float4 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
 {
     // Naive implementation for non-burst
     return(float4(pickShuffleComponent(a, b, x),
                   pickShuffleComponent(a, b, y),
                   pickShuffleComponent(a, b, z),
                   pickShuffleComponent(a, b, w)));
 }
Пример #11
0
 public static uint4 shuffle(uint2 a, uint2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
 {
     return(uint4(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z),
                select_shuffle_component(a, b, w)));
 }
Пример #12
0
 public static float4 shuffle(float2 a, float2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
 {
     return(float4(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z),
                select_shuffle_component(a, b, w)));
 }
Пример #13
0
 public static double4 shuffle(double2 a, double2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
 {
     return(double4(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z),
                select_shuffle_component(a, b, w)));
 }
Пример #14
0
 public static fix64p4 shuffle(fix64p2 a, fix64p2 b, ShuffleComponent x, ShuffleComponent y, ShuffleComponent z, ShuffleComponent w)
 {
     return(fix64p4(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y),
                select_shuffle_component(a, b, z),
                select_shuffle_component(a, b, w)));
 }
Пример #15
0
        internal static sfloat select_shuffle_component(float2 a, float2 b, ShuffleComponent component)
        {
            switch (component)
            {
            case ShuffleComponent.LeftX:
                return(a.x);

            case ShuffleComponent.LeftY:
                return(a.y);

            case ShuffleComponent.RightX:
                return(b.x);

            case ShuffleComponent.RightY:
                return(b.y);

            default:
                throw new System.ArgumentException("Invalid shuffle component: " + component);
            }
        }
Пример #16
0
 public static uint2 shuffle(uint2 a, uint2 b, ShuffleComponent x, ShuffleComponent y)
 {
     return(uint2(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y)));
 }
Пример #17
0
 public static uint shuffle(uint2 a, uint2 b, ShuffleComponent x)
 {
     return(select_shuffle_component(a, b, x));
 }
Пример #18
0
 public static fp shuffle(fp2 a, fp2 b, ShuffleComponent x)
 {
     return(select_shuffle_component(a, b, x));
 }
Пример #19
0
 public static float2 shuffle(float2 a, float2 b, ShuffleComponent x, ShuffleComponent y)
 {
     return(float2(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y)));
 }
Пример #20
0
 public static sfloat shuffle(float2 a, float2 b, ShuffleComponent x)
 {
     return(select_shuffle_component(a, b, x));
 }
Пример #21
0
 public static bool shuffle(bool2 left, bool2 right, ShuffleComponent x)
 {
     return(select_shuffle_component(left, right, x));
 }
Пример #22
0
 public static double2 shuffle(double2 a, double2 b, ShuffleComponent x, ShuffleComponent y)
 {
     return(double2(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y)));
 }
Пример #23
0
 public static bool shuffle(bool3 a, bool3 b, ShuffleComponent x)
 {
     return(select_shuffle_component(a, b, x));
 }
Пример #24
0
 public static bool2 shuffle(bool3 a, bool3 b, ShuffleComponent x, ShuffleComponent y)
 {
     return(bool2(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y)));
 }
Пример #25
0
 public static double shuffle(double2 a, double2 b, ShuffleComponent x)
 {
     return(select_shuffle_component(a, b, x));
 }
Пример #26
0
 public static fix64p2 shuffle(fix64p2 a, fix64p2 b, ShuffleComponent x, ShuffleComponent y)
 {
     return(fix64p2(
                select_shuffle_component(a, b, x),
                select_shuffle_component(a, b, y)));
 }