Skip to content

Instantly share code, notes, and snippets.

@pCYSl5EDgo
Last active December 1, 2020 06:45
Show Gist options
  • Save pCYSl5EDgo/a4105ca776421525f1fb68676948ef94 to your computer and use it in GitHub Desktop.
Save pCYSl5EDgo/a4105ca776421525f1fb68676948ef94 to your computer and use it in GitHub Desktop.
定型作業の省力化
using System;
using Unity.Burst.Intrinsics;
using Unity.Mathematics;
namespace MyAttribute
{
public enum IntrinsicsKind
{
Ordinal,
Fma,
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class SingleLoopTypeAttribute : Attribute
{
public readonly Type[] TypeArray;
public readonly bool[] IsReadOnlyArray;
public readonly string NamePrefix;
public readonly Type[] OtherTypeArray;
public readonly bool[] OtherIsReadOnlyArray;
public readonly string[] OtherNameArray;
public readonly Type[] TableTypeArray;
public readonly bool[] TableIsReadOnlyArray;
public readonly string[] TableNameArray;
public SingleLoopTypeAttribute(Type[] typeArray, bool[] isReadOnlyArray, string namePrefix) : this(typeArray, isReadOnlyArray, namePrefix, Array.Empty<Type>(), Array.Empty<bool>(), Array.Empty<string>()) { }
public SingleLoopTypeAttribute(Type[] typeArray, bool[] isReadOnlyArray, string namePrefix, Type[] otherTypeArray, bool[] otherIsReadOnlyArray, string[] otherNameArray) : this(typeArray, isReadOnlyArray, namePrefix, otherTypeArray, otherIsReadOnlyArray, otherNameArray, Array.Empty<Type>(), Array.Empty<bool>(), Array.Empty<string>()) { }
public SingleLoopTypeAttribute(Type[] typeArray, bool[] isReadOnlyArray, string namePrefix, Type[] otherTypeArray, bool[] otherIsReadOnlyArray, string[] otherNameArray, Type[] tableTypeArray, bool[] tableIsReadOnlyArray, string[] tableNameArray)
{
TypeArray = typeArray;
IsReadOnlyArray = isReadOnlyArray;
NamePrefix = namePrefix;
OtherTypeArray = otherTypeArray;
OtherIsReadOnlyArray = otherIsReadOnlyArray;
OtherNameArray = otherNameArray;
TableTypeArray = tableTypeArray;
TableIsReadOnlyArray = tableIsReadOnlyArray;
TableNameArray = tableNameArray;
}
}
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
public class CollisionTypeAttribute : Attribute
{
public readonly Type[] OuterTypeArray;
public readonly bool[] OuterIsReadOnlyArray;
public readonly string OuterNamePrefix;
public readonly Type[] InnerTypeArray;
public readonly bool[] InnerIsReadOnlyArray;
public readonly string InnerNamePrefix;
public readonly Type[] OtherTypeArray;
public readonly bool[] OtherIsReadOnlyArray;
public readonly string[] OtherNameArray;
public readonly Type[] TableTypeArray;
public readonly bool[] TableIsReadOnlyArray;
public readonly string[] TableNameArray;
public CollisionTypeAttribute(Type[] outerTypeArray, bool[] outerIsReadOnlyArray, string outerNamePrefix, Type[] innerTypeArray, bool[] innerIsReadOnlyArray, string innerNamePrefix) : this(outerTypeArray, outerIsReadOnlyArray, outerNamePrefix, innerTypeArray, innerIsReadOnlyArray, innerNamePrefix, Array.Empty<Type>(), Array.Empty<bool>(), Array.Empty<string>()) { }
public CollisionTypeAttribute(Type[] outerTypeArray, bool[] outerIsReadOnlyArray, string outerNamePrefix, Type[] innerTypeArray, bool[] innerIsReadOnlyArray, string innerNamePrefix, Type[] otherTypeArray, bool[] otherIsReadOnlyArray, string[] otherNameArray) : this(outerTypeArray, outerIsReadOnlyArray, outerNamePrefix, innerTypeArray, innerIsReadOnlyArray, innerNamePrefix, otherTypeArray, otherIsReadOnlyArray, otherNameArray, Array.Empty<Type>(), Array.Empty<bool>(), Array.Empty<string>()) { }
public CollisionTypeAttribute(Type[] outerTypeArray, bool[] outerIsReadOnlyArray, string outerNamePrefix, Type[] innerTypeArray, bool[] innerIsReadOnlyArray, string innerNamePrefix, Type[] otherTypeArray, bool[] otherIsReadOnlyArray, string[] otherNameArray, Type[] tableTypeArray, bool[] tableIsReadOnlyArray, string[] tableNameArray)
{
OuterTypeArray = outerTypeArray;
OuterIsReadOnlyArray = outerIsReadOnlyArray;
OuterNamePrefix = outerNamePrefix;
InnerTypeArray = innerTypeArray;
InnerIsReadOnlyArray = innerIsReadOnlyArray;
InnerNamePrefix = innerNamePrefix;
OtherTypeArray = otherTypeArray;
OtherIsReadOnlyArray = otherIsReadOnlyArray;
OtherNameArray = otherNameArray;
TableTypeArray = tableTypeArray;
TableIsReadOnlyArray = tableIsReadOnlyArray;
TableNameArray = tableNameArray;
}
}
[AttributeUsage(AttributeTargets.Method)]
public class MethodIntrinsicsKindAttribute : Attribute
{
public readonly IntrinsicsKind Intrinsics;
public MethodIntrinsicsKindAttribute(IntrinsicsKind intrinsics)
{
Intrinsics = intrinsics;
}
}
[AttributeUsage(AttributeTargets.Method)]
public class CollisionCloseMethodAttribute : Attribute
{
public readonly IntrinsicsKind Intrinsics;
public readonly int FieldIndex;
public readonly string FieldName;
public CollisionCloseMethodAttribute(IntrinsicsKind intrinsics, int fieldIndex, string fieldName)
{
Intrinsics = intrinsics;
FieldIndex = fieldIndex;
FieldName = fieldName;
}
}
public class EightAttribute : Attribute { }
public class CountableAttribute : Attribute
{
public readonly Type[] AdditionalMemberTypes;
public readonly string[] AdditionalArgumentMemberNames;
public readonly string[] AdditionalFieldMemberNames;
public readonly string IsAliveFunctionString;
public CountableAttribute()
{
AdditionalMemberTypes = Array.Empty<Type>();
AdditionalArgumentMemberNames = Array.Empty<string>();
AdditionalFieldMemberNames = Array.Empty<string>();
IsAliveFunctionString = "";
}
public CountableAttribute(Type[] additionalMemberTypes, string[] additionalArgumentMemberNames, string[] additionalFieldMemberNames, string isAliveFunctionString)
{
AdditionalMemberTypes = additionalMemberTypes;
AdditionalArgumentMemberNames = additionalArgumentMemberNames;
AdditionalFieldMemberNames = additionalFieldMemberNames;
IsAliveFunctionString = isAliveFunctionString;
}
}
}
using ComponentTypes;
using MyAttribute;
using Unity.Burst;
using Unity.Burst.Intrinsics;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using Unity.Mathematics;
namespace Unity1Week.Hit
{
[CollisionType(
new[] { typeof(Position2D), typeof(AliveState) }, new[] { true, false }, "Bullet",
new[] { typeof(Position2D), typeof(AliveState) }, new[] { true, true }, "Enemy",
new[] { typeof(float), typeof(float), typeof(int) }, new[] { true, true, false }, new[] { "CollisionRadiusSquare", "CurrentTime", "FireCount" },
new[] { typeof(Position2D.Eight), typeof(FireStartTime.Eight) }, new[] { false, false }, new[] { "FirePositionArray", "FireStartTimeArray" }
)]
public static unsafe partial class BulletEnemyHit
{
[MethodIntrinsicsKind(IntrinsicsKind.Fma)]
public static void Exe2(
ref v256 bulletPositionX,
ref v256 bulletPositionY,
ref v256 bulletAliveState,
ref v256 enemyPositionX,
ref v256 enemyPositionY,
ref v256 enemyAliveState,
ref v256 collisionRadiusSquare,
ref v256 currentTime,
ref int fireCount,
void* firePositionArray,
int firePositionArrayLength,
void* FireStartTimeArray,
int FireStartTimeArrayLength
)
{
if (!X86.Fma.IsFmaSupported) return;
var currentTimeX = currentTime.Float0;
var diffX = X86.Avx.mm256_sub_ps(bulletPositionX, enemyPositionX);
var diffY = X86.Avx.mm256_sub_ps(bulletPositionY, enemyPositionY);
var lenSq = X86.Fma.mm256_fmadd_ps(diffY, diffY, X86.Avx.mm256_mul_ps(diffX, diffX));
var hit = X86.Avx.mm256_andnot_ps(X86.Avx.mm256_or_ps(bulletAliveState, enemyAliveState), X86.Avx.mm256_cmp_ps(lenSq, collisionRadiusSquare, (int)X86.Avx.CMP.LT_OQ));
bulletAliveState = X86.Avx.mm256_or_ps(bulletAliveState, hit);
var mask = X86.Avx.mm256_movemask_ps(hit);
if ((mask & 1) == 1)
{
var fireBigIndex = fireCount >> 3;
var fireColumn = (fireBigIndex & 4) >> 2;
var fireRow = fireBigIndex & 3;
ref var position = ref ((Position2D.Eight*)firePositionArray)[fireBigIndex];
ref var time = ref ((FireStartTime.Eight*)FireStartTimeArray)[fireBigIndex];
if (fireColumn == 0)
{
position.X.c0[fireRow] = bulletPositionX.Float0;
position.Y.c0[fireRow] = bulletPositionY.Float0;
time.Value.c0[fireRow] = currentTimeX;
}
else
{
position.X.c1[fireRow] = bulletPositionX.Float0;
position.Y.c1[fireRow] = bulletPositionY.Float0;
time.Value.c1[fireRow] = currentTimeX;
}
++fireCount;
}
if (((mask >> 1) & 1) == 1)
{
var fireBigIndex = fireCount >> 3;
var fireColumn = (fireBigIndex & 4) >> 2;
var fireRow = fireBigIndex & 3;
ref var position = ref ((Position2D.Eight*)firePositionArray)[fireBigIndex];
ref var time = ref ((FireStartTime.Eight*)FireStartTimeArray)[fireBigIndex];
if (fireColumn == 0)
{
position.X.c0[fireRow] = bulletPositionX.Float1;
position.Y.c0[fireRow] = bulletPositionY.Float1;
time.Value.c0[fireRow] = currentTimeX;
}
else
{
position.X.c1[fireRow] = bulletPositionX.Float1;
position.Y.c1[fireRow] = bulletPositionY.Float1;
time.Value.c1[fireRow] = currentTimeX;
}
++fireCount;
}
if (((mask >> 2) & 1) == 1)
{
var fireBigIndex = fireCount >> 3;
var fireColumn = (fireBigIndex & 4) >> 2;
var fireRow = fireBigIndex & 3;
ref var position = ref ((Position2D.Eight*)firePositionArray)[fireBigIndex];
ref var time = ref ((FireStartTime.Eight*)FireStartTimeArray)[fireBigIndex];
if (fireColumn == 0)
{
position.X.c0[fireRow] = bulletPositionX.Float2;
position.Y.c0[fireRow] = bulletPositionY.Float2;
time.Value.c0[fireRow] = currentTimeX;
}
else
{
position.X.c1[fireRow] = bulletPositionX.Float2;
position.Y.c1[fireRow] = bulletPositionY.Float2;
time.Value.c1[fireRow] = currentTimeX;
}
++fireCount;
}
if (((mask >> 3) & 1) == 1)
{
var fireBigIndex = fireCount >> 3;
var fireColumn = (fireBigIndex & 4) >> 2;
var fireRow = fireBigIndex & 3;
ref var position = ref ((Position2D.Eight*)firePositionArray)[fireBigIndex];
ref var time = ref ((FireStartTime.Eight*)FireStartTimeArray)[fireBigIndex];
if (fireColumn == 0)
{
position.X.c0[fireRow] = bulletPositionX.Float3;
position.Y.c0[fireRow] = bulletPositionY.Float3;
time.Value.c0[fireRow] = currentTimeX;
}
else
{
position.X.c1[fireRow] = bulletPositionX.Float3;
position.Y.c1[fireRow] = bulletPositionY.Float3;
time.Value.c1[fireRow] = currentTimeX;
}
++fireCount;
}
if (((mask >> 4) & 1) == 1)
{
var fireBigIndex = fireCount >> 3;
var fireColumn = (fireBigIndex & 4) >> 2;
var fireRow = fireBigIndex & 3;
ref var position = ref ((Position2D.Eight*)firePositionArray)[fireBigIndex];
ref var time = ref ((FireStartTime.Eight*)FireStartTimeArray)[fireBigIndex];
if (fireColumn == 0)
{
position.X.c0[fireRow] = bulletPositionX.Float4;
position.Y.c0[fireRow] = bulletPositionY.Float4;
time.Value.c0[fireRow] = currentTimeX;
}
else
{
position.X.c1[fireRow] = bulletPositionX.Float4;
position.Y.c1[fireRow] = bulletPositionY.Float4;
time.Value.c1[fireRow] = currentTimeX;
}
++fireCount;
}
if (((mask >> 5) & 1) == 1)
{
var fireBigIndex = fireCount >> 3;
var fireColumn = (fireBigIndex & 4) >> 2;
var fireRow = fireBigIndex & 3;
ref var position = ref ((Position2D.Eight*)firePositionArray)[fireBigIndex];
ref var time = ref ((FireStartTime.Eight*)FireStartTimeArray)[fireBigIndex];
if (fireColumn == 0)
{
position.X.c0[fireRow] = bulletPositionX.Float5;
position.Y.c0[fireRow] = bulletPositionY.Float5;
time.Value.c0[fireRow] = currentTimeX;
}
else
{
position.X.c1[fireRow] = bulletPositionX.Float5;
position.Y.c1[fireRow] = bulletPositionY.Float5;
time.Value.c1[fireRow] = currentTimeX;
}
++fireCount;
}
if (((mask >> 6) & 1) == 1)
{
var fireBigIndex = fireCount >> 3;
var fireColumn = (fireBigIndex & 4) >> 2;
var fireRow = fireBigIndex & 3;
ref var position = ref ((Position2D.Eight*)firePositionArray)[fireBigIndex];
ref var time = ref ((FireStartTime.Eight*)FireStartTimeArray)[fireBigIndex];
if (fireColumn == 0)
{
position.X.c0[fireRow] = bulletPositionX.Float6;
position.Y.c0[fireRow] = bulletPositionY.Float6;
time.Value.c0[fireRow] = currentTimeX;
}
else
{
position.X.c1[fireRow] = bulletPositionX.Float6;
position.Y.c1[fireRow] = bulletPositionY.Float6;
time.Value.c1[fireRow] = currentTimeX;
}
++fireCount;
}
if (((mask >> 7) & 1) == 1)
{
var fireBigIndex = fireCount >> 3;
var fireColumn = (fireBigIndex & 4) >> 2;
var fireRow = fireBigIndex & 3;
ref var position = ref ((Position2D.Eight*)firePositionArray)[fireBigIndex];
ref var time = ref ((FireStartTime.Eight*)FireStartTimeArray)[fireBigIndex];
if (fireColumn == 0)
{
position.X.c0[fireRow] = bulletPositionX.Float7;
position.Y.c0[fireRow] = bulletPositionY.Float7;
time.Value.c0[fireRow] = currentTimeX;
}
else
{
position.X.c1[fireRow] = bulletPositionX.Float7;
position.Y.c1[fireRow] = bulletPositionY.Float7;
time.Value.c1[fireRow] = currentTimeX;
}
++fireCount;
}
}
[MethodIntrinsicsKind(IntrinsicsKind.Ordinal)]
public static void Exe(
ref float4 bulletPositionX,
ref float4 bulletPositionY,
ref int4 bulletAliveState,
ref float4 enemyPositionX,
ref float4 enemyPositionY,
ref int4 enemyAliveState,
ref float4 collisionRadiusSquare,
ref float4 currentTime,
ref int fireCount,
void* firePositionArray,
int firePositionArrayLength,
void* FireStartTimeArray,
int FireStartTimeArrayLength
)
{
var diffX = bulletPositionX - enemyPositionX;
var diffY = bulletPositionY - enemyPositionY;
var lenSq = diffX * diffX + diffY * diffY;
var hit = lenSq < collisionRadiusSquare & enemyAliveState == 0 & bulletAliveState == 0;
enemyAliveState = math.select(bulletAliveState, -1, hit);
for (var i = 0; i < 4; ++i)
{
if (hit[i])
{
var fireBigIndex = fireCount >> 3;
var fireColumn = (fireBigIndex & 4) >> 2;
var fireRow = fireBigIndex & 3;
ref var position = ref ((Position2D.Eight*)firePositionArray)[fireBigIndex];
ref var time = ref ((FireStartTime.Eight*)FireStartTimeArray)[fireBigIndex];
if (fireColumn == 0)
{
position.X.c0[fireRow] = bulletPositionX[i];
position.Y.c0[fireRow] = bulletPositionY[i];
time.Value.c0[fireRow] = currentTime.x;
}
else
{
position.X.c1[fireRow] = bulletPositionX[i];
position.Y.c1[fireRow] = bulletPositionY[i];
time.Value.c1[fireRow] = currentTime.x;
}
++fireCount;
}
}
}
[CollisionCloseMethod(IntrinsicsKind.Ordinal, 1, "Value")]
public static int4 CloseAlive(int4 a, int4 b)
{
return a | b;
}
[CollisionCloseMethod(IntrinsicsKind.Fma, 1, "Value")]
public static v256 CloseAlive2(v256 a, v256 b)
{
if (!X86.Fma.IsFmaSupported) return a;
return X86.Avx.mm256_or_ps(a, b);
}
}
[SingleLoopType(
new[] { typeof(Position2D), typeof(AliveState) }, new[] { true, false }, "Enemy",
new[] { typeof(float), typeof(float), typeof(float), typeof(int) }, new[] { true, true, true, false }, new[] { "PlayerPositionX", "PlayerPositionY", "CollisionRadiusSquare", "CollisionCount" }
)]
public static partial class PlayerEnemyHitJob
{
[MethodIntrinsicsKind(IntrinsicsKind.Ordinal)]
public static void Exe(
ref float4 enemyPositionX,
ref float4 enemyPositionY,
ref int4 enemyAliveState,
ref float4 playerPositionX,
ref float4 playerPositionY,
ref float4 collisionRadiusSquare,
ref int collisionCount
)
{
var diffX = playerPositionX - enemyPositionX;
var diffY = playerPositionY - enemyPositionY;
var hit = enemyAliveState == 0 & (diffX * diffX + diffY * diffY < collisionRadiusSquare);
enemyAliveState = math.select(enemyAliveState, -1, hit);
for (var i = 0; i < 4; i++)
{
if (hit[i])
{
collisionCount++;
}
}
}
[MethodIntrinsicsKind(IntrinsicsKind.Fma)]
public static void Exe2(
ref v256 enemyPositionX,
ref v256 enemyPositionY,
ref v256 enemyAliveState,
ref v256 playerPositionX,
ref v256 playerPositionY,
ref v256 collisionRadiusSquare,
ref int collisionCount
)
{
if (!X86.Fma.IsFmaSupported) return;
var diffX = X86.Avx.mm256_sub_ps(playerPositionX, enemyPositionX);
var diffY = X86.Avx.mm256_sub_ps(playerPositionY, enemyPositionY);
var lengthSquared = X86.Fma.mm256_fmadd_ps(diffY, diffY, X86.Avx.mm256_mul_ps(diffX, diffX));
var hit = X86.Avx.mm256_andnot_ps(enemyAliveState, X86.Avx.mm256_cmp_ps(lengthSquared, collisionRadiusSquare, (int)X86.Avx.CMP.LT_OQ));
enemyAliveState = X86.Avx.mm256_or_ps(enemyAliveState, hit);
var mask = X86.Avx.mm256_movemask_ps(hit);
collisionCount += math.countbits(mask);
}
}
[CollisionType(
new[] { typeof(Position2D), typeof(FireStartTime) }, new[] { true, true }, "Fire",
new[] { typeof(Position2D), typeof(AliveState) }, new[] { true, false }, "Enemy",
new[] { typeof(float), typeof(float), typeof(int) }, new[] { true, true, false }, new[] { "CollisionRadiusSquare", "FireDeadTime", "EnemyKillCount" }
)]
public static partial class PlayerFireEnemyHitJob
{
[MethodIntrinsicsKind(IntrinsicsKind.Ordinal)]
public static void Exe(
ref float4 firePositionX,
ref float4 firePositionY,
ref float4 fireStartTime,
ref float4 enemyPositionX,
ref float4 enemyPositionY,
ref int4 enemyAliveState,
ref float4 collisionRadiusSquare,
ref float4 fireDeadTime,
ref int enemyKillCount
)
{
var diffX = firePositionX - enemyPositionX;
var diffY = firePositionY - enemyPositionY;
var lengthSquared = diffX * diffX + diffY * diffY;
var hit = lengthSquared < collisionRadiusSquare & enemyAliveState == 0 & fireStartTime > fireDeadTime;
enemyAliveState = math.select(enemyAliveState, -1, hit);
for (var i = 0; i < 4; ++i)
{
if (hit[i])
{
enemyKillCount++;
}
}
}
[MethodIntrinsicsKind(IntrinsicsKind.Fma)]
public static void Exe2(
ref v256 firePositionX,
ref v256 firePositionY,
ref v256 fireStartTime,
ref v256 enemyPositionX,
ref v256 enemyPositionY,
ref v256 enemyAliveState,
ref v256 collisionRadiusSquare,
ref v256 fireDeadTime,
ref int enemyKillCount
)
{
if (!X86.Fma.IsFmaSupported) return;
var diffX = X86.Avx.mm256_sub_ps(firePositionX, enemyPositionX);
var diffY = X86.Avx.mm256_sub_ps(firePositionY, enemyPositionY);
var lengthSquared = X86.Fma.mm256_fmadd_ps(diffY, diffY, X86.Avx.mm256_mul_ps(diffX, diffX));
var hit = X86.Avx.mm256_andnot_ps(enemyAliveState, X86.Avx.mm256_cmp_ps(lengthSquared, collisionRadiusSquare, (int)X86.Avx.CMP.LT_OQ));
hit = X86.Avx.mm256_and_ps(hit, X86.Avx.mm256_cmp_ps(fireDeadTime, fireStartTime, (int)X86.Avx.CMP.LT_OQ));
enemyAliveState = X86.Avx.mm256_or_ps(enemyAliveState, hit);
enemyKillCount += math.countbits(X86.Avx.mm256_movemask_ps(hit));
}
}
[SingleLoopType(
new[] { typeof(Position2D), typeof(AliveState) }, new[] { true, false }, "Enemy",
new[] { typeof(float), typeof(float), typeof(float), typeof(int) }, new[] { true, true, true, false }, new[] { "PlayerPositionX", "PlayerPositionY", "CollisionRadiusSquare", "CollisionCount" }
)]
public static partial class EnemyAttackPlayerHitJob
{
[MethodIntrinsicsKind(IntrinsicsKind.Ordinal)]
public static void Exe(
ref float4 attackX,
ref float4 attackY,
ref int4 attackAliveState,
ref float4 playerPositionX,
ref float4 playerPositionY,
ref float4 collisionRadiusSquare,
ref int collisionCount
)
{
var lengthSquared = math.distancesq(attackX - playerPositionX, attackY - playerPositionY);
var hit = attackAliveState == 0 & lengthSquared < collisionRadiusSquare;
attackAliveState = math.select(attackAliveState, -1, hit);
for (var i = 0; i < 4; ++i)
{
if (hit[i])
{
++collisionCount;
}
}
}
[MethodIntrinsicsKind(IntrinsicsKind.Fma)]
public static void Exe2(
ref v256 attackX,
ref v256 attackY,
ref v256 attackAliveState,
ref v256 playerPositionX,
ref v256 playerPositionY,
ref v256 collisionRadiusSquare,
ref int collisionCount
)
{
var diffX = X86.Avx.mm256_sub_ps(attackX, playerPositionX);
var diffY = X86.Avx.mm256_sub_ps(attackY, playerPositionY);
var lengthSquared = X86.Fma.mm256_fmadd_ps(diffY, diffY, X86.Avx.mm256_mul_ps(diffX, diffX));
var hit = X86.Avx.mm256_andnot_ps(attackAliveState, X86.Avx.mm256_cmp_ps(lengthSquared, collisionRadiusSquare, (int)X86.Avx.CMP.LT_OQ));
attackAliveState = X86.Avx.mm256_or_ps(attackAliveState, hit);
collisionCount += math.countbits(X86.Avx.mm256_movemask_ps(hit));
}
}
}
using Unity.Collections;
using MyAttribute;
namespace ComponentTypes
{
[Eight]
public partial struct AliveState
{
public State Value;
public enum State
{
Alive,
Dead = -1,
}
}
[Eight]
public partial struct Size
{
public float Value;
}
[Eight]
public partial struct Destination2D
{
public float X;
public float Y;
}
[Eight]
public partial struct Position2D
{
public float X;
public float Y;
}
[Eight]
public partial struct Speed2D
{
public float X;
public float Y;
}
[Eight]
public partial struct FireStartTime
{
public float Value;
}
[Countable(new System.Type[0], new string[0], new string[0], "return IsAliveArray.Reinterpret<AliveState.State>()[index] == AliveState.State.Alive;")]
public partial struct Enemy
{
public Position2D Position;
public Destination2D Destination;
public Speed2D Speed;
public AliveState IsAlive;
}
[Countable(new System.Type[0], new string[0], new string[0], "return IsAliveArray.Reinterpret<AliveState.State>()[index] == AliveState.State.Alive;")]
public partial struct EnemyAttack
{
public Position2D Position;
public Speed2D Speed;
public AliveState IsAlive;
}
[Countable(new System.Type[0], new string[0], new string[0], "return IsAliveArray.Reinterpret<AliveState.State>()[index] == AliveState.State.Alive;")]
public partial struct PlayerBullet
{
public Position2D Position;
public Speed2D Speed;
public AliveState IsAlive;
}
[Countable(new System.Type[] { typeof(float) }, new string[] { "deadTime" }, new string[] { "DeadTime" }, "return StartTimeArray.Reinterpret<float>()[index] > deadTime;")]
public partial struct PlayerFire
{
public Position2D Position;
public Speed2D Speed;
public FireStartTime StartTime;
}
}
namespace ComponentTypes
{
partial struct AliveState
{
public partial struct Eight
{
public global::Unity.Mathematics.int4x2 Value;
public void CopyToDestination(int srcColumn, int srcRow, ref Eight destination, int dstColumn, int dstRow)
{
{
var temp = destination.Value;
var temp2 = temp[dstColumn];
temp2[dstRow] = Value[srcColumn][srcRow];
temp[dstColumn] = temp2;
destination.Value = temp;
}
}
}
}
}
namespace ComponentTypes
{
partial struct Size
{
public partial struct Eight
{
public global::Unity.Mathematics.float4x2 Value;
public void CopyToDestination(int srcColumn, int srcRow, ref Eight destination, int dstColumn, int dstRow)
{
{
var temp = destination.Value;
var temp2 = temp[dstColumn];
temp2[dstRow] = Value[srcColumn][srcRow];
temp[dstColumn] = temp2;
destination.Value = temp;
}
}
}
}
}
namespace ComponentTypes
{
partial struct Destination2D
{
public partial struct Eight
{
public global::Unity.Mathematics.float4x2 X;
public global::Unity.Mathematics.float4x2 Y;
public void CopyToDestination(int srcColumn, int srcRow, ref Eight destination, int dstColumn, int dstRow)
{
{
var temp = destination.X;
var temp2 = temp[dstColumn];
temp2[dstRow] = X[srcColumn][srcRow];
temp[dstColumn] = temp2;
destination.X = temp;
}
{
var temp = destination.Y;
var temp2 = temp[dstColumn];
temp2[dstRow] = Y[srcColumn][srcRow];
temp[dstColumn] = temp2;
destination.Y = temp;
}
}
}
}
}
namespace ComponentTypes
{
partial struct Position2D
{
public partial struct Eight
{
public global::Unity.Mathematics.float4x2 X;
public global::Unity.Mathematics.float4x2 Y;
public void CopyToDestination(int srcColumn, int srcRow, ref Eight destination, int dstColumn, int dstRow)
{
{
var temp = destination.X;
var temp2 = temp[dstColumn];
temp2[dstRow] = X[srcColumn][srcRow];
temp[dstColumn] = temp2;
destination.X = temp;
}
{
var temp = destination.Y;
var temp2 = temp[dstColumn];
temp2[dstRow] = Y[srcColumn][srcRow];
temp[dstColumn] = temp2;
destination.Y = temp;
}
}
}
}
}
namespace ComponentTypes
{
partial struct Speed2D
{
public partial struct Eight
{
public global::Unity.Mathematics.float4x2 X;
public global::Unity.Mathematics.float4x2 Y;
public void CopyToDestination(int srcColumn, int srcRow, ref Eight destination, int dstColumn, int dstRow)
{
{
var temp = destination.X;
var temp2 = temp[dstColumn];
temp2[dstRow] = X[srcColumn][srcRow];
temp[dstColumn] = temp2;
destination.X = temp;
}
{
var temp = destination.Y;
var temp2 = temp[dstColumn];
temp2[dstRow] = Y[srcColumn][srcRow];
temp[dstColumn] = temp2;
destination.Y = temp;
}
}
}
}
}
namespace ComponentTypes
{
partial struct FireStartTime
{
public partial struct Eight
{
public global::Unity.Mathematics.float4x2 Value;
public void CopyToDestination(int srcColumn, int srcRow, ref Eight destination, int dstColumn, int dstRow)
{
{
var temp = destination.Value;
var temp2 = temp[dstColumn];
temp2[dstRow] = Value[srcColumn][srcRow];
temp[dstColumn] = temp2;
destination.Value = temp;
}
}
}
}
}
namespace ComponentTypes
{
partial struct Enemy
{
public partial struct Countable
{
public global::Unity.Collections.NativeArray<int> Count;
public global::Unity.Collections.NativeArray<global::ComponentTypes.Position2D.Eight> PositionArray;
public global::Unity.Collections.NativeArray<global::ComponentTypes.Destination2D.Eight> DestinationArray;
public global::Unity.Collections.NativeArray<global::ComponentTypes.Speed2D.Eight> SpeedArray;
public global::Unity.Collections.NativeArray<global::ComponentTypes.AliveState.Eight> IsAliveArray;
public Countable(int count)
{
Count = new global::Unity.Collections.NativeArray<int>(1, global::Unity.Collections.Allocator.Persistent);
var capacity = ((count - 1) >> 3) + 1;
PositionArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.Position2D.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
DestinationArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.Destination2D.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
SpeedArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.Speed2D.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
IsAliveArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.AliveState.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
}
public bool IsAlive(int index)
{
return IsAliveArray.Reinterpret<AliveState.State>()[index] == AliveState.State.Alive;
}
}
[global::Unity.Burst.BurstCompile]
public partial struct SortJob : global::Unity.Jobs.IJob
{
public Countable This;
public void Execute()
{
var ____count = This.Count[0];
for (var ____index = 0; ____index < ____count; )
{
if (This.IsAlive(____index))
{
++____index;
continue;
}
while (!This.IsAlive(--____count))
{
if (____index >= ____count)
{
goto END;
}
}
var ____srcIndex = ____index >> 3;
var ____srcColumn = (____index & 7) >> 2;
var ____srcRow = ____index & 3;
var ____dstIndex = ____count >> 3;
var ____dstColumn = (____count & 7) >> 2;
var ____dstRow = ____count & 3;
{
var ____dst = This.PositionArray[____dstIndex];
var ____src = This.PositionArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.PositionArray[____dstIndex] = ____dst;
}
{
var ____dst = This.DestinationArray[____dstIndex];
var ____src = This.DestinationArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.DestinationArray[____dstIndex] = ____dst;
}
{
var ____dst = This.SpeedArray[____dstIndex];
var ____src = This.SpeedArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.SpeedArray[____dstIndex] = ____dst;
}
{
var ____dst = This.IsAliveArray[____dstIndex];
var ____src = This.IsAliveArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.IsAliveArray[____dstIndex] = ____dst;
}
}
END:
This.Count[0] = ____count;
}
}
}
}
namespace ComponentTypes
{
partial struct EnemyAttack
{
public partial struct Countable
{
public global::Unity.Collections.NativeArray<int> Count;
public global::Unity.Collections.NativeArray<global::ComponentTypes.Position2D.Eight> PositionArray;
public global::Unity.Collections.NativeArray<global::ComponentTypes.Speed2D.Eight> SpeedArray;
public global::Unity.Collections.NativeArray<global::ComponentTypes.AliveState.Eight> IsAliveArray;
public Countable(int count)
{
Count = new global::Unity.Collections.NativeArray<int>(1, global::Unity.Collections.Allocator.Persistent);
var capacity = ((count - 1) >> 3) + 1;
PositionArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.Position2D.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
SpeedArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.Speed2D.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
IsAliveArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.AliveState.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
}
public bool IsAlive(int index)
{
return IsAliveArray.Reinterpret<AliveState.State>()[index] == AliveState.State.Alive;
}
}
[global::Unity.Burst.BurstCompile]
public partial struct SortJob : global::Unity.Jobs.IJob
{
public Countable This;
public void Execute()
{
var ____count = This.Count[0];
for (var ____index = 0; ____index < ____count; )
{
if (This.IsAlive(____index))
{
++____index;
continue;
}
while (!This.IsAlive(--____count))
{
if (____index >= ____count)
{
goto END;
}
}
var ____srcIndex = ____index >> 3;
var ____srcColumn = (____index & 7) >> 2;
var ____srcRow = ____index & 3;
var ____dstIndex = ____count >> 3;
var ____dstColumn = (____count & 7) >> 2;
var ____dstRow = ____count & 3;
{
var ____dst = This.PositionArray[____dstIndex];
var ____src = This.PositionArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.PositionArray[____dstIndex] = ____dst;
}
{
var ____dst = This.SpeedArray[____dstIndex];
var ____src = This.SpeedArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.SpeedArray[____dstIndex] = ____dst;
}
{
var ____dst = This.IsAliveArray[____dstIndex];
var ____src = This.IsAliveArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.IsAliveArray[____dstIndex] = ____dst;
}
}
END:
This.Count[0] = ____count;
}
}
}
}
namespace ComponentTypes
{
partial struct PlayerBullet
{
public partial struct Countable
{
public global::Unity.Collections.NativeArray<int> Count;
public global::Unity.Collections.NativeArray<global::ComponentTypes.Position2D.Eight> PositionArray;
public global::Unity.Collections.NativeArray<global::ComponentTypes.Speed2D.Eight> SpeedArray;
public global::Unity.Collections.NativeArray<global::ComponentTypes.AliveState.Eight> IsAliveArray;
public Countable(int count)
{
Count = new global::Unity.Collections.NativeArray<int>(1, global::Unity.Collections.Allocator.Persistent);
var capacity = ((count - 1) >> 3) + 1;
PositionArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.Position2D.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
SpeedArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.Speed2D.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
IsAliveArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.AliveState.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
}
public bool IsAlive(int index)
{
return IsAliveArray.Reinterpret<AliveState.State>()[index] == AliveState.State.Alive;
}
}
[global::Unity.Burst.BurstCompile]
public partial struct SortJob : global::Unity.Jobs.IJob
{
public Countable This;
public void Execute()
{
var ____count = This.Count[0];
for (var ____index = 0; ____index < ____count; )
{
if (This.IsAlive(____index))
{
++____index;
continue;
}
while (!This.IsAlive(--____count))
{
if (____index >= ____count)
{
goto END;
}
}
var ____srcIndex = ____index >> 3;
var ____srcColumn = (____index & 7) >> 2;
var ____srcRow = ____index & 3;
var ____dstIndex = ____count >> 3;
var ____dstColumn = (____count & 7) >> 2;
var ____dstRow = ____count & 3;
{
var ____dst = This.PositionArray[____dstIndex];
var ____src = This.PositionArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.PositionArray[____dstIndex] = ____dst;
}
{
var ____dst = This.SpeedArray[____dstIndex];
var ____src = This.SpeedArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.SpeedArray[____dstIndex] = ____dst;
}
{
var ____dst = This.IsAliveArray[____dstIndex];
var ____src = This.IsAliveArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.IsAliveArray[____dstIndex] = ____dst;
}
}
END:
This.Count[0] = ____count;
}
}
}
}
namespace ComponentTypes
{
partial struct PlayerFire
{
public partial struct Countable
{
public global::Unity.Collections.NativeArray<int> Count;
public global::Unity.Collections.NativeArray<global::ComponentTypes.Position2D.Eight> PositionArray;
public global::Unity.Collections.NativeArray<global::ComponentTypes.Speed2D.Eight> SpeedArray;
public global::Unity.Collections.NativeArray<global::ComponentTypes.FireStartTime.Eight> StartTimeArray;
public Countable(int count)
{
Count = new global::Unity.Collections.NativeArray<int>(1, global::Unity.Collections.Allocator.Persistent);
var capacity = ((count - 1) >> 3) + 1;
PositionArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.Position2D.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
SpeedArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.Speed2D.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
StartTimeArray = new global::Unity.Collections.NativeArray<global::ComponentTypes.FireStartTime.Eight>(capacity, global::Unity.Collections.Allocator.Persistent);
}
public bool IsAlive(int index, float deadTime)
{
return StartTimeArray.Reinterpret<float>()[index] > deadTime;
}
}
[global::Unity.Burst.BurstCompile]
public partial struct SortJob : global::Unity.Jobs.IJob
{
public Countable This;
public float DeadTime;
public void Execute()
{
var ____count = This.Count[0];
for (var ____index = 0; ____index < ____count; )
{
if (This.IsAlive(____index, this.DeadTime))
{
++____index;
continue;
}
while (!This.IsAlive(--____count, this.DeadTime))
{
if (____index >= ____count)
{
goto END;
}
}
var ____srcIndex = ____index >> 3;
var ____srcColumn = (____index & 7) >> 2;
var ____srcRow = ____index & 3;
var ____dstIndex = ____count >> 3;
var ____dstColumn = (____count & 7) >> 2;
var ____dstRow = ____count & 3;
{
var ____dst = This.PositionArray[____dstIndex];
var ____src = This.PositionArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.PositionArray[____dstIndex] = ____dst;
}
{
var ____dst = This.SpeedArray[____dstIndex];
var ____src = This.SpeedArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.SpeedArray[____dstIndex] = ____dst;
}
{
var ____dst = This.StartTimeArray[____dstIndex];
var ____src = This.StartTimeArray[____srcIndex];
____src.CopyToDestination(____srcColumn, ____srcRow, ref ____dst, ____dstColumn, ____dstRow);
This.StartTimeArray[____dstIndex] = ____dst;
}
}
END:
This.Count[0] = ____count;
}
}
}
}
namespace Unity1Week.Hit
{
static partial class BulletEnemyHit
{
[global::Unity.Burst.BurstCompile]
public unsafe partial struct Job : global::Unity.Jobs.IJob
{
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> BulletPosition2D;
public global::Unity.Collections.NativeArray<ComponentTypes.AliveState.Eight> BulletAliveState;
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> EnemyPosition2D;
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.AliveState.Eight> EnemyAliveState;
public float CollisionRadiusSquare;
public float CurrentTime;
public global::Unity.Collections.NativeArray<int> FireCount;
public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> FirePositionArray;
public global::Unity.Collections.NativeArray<ComponentTypes.FireStartTime.Eight> FireStartTimeArray;
public void Execute()
{
var tablePointer0 = global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(FirePositionArray);
var tablePointer1 = global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(FireStartTimeArray);
if (global::Unity.Burst.Intrinsics.X86.Fma.IsFmaSupported)
{
const int next1 = 0b00_11_10_01;
const int next2 = 0b01_00_11_10;
const int next3 = 0b10_01_00_11;
var other0 = new global::Unity.Burst.Intrinsics.v256(CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare);
var other1 = new global::Unity.Burst.Intrinsics.v256(CurrentTime, CurrentTime, CurrentTime, CurrentTime, CurrentTime, CurrentTime, CurrentTime, CurrentTime);
var other2 = FireCount[0];
var outerPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(BulletPosition2D);
var outerPointer1 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(BulletAliveState);
var innerOriginalPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(EnemyPosition2D);
var innerOriginalPointer1 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(EnemyAliveState);
for (
var outerIndex = 0;
outerIndex < BulletPosition2D.Length;
++outerIndex,
outerPointer0 += sizeof(ComponentTypes.Position2D.Eight),
outerPointer1 += sizeof(ComponentTypes.AliveState.Eight)
)
{
var outer0_X = outerPointer0 + (0 << 5);
var outer0_Y = outerPointer0 + (1 << 5);
var outer1_Value = outerPointer1 + (0 << 5);
var outer0_X0 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outer0_X);
var outer0_Y0 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outer0_Y);
var outer1_Value0 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outer1_Value);
var outer0_X1 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X0, next1);
var outer0_Y1 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y0, next1);
var outer1_Value1 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value0, next1);
var outer0_X2 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X0, next2);
var outer0_Y2 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y0, next2);
var outer1_Value2 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value0, next2);
var outer0_X3 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X0, next3);
var outer0_Y3 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y0, next3);
var outer1_Value3 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value0, next3);
var outer0_X4 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer0_X0, outer0_X0, 0b0000_0001);
var outer0_Y4 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer0_Y0, outer0_Y0, 0b0000_0001);
var outer1_Value4 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer1_Value0, outer1_Value0, 0b0000_0001);
var outer0_X5 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X4, next1);
var outer0_Y5 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y4, next1);
var outer1_Value5 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value4, next1);
var outer0_X6 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X4, next2);
var outer0_Y6 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y4, next2);
var outer1_Value6 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value4, next2);
var outer0_X7 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X4, next3);
var outer0_Y7 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y4, next3);
var outer1_Value7 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value4, next3);
var innerPointer0 = innerOriginalPointer0;
var innerPointer1 = innerOriginalPointer1;
for (
var innerIndex = 0;
innerIndex < EnemyPosition2D.Length;
++innerIndex,
innerPointer0 += sizeof(ComponentTypes.Position2D.Eight),
innerPointer1 += sizeof(ComponentTypes.AliveState.Eight)
)
{
var inner0_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(innerPointer0 + (0 << 5));
var inner0_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(innerPointer0 + (1 << 5));
var inner1_Value = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(innerPointer1 + (0 << 5));
Exe2(ref outer0_X0, ref outer0_Y0, ref outer1_Value0, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe2(ref outer0_X1, ref outer0_Y1, ref outer1_Value1, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe2(ref outer0_X2, ref outer0_Y2, ref outer1_Value2, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe2(ref outer0_X3, ref outer0_Y3, ref outer1_Value3, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe2(ref outer0_X4, ref outer0_Y4, ref outer1_Value4, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe2(ref outer0_X5, ref outer0_Y5, ref outer1_Value5, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe2(ref outer0_X6, ref outer0_Y6, ref outer1_Value6, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe2(ref outer0_X7, ref outer0_Y7, ref outer1_Value7, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
}
outer1_Value0 = CloseAlive2(outer1_Value0, global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer1_Value4, outer1_Value4, 0b0000_0001));
outer1_Value1 = CloseAlive2(outer1_Value1, global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer1_Value5, outer1_Value5, 0b0000_0001));
outer1_Value2 = CloseAlive2(outer1_Value2, global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer1_Value6, outer1_Value6, 0b0000_0001));
outer1_Value3 = CloseAlive2(outer1_Value3, global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer1_Value7, outer1_Value7, 0b0000_0001));
outer1_Value1 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value1, 0b10_01_00_11);
outer1_Value2 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value2, 0b01_00_11_10);
outer1_Value3 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value3, 0b00_11_10_01);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outer1_Value, CloseAlive2(CloseAlive2(outer1_Value0, outer1_Value1), CloseAlive2(outer1_Value2, outer1_Value3)));
}
FireCount[0] = other2;
return;
}
{
var other0 = new global::Unity.Mathematics.float4(CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare);
var other1 = new global::Unity.Mathematics.float4(CurrentTime, CurrentTime, CurrentTime, CurrentTime);
var other2 = FireCount[0];
for (var outerIndex = 0; outerIndex < BulletPosition2D.Length; ++outerIndex)
{
var outer0 = BulletPosition2D[outerIndex];
var outer1 = BulletAliveState[outerIndex];
ref var outer0_X0 = ref outer0.X;
ref var outer0_X0_c0 = ref outer0_X0.c0;
var outer0_X1_c0 = outer0_X0.c0.wxyz;
var outer0_X2_c0 = outer0_X0.c0.zwxy;
var outer0_X3_c0 = outer0_X0.c0.yzwx;
ref var outer0_X0_c1 = ref outer0_X0.c1;
var outer0_X1_c1 = outer0_X0_c1.wxyz;
var outer0_X2_c1 = outer0_X0_c1.zwxy;
var outer0_X3_c1 = outer0_X0_c1.yzwx;
ref var outer0_Y0 = ref outer0.Y;
ref var outer0_Y0_c0 = ref outer0_Y0.c0;
var outer0_Y1_c0 = outer0_Y0.c0.wxyz;
var outer0_Y2_c0 = outer0_Y0.c0.zwxy;
var outer0_Y3_c0 = outer0_Y0.c0.yzwx;
ref var outer0_Y0_c1 = ref outer0_Y0.c1;
var outer0_Y1_c1 = outer0_Y0_c1.wxyz;
var outer0_Y2_c1 = outer0_Y0_c1.zwxy;
var outer0_Y3_c1 = outer0_Y0_c1.yzwx;
ref var outer1_Value0 = ref outer1.Value;
ref var outer1_Value0_c0 = ref outer1_Value0.c0;
var outer1_Value1_c0 = outer1_Value0.c0.wxyz;
var outer1_Value2_c0 = outer1_Value0.c0.zwxy;
var outer1_Value3_c0 = outer1_Value0.c0.yzwx;
ref var outer1_Value0_c1 = ref outer1_Value0.c1;
var outer1_Value1_c1 = outer1_Value0_c1.wxyz;
var outer1_Value2_c1 = outer1_Value0_c1.zwxy;
var outer1_Value3_c1 = outer1_Value0_c1.yzwx;
for (var innerIndex = 0; innerIndex < EnemyPosition2D.Length; ++innerIndex)
{
var inner0 = EnemyPosition2D[innerIndex];
var inner1 = EnemyAliveState[innerIndex];
ref var inner0_X = ref inner0.X;
ref var inner0_Y = ref inner0.Y;
ref var inner1_Value = ref inner1.Value;
Exe(ref outer0_X0_c0, ref outer0_Y0_c0, ref outer1_Value0_c0, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X0_c0, ref outer0_Y0_c0, ref outer1_Value0_c0, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X0_c1, ref outer0_Y0_c1, ref outer1_Value0_c1, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X0_c1, ref outer0_Y0_c1, ref outer1_Value0_c1, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X1_c0, ref outer0_Y1_c0, ref outer1_Value1_c0, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X1_c0, ref outer0_Y1_c0, ref outer1_Value1_c0, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X1_c1, ref outer0_Y1_c1, ref outer1_Value1_c1, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X1_c1, ref outer0_Y1_c1, ref outer1_Value1_c1, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X2_c0, ref outer0_Y2_c0, ref outer1_Value2_c0, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X2_c0, ref outer0_Y2_c0, ref outer1_Value2_c0, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X2_c1, ref outer0_Y2_c1, ref outer1_Value2_c1, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X2_c1, ref outer0_Y2_c1, ref outer1_Value2_c1, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X3_c0, ref outer0_Y3_c0, ref outer1_Value3_c0, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X3_c0, ref outer0_Y3_c0, ref outer1_Value3_c0, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X3_c1, ref outer0_Y3_c1, ref outer1_Value3_c1, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
Exe(ref outer0_X3_c1, ref outer0_Y3_c1, ref outer1_Value3_c1, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2, tablePointer0, FirePositionArray.Length, tablePointer1, FireStartTimeArray.Length);
}
outer1_Value0.c0 = CloseAlive(CloseAlive(outer1_Value0.c0, outer1_Value1_c0.yzwx), CloseAlive(outer1_Value2_c0.zwxy, outer1_Value3_c0.wxyz));
outer1_Value0.c1 = CloseAlive(CloseAlive(outer1_Value0.c1, outer1_Value1_c1.yzwx), CloseAlive(outer1_Value2_c1.zwxy, outer1_Value3_c1.wxyz));
BulletAliveState[outerIndex] = outer1;
}
FireCount[0] = other2;
}
}
}
}
}
namespace Unity1Week.Hit
{
static partial class PlayerFireEnemyHitJob
{
[global::Unity.Burst.BurstCompile]
public unsafe partial struct Job : global::Unity.Jobs.IJob
{
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> FirePosition2D;
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.FireStartTime.Eight> FireFireStartTime;
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> EnemyPosition2D;
public global::Unity.Collections.NativeArray<ComponentTypes.AliveState.Eight> EnemyAliveState;
public float CollisionRadiusSquare;
public float FireDeadTime;
public global::Unity.Collections.NativeArray<int> EnemyKillCount;
public void Execute()
{
if (global::Unity.Burst.Intrinsics.X86.Fma.IsFmaSupported)
{
const int next1 = 0b00_11_10_01;
const int next2 = 0b01_00_11_10;
const int next3 = 0b10_01_00_11;
var other0 = new global::Unity.Burst.Intrinsics.v256(CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare);
var other1 = new global::Unity.Burst.Intrinsics.v256(FireDeadTime, FireDeadTime, FireDeadTime, FireDeadTime, FireDeadTime, FireDeadTime, FireDeadTime, FireDeadTime);
var other2 = EnemyKillCount[0];
var outerPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(FirePosition2D);
var outerPointer1 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(FireFireStartTime);
var innerOriginalPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(EnemyPosition2D);
var innerOriginalPointer1 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(EnemyAliveState);
for (
var outerIndex = 0;
outerIndex < FirePosition2D.Length;
++outerIndex,
outerPointer0 += sizeof(ComponentTypes.Position2D.Eight),
outerPointer1 += sizeof(ComponentTypes.FireStartTime.Eight)
)
{
var outer0_X = outerPointer0 + (0 << 5);
var outer0_Y = outerPointer0 + (1 << 5);
var outer1_Value = outerPointer1 + (0 << 5);
var outer0_X0 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outer0_X);
var outer0_Y0 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outer0_Y);
var outer1_Value0 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outer1_Value);
var outer0_X1 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X0, next1);
var outer0_Y1 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y0, next1);
var outer1_Value1 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value0, next1);
var outer0_X2 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X0, next2);
var outer0_Y2 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y0, next2);
var outer1_Value2 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value0, next2);
var outer0_X3 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X0, next3);
var outer0_Y3 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y0, next3);
var outer1_Value3 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value0, next3);
var outer0_X4 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer0_X0, outer0_X0, 0b0000_0001);
var outer0_Y4 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer0_Y0, outer0_Y0, 0b0000_0001);
var outer1_Value4 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute2f128_ps(outer1_Value0, outer1_Value0, 0b0000_0001);
var outer0_X5 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X4, next1);
var outer0_Y5 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y4, next1);
var outer1_Value5 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value4, next1);
var outer0_X6 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X4, next2);
var outer0_Y6 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y4, next2);
var outer1_Value6 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value4, next2);
var outer0_X7 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_X4, next3);
var outer0_Y7 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer0_Y4, next3);
var outer1_Value7 = global::Unity.Burst.Intrinsics.X86.Avx.mm256_permute_ps(outer1_Value4, next3);
var innerPointer0 = innerOriginalPointer0;
var innerPointer1 = innerOriginalPointer1;
for (
var innerIndex = 0;
innerIndex < EnemyPosition2D.Length;
++innerIndex,
innerPointer0 += sizeof(ComponentTypes.Position2D.Eight),
innerPointer1 += sizeof(ComponentTypes.AliveState.Eight)
)
{
var inner0_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(innerPointer0 + (0 << 5));
var inner0_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(innerPointer0 + (1 << 5));
var inner1_Value = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(innerPointer1 + (0 << 5));
Exe2(ref outer0_X0, ref outer0_Y0, ref outer1_Value0, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2);
Exe2(ref outer0_X1, ref outer0_Y1, ref outer1_Value1, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2);
Exe2(ref outer0_X2, ref outer0_Y2, ref outer1_Value2, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2);
Exe2(ref outer0_X3, ref outer0_Y3, ref outer1_Value3, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2);
Exe2(ref outer0_X4, ref outer0_Y4, ref outer1_Value4, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2);
Exe2(ref outer0_X5, ref outer0_Y5, ref outer1_Value5, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2);
Exe2(ref outer0_X6, ref outer0_Y6, ref outer1_Value6, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2);
Exe2(ref outer0_X7, ref outer0_Y7, ref outer1_Value7, ref inner0_X, ref inner0_Y, ref inner1_Value, ref other0, ref other1, ref other2);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(innerPointer1 + (0 << 5), inner1_Value);
}
}
EnemyKillCount[0] = other2;
return;
}
{
var other0 = new global::Unity.Mathematics.float4(CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare);
var other1 = new global::Unity.Mathematics.float4(FireDeadTime, FireDeadTime, FireDeadTime, FireDeadTime);
var other2 = EnemyKillCount[0];
for (var outerIndex = 0; outerIndex < FirePosition2D.Length; ++outerIndex)
{
var outer0 = FirePosition2D[outerIndex];
var outer1 = FireFireStartTime[outerIndex];
ref var outer0_X0 = ref outer0.X;
ref var outer0_X0_c0 = ref outer0_X0.c0;
var outer0_X1_c0 = outer0_X0.c0.wxyz;
var outer0_X2_c0 = outer0_X0.c0.zwxy;
var outer0_X3_c0 = outer0_X0.c0.yzwx;
ref var outer0_X0_c1 = ref outer0_X0.c1;
var outer0_X1_c1 = outer0_X0_c1.wxyz;
var outer0_X2_c1 = outer0_X0_c1.zwxy;
var outer0_X3_c1 = outer0_X0_c1.yzwx;
ref var outer0_Y0 = ref outer0.Y;
ref var outer0_Y0_c0 = ref outer0_Y0.c0;
var outer0_Y1_c0 = outer0_Y0.c0.wxyz;
var outer0_Y2_c0 = outer0_Y0.c0.zwxy;
var outer0_Y3_c0 = outer0_Y0.c0.yzwx;
ref var outer0_Y0_c1 = ref outer0_Y0.c1;
var outer0_Y1_c1 = outer0_Y0_c1.wxyz;
var outer0_Y2_c1 = outer0_Y0_c1.zwxy;
var outer0_Y3_c1 = outer0_Y0_c1.yzwx;
ref var outer1_Value0 = ref outer1.Value;
ref var outer1_Value0_c0 = ref outer1_Value0.c0;
var outer1_Value1_c0 = outer1_Value0.c0.wxyz;
var outer1_Value2_c0 = outer1_Value0.c0.zwxy;
var outer1_Value3_c0 = outer1_Value0.c0.yzwx;
ref var outer1_Value0_c1 = ref outer1_Value0.c1;
var outer1_Value1_c1 = outer1_Value0_c1.wxyz;
var outer1_Value2_c1 = outer1_Value0_c1.zwxy;
var outer1_Value3_c1 = outer1_Value0_c1.yzwx;
for (var innerIndex = 0; innerIndex < EnemyPosition2D.Length; ++innerIndex)
{
var inner0 = EnemyPosition2D[innerIndex];
var inner1 = EnemyAliveState[innerIndex];
ref var inner0_X = ref inner0.X;
ref var inner0_Y = ref inner0.Y;
ref var inner1_Value = ref inner1.Value;
Exe(ref outer0_X0_c0, ref outer0_Y0_c0, ref outer1_Value0_c0, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2);
Exe(ref outer0_X0_c0, ref outer0_Y0_c0, ref outer1_Value0_c0, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2);
Exe(ref outer0_X0_c1, ref outer0_Y0_c1, ref outer1_Value0_c1, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2);
Exe(ref outer0_X0_c1, ref outer0_Y0_c1, ref outer1_Value0_c1, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2);
Exe(ref outer0_X1_c0, ref outer0_Y1_c0, ref outer1_Value1_c0, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2);
Exe(ref outer0_X1_c0, ref outer0_Y1_c0, ref outer1_Value1_c0, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2);
Exe(ref outer0_X1_c1, ref outer0_Y1_c1, ref outer1_Value1_c1, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2);
Exe(ref outer0_X1_c1, ref outer0_Y1_c1, ref outer1_Value1_c1, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2);
Exe(ref outer0_X2_c0, ref outer0_Y2_c0, ref outer1_Value2_c0, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2);
Exe(ref outer0_X2_c0, ref outer0_Y2_c0, ref outer1_Value2_c0, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2);
Exe(ref outer0_X2_c1, ref outer0_Y2_c1, ref outer1_Value2_c1, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2);
Exe(ref outer0_X2_c1, ref outer0_Y2_c1, ref outer1_Value2_c1, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2);
Exe(ref outer0_X3_c0, ref outer0_Y3_c0, ref outer1_Value3_c0, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2);
Exe(ref outer0_X3_c0, ref outer0_Y3_c0, ref outer1_Value3_c0, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2);
Exe(ref outer0_X3_c1, ref outer0_Y3_c1, ref outer1_Value3_c1, ref inner0_X.c0, ref inner0_Y.c0, ref inner1_Value.c0, ref other0, ref other1, ref other2);
Exe(ref outer0_X3_c1, ref outer0_Y3_c1, ref outer1_Value3_c1, ref inner0_X.c1, ref inner0_Y.c1, ref inner1_Value.c1, ref other0, ref other1, ref other2);
EnemyAliveState[innerIndex] = inner1;
}
}
EnemyKillCount[0] = other2;
}
}
}
}
}
namespace Unity1Week.Hit
{
static partial class PlayerEnemyHitJob
{
[global::Unity.Burst.BurstCompile]
public unsafe partial struct Job : global::Unity.Jobs.IJob
{
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> EnemyPosition2D;
public global::Unity.Collections.NativeArray<ComponentTypes.AliveState.Eight> EnemyAliveState;
public float PlayerPositionX;
public float PlayerPositionY;
public float CollisionRadiusSquare;
public global::Unity.Collections.NativeArray<int> CollisionCount;
public void Execute()
{
if (global::Unity.Burst.Intrinsics.X86.Fma.IsFmaSupported)
{
var other0 = new global::Unity.Burst.Intrinsics.v256(PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX);
var other1 = new global::Unity.Burst.Intrinsics.v256(PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY);
var other2 = new global::Unity.Burst.Intrinsics.v256(CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare);
var other3 = CollisionCount[0];
var outerPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(EnemyPosition2D);
var outerPointer1 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(EnemyAliveState);
for (
var outerIndex = 0;
outerIndex < EnemyPosition2D.Length;
++outerIndex,
outerPointer0 += sizeof(ComponentTypes.Position2D.Eight),
outerPointer1 += sizeof(ComponentTypes.AliveState.Eight)
)
{
var outer0_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (0 << 5));
var outer0_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (1 << 5));
var outer1_Value = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer1 + (0 << 5));
Exe2(ref outer0_X, ref outer0_Y, ref outer1_Value, ref other0, ref other1, ref other2, ref other3);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer1 + (0 << 5), outer1_Value);
}
CollisionCount[0] = other3;
return;
}
{
var other0 = new global::Unity.Mathematics.float4(PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX);
var other1 = new global::Unity.Mathematics.float4(PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY);
var other2 = new global::Unity.Mathematics.float4(CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare);
var other3 = CollisionCount[0];
for (var outerIndex = 0; outerIndex < EnemyPosition2D.Length; ++outerIndex)
{
var outer0 = EnemyPosition2D[outerIndex];
var outer1 = EnemyAliveState[outerIndex];
Exe(ref outer0.X.c0, ref outer0.Y.c0, ref outer1.Value.c0, ref other0, ref other1, ref other2, ref other3);
Exe(ref outer0.X.c1, ref outer0.Y.c1, ref outer1.Value.c1, ref other0, ref other1, ref other2, ref other3);
EnemyAliveState[outerIndex] = outer1;
}
CollisionCount[0] = other3;
}
}
}
}
}
namespace Unity1Week.Hit
{
static partial class EnemyAttackPlayerHitJob
{
[global::Unity.Burst.BurstCompile]
public unsafe partial struct Job : global::Unity.Jobs.IJob
{
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> EnemyPosition2D;
public global::Unity.Collections.NativeArray<ComponentTypes.AliveState.Eight> EnemyAliveState;
public float PlayerPositionX;
public float PlayerPositionY;
public float CollisionRadiusSquare;
public global::Unity.Collections.NativeArray<int> CollisionCount;
public void Execute()
{
if (global::Unity.Burst.Intrinsics.X86.Fma.IsFmaSupported)
{
var other0 = new global::Unity.Burst.Intrinsics.v256(PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX);
var other1 = new global::Unity.Burst.Intrinsics.v256(PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY);
var other2 = new global::Unity.Burst.Intrinsics.v256(CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare);
var other3 = CollisionCount[0];
var outerPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(EnemyPosition2D);
var outerPointer1 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(EnemyAliveState);
for (
var outerIndex = 0;
outerIndex < EnemyPosition2D.Length;
++outerIndex,
outerPointer0 += sizeof(ComponentTypes.Position2D.Eight),
outerPointer1 += sizeof(ComponentTypes.AliveState.Eight)
)
{
var outer0_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (0 << 5));
var outer0_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (1 << 5));
var outer1_Value = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer1 + (0 << 5));
Exe2(ref outer0_X, ref outer0_Y, ref outer1_Value, ref other0, ref other1, ref other2, ref other3);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer1 + (0 << 5), outer1_Value);
}
CollisionCount[0] = other3;
return;
}
{
var other0 = new global::Unity.Mathematics.float4(PlayerPositionX, PlayerPositionX, PlayerPositionX, PlayerPositionX);
var other1 = new global::Unity.Mathematics.float4(PlayerPositionY, PlayerPositionY, PlayerPositionY, PlayerPositionY);
var other2 = new global::Unity.Mathematics.float4(CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare, CollisionRadiusSquare);
var other3 = CollisionCount[0];
for (var outerIndex = 0; outerIndex < EnemyPosition2D.Length; ++outerIndex)
{
var outer0 = EnemyPosition2D[outerIndex];
var outer1 = EnemyAliveState[outerIndex];
Exe(ref outer0.X.c0, ref outer0.Y.c0, ref outer1.Value.c0, ref other0, ref other1, ref other2, ref other3);
Exe(ref outer0.X.c1, ref outer0.Y.c1, ref outer1.Value.c1, ref other0, ref other1, ref other2, ref other3);
EnemyAliveState[outerIndex] = outer1;
}
CollisionCount[0] = other3;
}
}
}
}
}
namespace Unity1Week
{
static partial class MultiMove
{
[global::Unity.Burst.BurstCompile]
public unsafe partial struct Job : global::Unity.Jobs.IJob
{
public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> Position2D;
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.Speed2D.Eight> Speed2D;
public float DeltaTime;
public void Execute()
{
if (global::Unity.Burst.Intrinsics.X86.Fma.IsFmaSupported)
{
var other0 = new global::Unity.Burst.Intrinsics.v256(DeltaTime, DeltaTime, DeltaTime, DeltaTime, DeltaTime, DeltaTime, DeltaTime, DeltaTime);
var outerPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(Position2D);
var outerPointer1 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(Speed2D);
for (
var outerIndex = 0;
outerIndex < Position2D.Length;
++outerIndex,
outerPointer0 += sizeof(ComponentTypes.Position2D.Eight),
outerPointer1 += sizeof(ComponentTypes.Speed2D.Eight)
)
{
var outer0_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (0 << 5));
var outer0_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (1 << 5));
var outer1_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer1 + (0 << 5));
var outer1_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer1 + (1 << 5));
Exe(ref outer0_X, ref outer0_Y, ref outer1_X, ref outer1_Y, ref other0);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer0 + (0 << 5), outer0_X);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer0 + (1 << 5), outer0_Y);
}
return;
}
{
var other0 = new global::Unity.Mathematics.float4(DeltaTime, DeltaTime, DeltaTime, DeltaTime);
for (var outerIndex = 0; outerIndex < Position2D.Length; ++outerIndex)
{
var outer0 = Position2D[outerIndex];
var outer1 = Speed2D[outerIndex];
Exe(ref outer0.X.c0, ref outer0.Y.c0, ref outer1.X.c0, ref outer1.Y.c0, ref other0);
Exe(ref outer0.X.c1, ref outer0.Y.c1, ref outer1.X.c1, ref outer1.Y.c1, ref other0);
Position2D[outerIndex] = outer0;
}
}
}
}
}
}
namespace Unity1Week
{
static partial class CalculateMoveSpeedJob
{
[global::Unity.Burst.BurstCompile]
public unsafe partial struct Job : global::Unity.Jobs.IJob
{
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> Position2D;
public global::Unity.Collections.NativeArray<ComponentTypes.Speed2D.Eight> Speed2D;
public float RcpCellSize;
public int CellWidthCount;
public int CellCountAdjustment;
public int MaxCellCountInclusive;
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<float> SpeedSetting;
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<int> ChipKind;
public void Execute()
{
var tablePointer0 = global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr(SpeedSetting);
var tablePointer1 = global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr(ChipKind);
if (global::Unity.Burst.Intrinsics.X86.Fma.IsFmaSupported)
{
var other0 = new global::Unity.Burst.Intrinsics.v256(RcpCellSize, RcpCellSize, RcpCellSize, RcpCellSize, RcpCellSize, RcpCellSize, RcpCellSize, RcpCellSize);
var other1 = new global::Unity.Burst.Intrinsics.v256(CellWidthCount, CellWidthCount, CellWidthCount, CellWidthCount, CellWidthCount, CellWidthCount, CellWidthCount, CellWidthCount);
var other2 = new global::Unity.Burst.Intrinsics.v256(CellCountAdjustment, CellCountAdjustment, CellCountAdjustment, CellCountAdjustment, CellCountAdjustment, CellCountAdjustment, CellCountAdjustment, CellCountAdjustment);
var other3 = new global::Unity.Burst.Intrinsics.v256(MaxCellCountInclusive, MaxCellCountInclusive, MaxCellCountInclusive, MaxCellCountInclusive, MaxCellCountInclusive, MaxCellCountInclusive, MaxCellCountInclusive, MaxCellCountInclusive);
var outerPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(Position2D);
var outerPointer1 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(Speed2D);
for (
var outerIndex = 0;
outerIndex < Position2D.Length;
++outerIndex,
outerPointer0 += sizeof(ComponentTypes.Position2D.Eight),
outerPointer1 += sizeof(ComponentTypes.Speed2D.Eight)
)
{
var outer0_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (0 << 5));
var outer0_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (1 << 5));
var outer1_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer1 + (0 << 5));
var outer1_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer1 + (1 << 5));
Exe2(ref outer0_X, ref outer0_Y, ref outer1_X, ref outer1_Y, ref other0, ref other1, ref other2, ref other3, tablePointer0, SpeedSetting.Length, tablePointer1, ChipKind.Length);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer1 + (0 << 5), outer1_X);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer1 + (1 << 5), outer1_Y);
}
return;
}
{
var other0 = new global::Unity.Mathematics.float4(RcpCellSize, RcpCellSize, RcpCellSize, RcpCellSize);
var other1 = new global::Unity.Mathematics.int4(CellWidthCount, CellWidthCount, CellWidthCount, CellWidthCount);
var other2 = new global::Unity.Mathematics.int4(CellCountAdjustment, CellCountAdjustment, CellCountAdjustment, CellCountAdjustment);
var other3 = new global::Unity.Mathematics.int4(MaxCellCountInclusive, MaxCellCountInclusive, MaxCellCountInclusive, MaxCellCountInclusive);
for (var outerIndex = 0; outerIndex < Position2D.Length; ++outerIndex)
{
var outer0 = Position2D[outerIndex];
var outer1 = Speed2D[outerIndex];
Exe(ref outer0.X.c0, ref outer0.Y.c0, ref outer1.X.c0, ref outer1.Y.c0, ref other0, ref other1, ref other2, ref other3, tablePointer0, SpeedSetting.Length, tablePointer1, ChipKind.Length);
Exe(ref outer0.X.c1, ref outer0.Y.c1, ref outer1.X.c1, ref outer1.Y.c1, ref other0, ref other1, ref other2, ref other3, tablePointer0, SpeedSetting.Length, tablePointer1, ChipKind.Length);
Speed2D[outerIndex] = outer1;
}
}
}
}
}
}
namespace Unity1Week
{
static partial class ChangeDestination
{
[global::Unity.Burst.BurstCompile]
public unsafe partial struct Job : global::Unity.Jobs.IJob
{
public global::Unity.Collections.NativeArray<ComponentTypes.Destination2D.Eight> Destination2D;
public float TargetX;
public float TargetY;
public void Execute()
{
if (global::Unity.Burst.Intrinsics.X86.Fma.IsFmaSupported)
{
var other0 = new global::Unity.Burst.Intrinsics.v256(TargetX, TargetX, TargetX, TargetX, TargetX, TargetX, TargetX, TargetX);
var other1 = new global::Unity.Burst.Intrinsics.v256(TargetY, TargetY, TargetY, TargetY, TargetY, TargetY, TargetY, TargetY);
var outerPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(Destination2D);
for (
var outerIndex = 0;
outerIndex < Destination2D.Length;
++outerIndex,
outerPointer0 += sizeof(ComponentTypes.Destination2D.Eight)
)
{
var outer0_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (0 << 5));
var outer0_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (1 << 5));
Exe2(ref outer0_X, ref outer0_Y, ref other0, ref other1);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer0 + (0 << 5), outer0_X);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer0 + (1 << 5), outer0_Y);
}
return;
}
{
var other0 = new global::Unity.Mathematics.float4(TargetX, TargetX, TargetX, TargetX);
var other1 = new global::Unity.Mathematics.float4(TargetY, TargetY, TargetY, TargetY);
for (var outerIndex = 0; outerIndex < Destination2D.Length; ++outerIndex)
{
var outer0 = Destination2D[outerIndex];
Exe(ref outer0.X.c0, ref outer0.Y.c0, ref other0, ref other1);
Exe(ref outer0.X.c1, ref outer0.Y.c1, ref other0, ref other1);
Destination2D[outerIndex] = outer0;
}
}
}
}
}
}
namespace Unity1Week
{
static partial class RandomlyChangeDestination
{
[global::Unity.Burst.BurstCompile]
public unsafe partial struct Job : global::Unity.Jobs.IJob
{
public global::Unity.Collections.NativeArray<ComponentTypes.Destination2D.Eight> Destination2D;
public global::Unity.Collections.NativeArray<Unity.Mathematics.Random> RandomArray;
public float TwoMinInclusiveMinusMaxExclusive;
public float MaxExclusiveMinusMinInclusive;
public void Execute()
{
if (global::Unity.Burst.Intrinsics.X86.Fma.IsFmaSupported)
{
var other0 = RandomArray[0];
var other1 = new global::Unity.Burst.Intrinsics.v256(TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive);
var other2 = new global::Unity.Burst.Intrinsics.v256(MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive);
var outerPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(Destination2D);
for (
var outerIndex = 0;
outerIndex < Destination2D.Length;
++outerIndex,
outerPointer0 += sizeof(ComponentTypes.Destination2D.Eight)
)
{
var outer0_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (0 << 5));
var outer0_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (1 << 5));
Exe2(ref outer0_X, ref outer0_Y, ref other0, ref other1, ref other2);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer0 + (0 << 5), outer0_X);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer0 + (1 << 5), outer0_Y);
}
RandomArray[0] = other0;
return;
}
{
var other0 = RandomArray[0];
var other1 = new global::Unity.Mathematics.float4(TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive, TwoMinInclusiveMinusMaxExclusive);
var other2 = new global::Unity.Mathematics.float4(MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive, MaxExclusiveMinusMinInclusive);
for (var outerIndex = 0; outerIndex < Destination2D.Length; ++outerIndex)
{
var outer0 = Destination2D[outerIndex];
Exe(ref outer0.X.c0, ref outer0.Y.c0, ref other0, ref other1, ref other2);
Exe(ref outer0.X.c1, ref outer0.Y.c1, ref other0, ref other1, ref other2);
Destination2D[outerIndex] = outer0;
}
RandomArray[0] = other0;
}
}
}
}
}
namespace Unity1Week
{
static partial class KillOutOfBounds
{
[global::Unity.Burst.BurstCompile]
public unsafe partial struct Job : global::Unity.Jobs.IJob
{
[global::Unity.Collections.ReadOnly] public global::Unity.Collections.NativeArray<ComponentTypes.Position2D.Eight> Position2D;
public global::Unity.Collections.NativeArray<ComponentTypes.AliveState.Eight> AliveState;
public float MinInclusive;
public float MaxExclusive;
public void Execute()
{
if (global::Unity.Burst.Intrinsics.X86.Fma.IsFmaSupported)
{
var other0 = new global::Unity.Burst.Intrinsics.v256(MinInclusive, MinInclusive, MinInclusive, MinInclusive, MinInclusive, MinInclusive, MinInclusive, MinInclusive);
var other1 = new global::Unity.Burst.Intrinsics.v256(MaxExclusive, MaxExclusive, MaxExclusive, MaxExclusive, MaxExclusive, MaxExclusive, MaxExclusive, MaxExclusive);
var outerPointer0 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(Position2D);
var outerPointer1 = (byte*)global::Unity.Collections.LowLevel.Unsafe.NativeArrayUnsafeUtility.GetUnsafeBufferPointerWithoutChecks(AliveState);
for (
var outerIndex = 0;
outerIndex < Position2D.Length;
++outerIndex,
outerPointer0 += sizeof(ComponentTypes.Position2D.Eight),
outerPointer1 += sizeof(ComponentTypes.AliveState.Eight)
)
{
var outer0_X = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (0 << 5));
var outer0_Y = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer0 + (1 << 5));
var outer1_Value = global::Unity.Burst.Intrinsics.X86.Avx.mm256_load_ps(outerPointer1 + (0 << 5));
Exe2(ref outer0_X, ref outer0_Y, ref outer1_Value, ref other0, ref other1);
global::Unity.Burst.Intrinsics.X86.Avx.mm256_store_ps(outerPointer1 + (0 << 5), outer1_Value);
}
return;
}
{
var other0 = new global::Unity.Mathematics.float4(MinInclusive, MinInclusive, MinInclusive, MinInclusive);
var other1 = new global::Unity.Mathematics.float4(MaxExclusive, MaxExclusive, MaxExclusive, MaxExclusive);
for (var outerIndex = 0; outerIndex < Position2D.Length; ++outerIndex)
{
var outer0 = Position2D[outerIndex];
var outer1 = AliveState[outerIndex];
Exe(ref outer0.X.c0, ref outer0.Y.c0, ref outer1.Value.c0, ref other0, ref other1);
Exe(ref outer0.X.c1, ref outer0.Y.c1, ref outer1.Value.c1, ref other0, ref other1);
AliveState[outerIndex] = outer1;
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment