test(ci): harden scheduling and allocation gates
This commit is contained in:
parent
c4608b1127
commit
d123c4b67c
11 changed files with 101 additions and 87 deletions
|
|
@ -138,20 +138,12 @@ public sealed class DirectionalShadowCascadeFitterTests
|
|||
DirectionalShadowCascadeFitInput input = CameraInput(
|
||||
Vector3.Zero,
|
||||
DirectionalShadowQuality.For(DirectionalShadowPreset.High));
|
||||
Span<DirectionalShadowCascade> cascades =
|
||||
stackalloc DirectionalShadowCascade[4];
|
||||
var cascades = new DirectionalShadowCascade[4];
|
||||
|
||||
// Cross the tiered-JIT promotion threshold before taking the thread's
|
||||
// allocation counter; measuring immediately after one call makes the
|
||||
// runtime's compilation bookkeeping look like renderer allocation.
|
||||
for (int i = 0; i < 128; i++)
|
||||
DirectionalShadowCascadeFitter.Fit(in input, cascades);
|
||||
long before = GC.GetAllocatedBytesForCurrentThread();
|
||||
for (int i = 0; i < 100; i++)
|
||||
DirectionalShadowCascadeFitter.Fit(in input, cascades);
|
||||
long after = GC.GetAllocatedBytesForCurrentThread();
|
||||
|
||||
Assert.Equal(0, after - before);
|
||||
ZeroAllocationProbe.AssertAllocatesNothing(
|
||||
"DirectionalShadowCascadeFitter.Fit",
|
||||
() => DirectionalShadowCascadeFitter.Fit(in input, cascades),
|
||||
batchSize: 100);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue