[+] IRandomDevice.NextArrayVec2Fast

[+] IRandomDevice.NextArrayVec3Fast
[+] IRandomDevice.NextArrayVec4Fast
[+] AuRNG.RngArrayVec2Fast
[+] AuRNG.RngArrayVec3Fast
[+] AuRNG.RngArrayVec4Fast
This commit is contained in:
Reece Wilson 2024-04-24 14:33:06 +01:00
parent a526d67bc3
commit 54904957f2
5 changed files with 60 additions and 0 deletions

View File

@ -52,12 +52,15 @@ namespace Aurora::RNG
virtual AuList<AuInt64> NextArrayI64(AuUInt32 uCount) = 0; virtual AuList<AuInt64> NextArrayI64(AuUInt32 uCount) = 0;
virtual AuList<AuUInt64> NextArrayU64(AuUInt32 uCount) = 0; virtual AuList<AuUInt64> NextArrayU64(AuUInt32 uCount) = 0;
virtual AuList<AuVec2> NextArrayVec2(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB) = 0; virtual AuList<AuVec2> NextArrayVec2(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB) = 0;
virtual AuList<AuVec2> NextArrayVec2Fast(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB) = 0;
virtual AuList<AuVec2> NextArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max) = 0; virtual AuList<AuVec2> NextArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max) = 0;
virtual AuList<AuVec2> NextArrayVec2SortedFast(AuUInt32 uCount, AuVec2 min, AuVec2 max) = 0; virtual AuList<AuVec2> NextArrayVec2SortedFast(AuUInt32 uCount, AuVec2 min, AuVec2 max) = 0;
virtual AuList<AuVec3> NextArrayVec3(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB) = 0; virtual AuList<AuVec3> NextArrayVec3(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB) = 0;
virtual AuList<AuVec3> NextArrayVec3Fast(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB) = 0;
virtual AuList<AuVec3> NextArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max) = 0; virtual AuList<AuVec3> NextArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max) = 0;
virtual AuList<AuVec3> NextArrayVec3SortedFast(AuUInt32 uCount, AuVec3 min, AuVec3 max) = 0; virtual AuList<AuVec3> NextArrayVec3SortedFast(AuUInt32 uCount, AuVec3 min, AuVec3 max) = 0;
virtual AuList<AuVec4> NextArrayVec4(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB) = 0; virtual AuList<AuVec4> NextArrayVec4(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB) = 0;
virtual AuList<AuVec4> NextArrayVec4Fast(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB) = 0;
virtual AuList<AuVec4> NextArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max) = 0; virtual AuList<AuVec4> NextArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max) = 0;
virtual AuList<AuVec4> NextArrayVec4SortedFast(AuUInt32 uCount, AuVec4 min, AuVec4 max) = 0; virtual AuList<AuVec4> NextArrayVec4SortedFast(AuUInt32 uCount, AuVec4 min, AuVec4 max) = 0;
virtual AuList<double> NextArrayDouble(AuUInt32 uCount) = 0; virtual AuList<double> NextArrayDouble(AuUInt32 uCount) = 0;

View File

@ -61,12 +61,15 @@ namespace Aurora::RNG
AUKN_SYM AuList<AuInt64> RngArrayI64(AuUInt32 uCount); AUKN_SYM AuList<AuInt64> RngArrayI64(AuUInt32 uCount);
AUKN_SYM AuList<AuUInt64> RngArrayU64(AuUInt32 uCount); AUKN_SYM AuList<AuUInt64> RngArrayU64(AuUInt32 uCount);
AUKN_SYM AuList<AuVec2> RngArrayVec2(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB); AUKN_SYM AuList<AuVec2> RngArrayVec2(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB);
AUKN_SYM AuList<AuVec2> RngArrayVec2Fast(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB);
AUKN_SYM AuList<AuVec2> RngArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max); AUKN_SYM AuList<AuVec2> RngArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max);
AUKN_SYM AuList<AuVec2> RngArrayVec2SortedFast(AuUInt32 uCount, AuVec2 min, AuVec2 max); AUKN_SYM AuList<AuVec2> RngArrayVec2SortedFast(AuUInt32 uCount, AuVec2 min, AuVec2 max);
AUKN_SYM AuList<AuVec3> RngArrayVec3(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB); AUKN_SYM AuList<AuVec3> RngArrayVec3(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB);
AUKN_SYM AuList<AuVec3> RngArrayVec3Fast(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB);
AUKN_SYM AuList<AuVec3> RngArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max); AUKN_SYM AuList<AuVec3> RngArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max);
AUKN_SYM AuList<AuVec3> RngArrayVec3SortedFast(AuUInt32 uCount, AuVec3 min, AuVec3 max); AUKN_SYM AuList<AuVec3> RngArrayVec3SortedFast(AuUInt32 uCount, AuVec3 min, AuVec3 max);
AUKN_SYM AuList<AuVec4> RngArrayVec4(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB); AUKN_SYM AuList<AuVec4> RngArrayVec4(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB);
AUKN_SYM AuList<AuVec4> RngArrayVec4Fast(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB);
AUKN_SYM AuList<AuVec4> RngArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max); AUKN_SYM AuList<AuVec4> RngArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max);
AUKN_SYM AuList<AuVec4> RngArrayVec4SortedFast(AuUInt32 uCount, AuVec4 min, AuVec4 max); AUKN_SYM AuList<AuVec4> RngArrayVec4SortedFast(AuUInt32 uCount, AuVec4 min, AuVec4 max);
AUKN_SYM AuList<double> RngArrayDouble(AuUInt32 uCount); AUKN_SYM AuList<double> RngArrayDouble(AuUInt32 uCount);

View File

@ -188,6 +188,11 @@ namespace Aurora::RNG
return gFastDevice->NextArrayVec2(uCount, boundA, boundB); return gFastDevice->NextArrayVec2(uCount, boundA, boundB);
} }
AUKN_SYM AuList<AuVec2> RngArrayVec2Fast(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB)
{
return gFastDevice->NextArrayVec2Fast(uCount, boundA, boundB);
}
AUKN_SYM AuList<AuVec2> RngArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max) AUKN_SYM AuList<AuVec2> RngArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max)
{ {
return gFastDevice->NextArrayVec2Sorted(uCount, min, max); return gFastDevice->NextArrayVec2Sorted(uCount, min, max);
@ -198,6 +203,11 @@ namespace Aurora::RNG
return gFastDevice->NextArrayVec3(uCount, boundA, boundB); return gFastDevice->NextArrayVec3(uCount, boundA, boundB);
} }
AUKN_SYM AuList<AuVec3> RngArrayVec3Fast(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB)
{
return gFastDevice->NextArrayVec3Fast(uCount, boundA, boundB);
}
AUKN_SYM AuList<AuVec3> RngArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max) AUKN_SYM AuList<AuVec3> RngArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max)
{ {
return gFastDevice->NextArrayVec3Sorted(uCount, min, max); return gFastDevice->NextArrayVec3Sorted(uCount, min, max);
@ -208,6 +218,11 @@ namespace Aurora::RNG
return gFastDevice->NextArrayVec4(uCount, boundA, boundB); return gFastDevice->NextArrayVec4(uCount, boundA, boundB);
} }
AUKN_SYM AuList<AuVec4> RngArrayVec4Fast(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB)
{
return gFastDevice->NextArrayVec4Fast(uCount, boundA, boundB);
}
AUKN_SYM AuList<AuVec4> RngArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max) AUKN_SYM AuList<AuVec4> RngArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max)
{ {
return gFastDevice->NextArrayVec4Sorted(uCount, min, max); return gFastDevice->NextArrayVec4Sorted(uCount, min, max);

View File

@ -747,6 +747,16 @@ namespace Aurora::RNG
return NextArrayVec2Sorted(uCount, mins, maxs); return NextArrayVec2Sorted(uCount, mins, maxs);
} }
AuList<AuVec2> RandomDevice::NextArrayVec2Fast(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB)
{
AuVec2 mins, maxs;
mins[0] = AuMin(boundA[0], boundB[0]);
mins[1] = AuMin(boundA[1], boundB[1]);
maxs[0] = AuMax(boundA[0], boundB[0]);
maxs[1] = AuMax(boundA[1], boundB[1]);
return NextArrayVec2SortedFast(uCount, mins, maxs);
}
AuList<AuVec2> RandomDevice::NextArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max) AuList<AuVec2> RandomDevice::NextArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max)
{ {
AuVec2 range; AuVec2 range;
@ -813,6 +823,18 @@ namespace Aurora::RNG
return NextArrayVec3Sorted(uCount, mins, maxs); return NextArrayVec3Sorted(uCount, mins, maxs);
} }
AuList<AuVec3> RandomDevice::NextArrayVec3Fast(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB)
{
AuVec3 mins, maxs;
mins[0] = AuMin(boundA[0], boundB[0]);
mins[1] = AuMin(boundA[1], boundB[1]);
mins[2] = AuMin(boundA[2], boundB[2]);
maxs[0] = AuMax(boundA[0], boundB[0]);
maxs[1] = AuMax(boundA[1], boundB[1]);
maxs[2] = AuMax(boundA[2], boundB[2]);
return NextArrayVec3SortedFast(uCount, mins, maxs);
}
AuList<AuVec3> RandomDevice::NextArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max) AuList<AuVec3> RandomDevice::NextArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max)
{ {
AuVec3 range; AuVec3 range;
@ -887,6 +909,20 @@ namespace Aurora::RNG
return NextArrayVec4Sorted(uCount, mins, maxs); return NextArrayVec4Sorted(uCount, mins, maxs);
} }
AuList<AuVec4> RandomDevice::NextArrayVec4Fast(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB)
{
AuVec4 mins, maxs;
mins[0] = AuMin(boundA[0], boundB[0]);
mins[1] = AuMin(boundA[1], boundB[1]);
mins[2] = AuMin(boundA[2], boundB[2]);
mins[3] = AuMin(boundA[3], boundB[3]);
maxs[0] = AuMax(boundA[0], boundB[0]);
maxs[1] = AuMax(boundA[1], boundB[1]);
maxs[2] = AuMax(boundA[2], boundB[2]);
maxs[3] = AuMax(boundA[3], boundB[3]);
return NextArrayVec4SortedFast(uCount, mins, maxs);
}
AuList<AuVec4> RandomDevice::NextArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max) AuList<AuVec4> RandomDevice::NextArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max)
{ {
AuVec4 range; AuVec4 range;

View File

@ -50,12 +50,15 @@ namespace Aurora::RNG
AuList<AuInt64> NextArrayI64(AuUInt32 uCount) override; AuList<AuInt64> NextArrayI64(AuUInt32 uCount) override;
AuList<AuUInt64> NextArrayU64(AuUInt32 uCount) override; AuList<AuUInt64> NextArrayU64(AuUInt32 uCount) override;
AuList<AuVec2> NextArrayVec2(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB) override; AuList<AuVec2> NextArrayVec2(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB) override;
AuList<AuVec2> NextArrayVec2Fast(AuUInt32 uCount, AuVec2 boundA, AuVec2 boundB) override;
AuList<AuVec2> NextArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max) override; AuList<AuVec2> NextArrayVec2Sorted(AuUInt32 uCount, AuVec2 min, AuVec2 max) override;
AuList<AuVec2> NextArrayVec2SortedFast(AuUInt32 uCount, AuVec2 min, AuVec2 max) override; AuList<AuVec2> NextArrayVec2SortedFast(AuUInt32 uCount, AuVec2 min, AuVec2 max) override;
AuList<AuVec3> NextArrayVec3(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB) override; AuList<AuVec3> NextArrayVec3(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB) override;
AuList<AuVec3> NextArrayVec3Fast(AuUInt32 uCount, AuVec3 boundA, AuVec3 boundB) override;
AuList<AuVec3> NextArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max) override; AuList<AuVec3> NextArrayVec3Sorted(AuUInt32 uCount, AuVec3 min, AuVec3 max) override;
AuList<AuVec3> NextArrayVec3SortedFast(AuUInt32 uCount, AuVec3 min, AuVec3 max) override; AuList<AuVec3> NextArrayVec3SortedFast(AuUInt32 uCount, AuVec3 min, AuVec3 max) override;
AuList<AuVec4> NextArrayVec4(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB) override; AuList<AuVec4> NextArrayVec4(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB) override;
AuList<AuVec4> NextArrayVec4Fast(AuUInt32 uCount, AuVec4 boundA, AuVec4 boundB) override;
AuList<AuVec4> NextArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max) override; AuList<AuVec4> NextArrayVec4Sorted(AuUInt32 uCount, AuVec4 min, AuVec4 max) override;
AuList<AuVec4> NextArrayVec4SortedFast(AuUInt32 uCount, AuVec4 min, AuVec4 max) override; AuList<AuVec4> NextArrayVec4SortedFast(AuUInt32 uCount, AuVec4 min, AuVec4 max) override;
AuList<double> NextArrayDouble(AuUInt32 uCount) override; AuList<double> NextArrayDouble(AuUInt32 uCount) override;