feat(render): Campaign V slice V4t-2 — the world texture stack crosses to GpuTextureSlot
The rest of V4t. The composite, particle and shared-atlas texture paths now
hand out the device's GpuTextureSlot instead of a raw 64-bit
ARB_bindless_texture handle, and GroupKey, CachedBatch and ObjectRenderBatch
carry that slot. WbDrawDispatcher, EnvCellRenderer and ParticleRenderer retire
their interim GlBindlessHandleTable instances and share the device's one
table, exactly as V4t-1 did for terrain. Nothing about world submission
changes otherwise: these three renderers are still raw GL, still bind binding
9 themselves, and still draw the same geometry in the same order.
**What produces a slot now.** CompositeTextureArrayCache's GL backend interns
each array's handle when it makes it resident and retires the entry when it
makes it non-resident, so the pair is created and destroyed together and the
cache above it never learns a device exists — the fake backend its tests use
mints a stand-in slot. TextureCache.AcquireParticleTexture does the same for
the one-layer particle arrays it owns, including on its rollback path.
ObjectMeshManager registers each shared atlas's wrap/clamp handles at batch
upload; registration is idempotent by handle, so the many batches sharing an
atlas share its entry.
**Slot release is stricter than what it replaces, not looser.** The interim
tables never released anything — the class comment said so — and they grew
without bound. The device's table has a fixed 16,384-slot capacity, so an
unreleased entry is now a leak with an end. Every producer therefore retires
its entry: the composite backend at MakeNonResident, the particle backend at
MakeNonResident, and ObjectMeshManager when a retiring atlas's PHYSICAL
retirement completes — the point at which its handles are already non-resident
and its texture already deleted. That last one needs the handles snapshotted
at eviction, because ManagedGLTextureArray.Dispose zeroes its own copies as
its first act. Teardown deliberately does not release: the device is being torn
down alongside its callers, so there is nothing left to recycle a slot into,
and deferring work through a possibly-disposed retirement queue would turn a
clean shutdown into a throw.
**The default value became load-bearing, and that is the one real hazard here.**
BindlessTextureLocation could say "not resolved" with handle 0, because no
texture has handle 0. A slot index has no spare value — default(GpuTextureSlot)
is real slot 0 — so a positional record would have turned every
budget-rejected or still-uploading composite into a silent read of whichever
texture registered first. That is the magenta-placeholder failure shape one
layer down. The type is now a struct storing the slot one-based, so default IS
Unresolved, with a test pinning both halves: default is unresolved, and a
location naming slot 0 is resolved and distinguishable from it. Elsewhere the
sentinel is already exact — GpuTextureSlot.Unassigned is 0xFFFFFFFF, which is
common.glsl's ACDREAM_TEXTURE_NONE — so the classify path's "no texture yet"
test and the particle billboard's untextured branch are unchanged in meaning.
**GroupKey ordering is preserved because the key never ordered anything.**
Handle→slot is a bijection (the device interns one slot per resident handle),
so the same (entity, batch) pairs bucket together as before. The key reaches
equality, hashing and the scene-digest fingerprints — never a comparator:
opaque and translucent groups sort by cull mode then camera distance, the
delayed-alpha path by viewer distance then submission ordinal, and group
enumeration follows the persistent dictionary's insertion order, which a
changed hash does not disturb. The digests hash the slot index where they
hashed the handle; both sides of the render-shadow comparison compute them the
same way, so the value changing is invisible to it. Read
CompareOpaqueSubmissionOrder, CompareTransparentSubmissionOrder and
AlphaFingerprintComparer before doubting this — sort-order drift is a
pixel-visible regression class this project has hit, and it is why the check
was made before the retype rather than after.
**One visibility change, forced rather than chosen.** BindlessTextureLocation
was public and now holds an internal contract type, so it is internal;
ObjectRenderBatch.TextureSlot is internal on an otherwise public class for the
same reason. Nothing outside this assembly and its InternalsVisibleTo test
assemblies named either.
**SkyRenderer keeps its interim table**, and the report should say why: the
sky's textures are minted by SkyRenderer itself from TextureCache's raw GL
texture names, which this slice does not retype, so it would be the one
consumer registering handles it produced — a different shape from the world
stack. The offline gate also masks the sky band, so the one automated
instrument here cannot see a sky regression. V4f owns that renderer.
**Gates.** GL offline pixel gate vs cb2a70b8, measured twice: 31 and 22
differing pixels of 563,200 (5.50e-05, 3.91e-05). The first is above the
plan's documented 15-23 px band, so a control was measured rather than
assumed: two same-commit captures at this tree differ by 19 px, and — the
decisive number — a capture at V4t-1 and a capture at this commit differ by
9 px, fewer than the same-commit control. Maximum channel delta is 41-52 in
every pair including the controls, i.e. the differing pixels are drawn from
one flickering population, not from moved geometry. tools/run-repeat-connected-gate.ps1
-Runs 3: 3/3 RENDERED on both the desktop witness and the client capture. One
Vulkan composition-host run with VK_LAYER_KHRONOS_validation proven inserted
by the loader: zero errors, zero warnings, converged ownership ledger. App
tests 4,077 / 3 skips and the complete Release suite 9,140 / 5 — both the
4,075 and 9,138 baselines plus the two tests added here.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
b8bcaa3ef2
commit
565c351f93
17 changed files with 463 additions and 281 deletions
|
|
@ -6,6 +6,54 @@ namespace AcDream.App.Tests.Rendering;
|
|||
|
||||
public sealed class CompositeTextureArrayCachePolicyTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Campaign V slice V4t: the retype from a 64-bit bindless handle to
|
||||
/// <see cref="AcDream.App.Rendering.Gpu.GpuTextureSlot"/> removed the spare
|
||||
/// value that used to mean "not resolved" — no texture has handle 0, but
|
||||
/// slot 0 is a perfectly good slot. This pins the replacement invariant:
|
||||
/// the DEFAULT location is unresolved, and it is distinguishable from a
|
||||
/// location that genuinely names slot 0. Getting this wrong would not throw;
|
||||
/// it would draw the first-registered texture on every unresolved
|
||||
/// composite, which is the magenta-placeholder failure shape one layer down.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DefaultLocationIsUnresolvedAndDistinctFromSlotZero()
|
||||
{
|
||||
Assert.False(default(BindlessTextureLocation).IsResolved);
|
||||
Assert.Equal(BindlessTextureLocation.Unresolved, default(BindlessTextureLocation));
|
||||
Assert.False(BindlessTextureLocation.Unresolved.Slot.IsAssigned);
|
||||
|
||||
var slotZero = new BindlessTextureLocation(
|
||||
new AcDream.App.Rendering.Gpu.GpuTextureSlot(0), layer: 3);
|
||||
Assert.True(slotZero.IsResolved);
|
||||
Assert.Equal(0u, slotZero.Slot.Index);
|
||||
Assert.Equal(3u, slotZero.Layer);
|
||||
Assert.NotEqual(BindlessTextureLocation.Unresolved, slotZero);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BudgetRejectionReturnsAnUnresolvedLocation()
|
||||
{
|
||||
// One layer per atlas and room for exactly one atlas, so the second
|
||||
// composite is refused by the physical budget rather than uploaded.
|
||||
var backend = new FakeBackend(maximumLayers: 1);
|
||||
var retirements = new DeferredRetirementQueue();
|
||||
using var cache = CreateCache(
|
||||
backend,
|
||||
retirements,
|
||||
physicalBudgetBytes: 64);
|
||||
cache.BeginFrame();
|
||||
Assert.True(cache.TryAddAndAcquire(1, Key(1), Texture(4, 4), out _));
|
||||
|
||||
Assert.False(cache.TryAddAndAcquire(
|
||||
2,
|
||||
Key(2),
|
||||
Texture(4, 4),
|
||||
out BindlessTextureLocation rejected));
|
||||
Assert.False(rejected.IsResolved);
|
||||
Assert.False(rejected.Slot.IsAssigned);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ResidencySnapshotSeparatesResidentRequestedAndRetiringStorage()
|
||||
{
|
||||
|
|
@ -77,7 +125,7 @@ public sealed class CompositeTextureArrayCachePolicyTests
|
|||
Assert.True(cache.TryAddAndAcquire(1, Key(2), Texture(4, 4), out BindlessTextureLocation second));
|
||||
|
||||
Assert.Equal(first, shared);
|
||||
Assert.Equal(first.Handle, second.Handle);
|
||||
Assert.Equal(first.Slot, second.Slot);
|
||||
Assert.NotEqual(first.Layer, second.Layer);
|
||||
Assert.Single(backend.Created);
|
||||
Assert.Equal(2, backend.Uploads.Count);
|
||||
|
|
@ -124,7 +172,7 @@ public sealed class CompositeTextureArrayCachePolicyTests
|
|||
Assert.Equal(1, retirements.Count);
|
||||
cache.BeginFrame();
|
||||
Assert.True(cache.TryAddAndAcquire(2, Key(1), Texture(4, 4), out BindlessTextureLocation replacement));
|
||||
Assert.NotEqual(old.Handle, replacement.Handle);
|
||||
Assert.NotEqual(old.Slot, replacement.Slot);
|
||||
Assert.Equal(2, backend.Created.Count);
|
||||
|
||||
retirements.DrainAll();
|
||||
|
|
@ -369,7 +417,7 @@ public sealed class CompositeTextureArrayCachePolicyTests
|
|||
cache.BeginFrame();
|
||||
cache.Tick();
|
||||
Assert.True(cache.TryAddAndAcquire(2, Key(2), Texture(4, 4), out BindlessTextureLocation reused));
|
||||
Assert.Equal(first.Handle, reused.Handle);
|
||||
Assert.Equal(first.Slot, reused.Slot);
|
||||
Assert.Single(backend.Created);
|
||||
Assert.Equal(64, cache.AllocatedBytes);
|
||||
}
|
||||
|
|
@ -606,6 +654,10 @@ public sealed class CompositeTextureArrayCachePolicyTests
|
|||
{
|
||||
Name = name,
|
||||
Handle = 1000UL + name,
|
||||
// Slice V4t: the GL backend interns each resident handle into
|
||||
// GlGpuDevice's table; the fake mints a deterministic stand-in
|
||||
// so slot identity is still comparable across entries.
|
||||
Slot = new AcDream.App.Rendering.Gpu.GpuTextureSlot(name),
|
||||
Width = width,
|
||||
Height = height,
|
||||
Capacity = capacity,
|
||||
|
|
|
|||
|
|
@ -300,6 +300,7 @@ public sealed class StandaloneBindlessTextureCacheTests
|
|||
SurfaceId = surfaceId,
|
||||
Name = surfaceId,
|
||||
Handle = surfaceId + 1_000UL,
|
||||
Slot = new AcDream.App.Rendering.Gpu.GpuTextureSlot(surfaceId),
|
||||
Bytes = bytes,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class InstanceGroupClearTests
|
|||
cache.Populate(
|
||||
entityId: 100,
|
||||
landblockHint: 0xA9B40000u,
|
||||
batches: [new CachedBatch(key, 0xAA, Matrix4x4.Identity)],
|
||||
batches: [new CachedBatch(key, Slot(0xAA), Matrix4x4.Identity)],
|
||||
selectionParts: parts);
|
||||
|
||||
Assert.True(cache.TryGet(100, 0xA9B40000u, out EntityCacheEntry? entry));
|
||||
|
|
@ -91,10 +91,10 @@ public class InstanceGroupClearTests
|
|||
public void DispatcherFingerprint_EqualDistanceAlphaUsesOriginalSubmissionOrder()
|
||||
{
|
||||
WbDrawDispatcher.InstanceGroup first = MakeCompleteGroup(
|
||||
textureHandle: 0xAA,
|
||||
textureSlot: 0xAA,
|
||||
submissionOrder: 0);
|
||||
WbDrawDispatcher.InstanceGroup second = MakeCompleteGroup(
|
||||
textureHandle: 0xBB,
|
||||
textureSlot: 0xBB,
|
||||
submissionOrder: 1);
|
||||
var scratch = new List<WbDrawDispatcher.AlphaFingerprint>();
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ public class InstanceGroupClearTests
|
|||
public void DispatcherFingerprint_ZeroVisibleInstancesIgnoresStaleGroupStorage()
|
||||
{
|
||||
WbDrawDispatcher.InstanceGroup stale = MakeCompleteGroup(
|
||||
textureHandle: 0xAA,
|
||||
textureSlot: 0xAA,
|
||||
submissionOrder: 0);
|
||||
var scratch = new List<WbDrawDispatcher.AlphaFingerprint>();
|
||||
|
||||
|
|
@ -177,12 +177,12 @@ public class InstanceGroupClearTests
|
|||
FirstIndex: 0,
|
||||
BaseVertex: 0,
|
||||
IndexCount: 6,
|
||||
BindlessTextureHandle: 0xAA,
|
||||
TextureSlot: Slot(0xAA),
|
||||
TextureLayer: 0,
|
||||
Translucency: TranslucencyKind.Opaque);
|
||||
var cached = new CachedBatch(
|
||||
key,
|
||||
0xAA,
|
||||
Slot(0xAA),
|
||||
Matrix4x4.Identity,
|
||||
Group: group,
|
||||
GroupRegistration: 17);
|
||||
|
|
@ -221,7 +221,7 @@ public class InstanceGroupClearTests
|
|||
var retiredKeys = new List<GroupKey>();
|
||||
var staleCache = new CachedBatch(
|
||||
retiredKey,
|
||||
retiredKey.BindlessTextureHandle,
|
||||
retiredKey.TextureSlot,
|
||||
Matrix4x4.Identity,
|
||||
Group: retired,
|
||||
GroupRegistration: retired.Registration);
|
||||
|
|
@ -274,11 +274,13 @@ public class InstanceGroupClearTests
|
|||
Assert.Equal(22, paperdoll.Registration);
|
||||
}
|
||||
|
||||
private static GroupKey MakeKey(ulong textureHandle) => new(
|
||||
private static AcDream.App.Rendering.Gpu.GpuTextureSlot Slot(uint index) => new(index);
|
||||
|
||||
private static GroupKey MakeKey(uint textureSlot) => new(
|
||||
FirstIndex: 0,
|
||||
BaseVertex: 0,
|
||||
IndexCount: 6,
|
||||
BindlessTextureHandle: textureHandle,
|
||||
TextureSlot: Slot(textureSlot),
|
||||
TextureLayer: 0,
|
||||
Translucency: TranslucencyKind.Opaque);
|
||||
|
||||
|
|
@ -294,7 +296,7 @@ public class InstanceGroupClearTests
|
|||
}
|
||||
|
||||
private static WbDrawDispatcher.InstanceGroup MakeCompleteGroup(
|
||||
ulong textureHandle,
|
||||
uint textureSlot,
|
||||
int submissionOrder)
|
||||
{
|
||||
var group = new WbDrawDispatcher.InstanceGroup
|
||||
|
|
@ -302,7 +304,7 @@ public class InstanceGroupClearTests
|
|||
FirstIndex = 0,
|
||||
BaseVertex = 0,
|
||||
IndexCount = 6,
|
||||
BindlessTextureHandle = textureHandle,
|
||||
TextureSlot = Slot(textureSlot),
|
||||
TextureLayer = 0,
|
||||
Translucency = TranslucencyKind.AlphaBlend,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ public class EntityClassificationCacheTests
|
|||
var cache = new EntityClassificationCache();
|
||||
var batches = new[]
|
||||
{
|
||||
MakeCachedBatch(ibo: 1, firstIndex: 0, indexCount: 6, texHandle: 0xAA),
|
||||
MakeCachedBatch(ibo: 1, firstIndex: 6, indexCount: 6, texHandle: 0xBB),
|
||||
MakeCachedBatch(ibo: 1, firstIndex: 0, indexCount: 6, texSlot: 0xAA),
|
||||
MakeCachedBatch(ibo: 1, firstIndex: 6, indexCount: 6, texSlot: 0xBB),
|
||||
};
|
||||
|
||||
cache.Populate(entityId: 100, landblockHint: 0xA9B40000u, batches);
|
||||
|
|
@ -46,7 +46,7 @@ public class EntityClassificationCacheTests
|
|||
Assert.True(cache.TryGet(100, 0u, out var entry));
|
||||
Assert.NotNull(entry);
|
||||
Assert.Single(entry!.Batches);
|
||||
Assert.Equal(0xCCu, entry.Batches[0].BindlessTextureHandle);
|
||||
Assert.Equal(0xCCu, entry.Batches[0].TextureSlot.Index);
|
||||
}
|
||||
|
||||
// ── #119 root-cause regression (2026-06-11): colliding entity ids across
|
||||
|
|
@ -152,15 +152,15 @@ public class EntityClassificationCacheTests
|
|||
ibo: (uint)(subPart + 1),
|
||||
firstIndex: (uint)(b * 6),
|
||||
indexCount: 6,
|
||||
texHandle: (ulong)(0x100 + subPart * 2 + b));
|
||||
texSlot: (uint)(0x100 + subPart * 2 + b));
|
||||
}
|
||||
cache.Populate(99, 0u, batches);
|
||||
|
||||
Assert.True(cache.TryGet(99, 0u, out var entry));
|
||||
Assert.NotNull(entry);
|
||||
Assert.Equal(6, entry!.Batches.Length);
|
||||
Assert.Equal(0x100u, entry.Batches[0].BindlessTextureHandle);
|
||||
Assert.Equal(0x105u, entry.Batches[5].BindlessTextureHandle);
|
||||
Assert.Equal(0x100u, entry.Batches[0].TextureSlot.Index);
|
||||
Assert.Equal(0x105u, entry.Batches[5].TextureSlot.Index);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
@ -248,7 +248,7 @@ public class EntityClassificationCacheTests
|
|||
Assert.True(cache.TryGet(100, 0xA9B40000u, out var entry));
|
||||
Assert.NotNull(entry);
|
||||
Assert.Equal(batchesV2, entry!.Batches);
|
||||
Assert.Equal(0xCCu, entry.Batches[0].BindlessTextureHandle);
|
||||
Assert.Equal(0xCCu, entry.Batches[0].TextureSlot.Index);
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
|
|
@ -328,15 +328,15 @@ public class EntityClassificationCacheTests
|
|||
#endif
|
||||
|
||||
private static CachedBatch MakeCachedBatch(
|
||||
uint ibo, uint firstIndex, int indexCount, ulong texHandle)
|
||||
uint ibo, uint firstIndex, int indexCount, uint texSlot)
|
||||
{
|
||||
var key = new GroupKey(
|
||||
FirstIndex: firstIndex,
|
||||
BaseVertex: 0,
|
||||
IndexCount: indexCount,
|
||||
BindlessTextureHandle: texHandle,
|
||||
TextureSlot: new AcDream.App.Rendering.Gpu.GpuTextureSlot(texSlot),
|
||||
TextureLayer: 0,
|
||||
Translucency: TranslucencyKind.Opaque);
|
||||
return new CachedBatch(key, texHandle, Matrix4x4.Identity);
|
||||
return new CachedBatch(key, new AcDream.App.Rendering.Gpu.GpuTextureSlot(texSlot), Matrix4x4.Identity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -416,7 +416,7 @@ public sealed class WbDrawDispatcherBucketingTests
|
|||
uint ibo,
|
||||
uint firstIndex,
|
||||
int indexCount,
|
||||
ulong texHandle,
|
||||
uint texSlot,
|
||||
Matrix4x4? restPose = null,
|
||||
Vector3? localSortCenter = null)
|
||||
{
|
||||
|
|
@ -424,12 +424,12 @@ public sealed class WbDrawDispatcherBucketingTests
|
|||
FirstIndex: firstIndex,
|
||||
BaseVertex: 0,
|
||||
IndexCount: indexCount,
|
||||
BindlessTextureHandle: texHandle,
|
||||
TextureSlot: new AcDream.App.Rendering.Gpu.GpuTextureSlot(texSlot),
|
||||
TextureLayer: 0,
|
||||
Translucency: TranslucencyKind.Opaque);
|
||||
return new CachedBatch(
|
||||
key,
|
||||
texHandle,
|
||||
new AcDream.App.Rendering.Gpu.GpuTextureSlot(texSlot),
|
||||
restPose ?? Matrix4x4.Identity,
|
||||
localSortCenter ?? Vector3.Zero);
|
||||
}
|
||||
|
|
@ -459,8 +459,8 @@ public sealed class WbDrawDispatcherBucketingTests
|
|||
const uint LandblockId = 0xA9B40000u;
|
||||
|
||||
// First MeshRef contributes 2 batches (mimics ClassifyBatches output).
|
||||
scratch.Add(MakeCachedBatch(ibo: 1, firstIndex: 0, indexCount: 6, texHandle: 0xAA));
|
||||
scratch.Add(MakeCachedBatch(ibo: 1, firstIndex: 6, indexCount: 6, texHandle: 0xBB));
|
||||
scratch.Add(MakeCachedBatch(ibo: 1, firstIndex: 0, indexCount: 6, texSlot: 0xAA));
|
||||
scratch.Add(MakeCachedBatch(ibo: 1, firstIndex: 6, indexCount: 6, texSlot: 0xBB));
|
||||
|
||||
uint? populateEntityId = null;
|
||||
uint populateLandblockId = 0u;
|
||||
|
|
@ -479,8 +479,8 @@ public sealed class WbDrawDispatcherBucketingTests
|
|||
Assert.True(cache.TryGet(EntityId, LandblockId, out var entry));
|
||||
Assert.NotNull(entry);
|
||||
Assert.Equal(2, entry!.Batches.Length);
|
||||
Assert.Equal(0xAAul, entry.Batches[0].BindlessTextureHandle);
|
||||
Assert.Equal(0xBBul, entry.Batches[1].BindlessTextureHandle);
|
||||
Assert.Equal(0xAAu, entry.Batches[0].TextureSlot.Index);
|
||||
Assert.Equal(0xBBu, entry.Batches[1].TextureSlot.Index);
|
||||
|
||||
// Frame 2: cache hit. ApplyCacheHit walks the cached batches and
|
||||
// appends RestPose * entityWorld to a per-frame group dict.
|
||||
|
|
@ -535,7 +535,7 @@ public sealed class WbDrawDispatcherBucketingTests
|
|||
ibo: 1,
|
||||
firstIndex: 0,
|
||||
indexCount: 6,
|
||||
texHandle: 0xAA,
|
||||
texSlot: 0xAA,
|
||||
localSortCenter: authoredCenter),
|
||||
],
|
||||
};
|
||||
|
|
@ -638,16 +638,16 @@ public sealed class WbDrawDispatcherBucketingTests
|
|||
populateEntityId, populateLandblockId, EntityId, cache, scratch);
|
||||
|
||||
// Mimic ClassifyBatches' collector output for THIS MeshRef:
|
||||
// 2 batches with distinct (ibo, firstIndex, texHandle) so the
|
||||
// 2 batches with distinct (ibo, firstIndex, texSlot) so the
|
||||
// ordering can be verified post-hoc.
|
||||
for (int b = 0; b < BatchesPerMeshRef; b++)
|
||||
{
|
||||
ulong texHandle = (ulong)(0x100 + meshRefIdx * BatchesPerMeshRef + b);
|
||||
uint texSlot = (uint)(0x100 + meshRefIdx * BatchesPerMeshRef + b);
|
||||
scratch.Add(MakeCachedBatch(
|
||||
ibo: (uint)(meshRefIdx + 1),
|
||||
firstIndex: (uint)(b * 6),
|
||||
indexCount: 6,
|
||||
texHandle: texHandle));
|
||||
texSlot: texSlot));
|
||||
}
|
||||
|
||||
// After ClassifyBatches, Draw sets the tracker (matching the
|
||||
|
|
@ -676,7 +676,7 @@ public sealed class WbDrawDispatcherBucketingTests
|
|||
// Per-batch ordering check: batches arrived in MeshRef order, so
|
||||
// texture handles run 0x100..0x105 in the order they were appended.
|
||||
for (int i = 0; i < ExpectedTotalBatches; i++)
|
||||
Assert.Equal((ulong)(0x100 + i), entry.Batches[i].BindlessTextureHandle);
|
||||
Assert.Equal((uint)(0x100 + i), entry.Batches[i].TextureSlot.Index);
|
||||
|
||||
// After flush, scratch is cleared so the next entity starts fresh.
|
||||
Assert.Empty(scratch);
|
||||
|
|
@ -717,12 +717,12 @@ public sealed class WbDrawDispatcherBucketingTests
|
|||
currentEntityIncomplete = true;
|
||||
|
||||
// Tuple 1 (MeshRef[1]): renderData valid -> classify, accumulate.
|
||||
scratch.Add(MakeCachedBatch(ibo: 1, firstIndex: 0, indexCount: 6, texHandle: 0xAAul));
|
||||
scratch.Add(MakeCachedBatch(ibo: 1, firstIndex: 0, indexCount: 6, texSlot: 0xAA));
|
||||
populateEntityId = EntityId;
|
||||
populateLandblockId = LandblockId;
|
||||
|
||||
// Tuple 2 (MeshRef[2]): renderData valid -> classify, accumulate.
|
||||
scratch.Add(MakeCachedBatch(ibo: 2, firstIndex: 0, indexCount: 6, texHandle: 0xBBul));
|
||||
scratch.Add(MakeCachedBatch(ibo: 2, firstIndex: 0, indexCount: 6, texSlot: 0xBB));
|
||||
populateEntityId = EntityId;
|
||||
populateLandblockId = LandblockId;
|
||||
|
||||
|
|
@ -774,7 +774,7 @@ public sealed class WbDrawDispatcherBucketingTests
|
|||
for (int i = 0; i < CachedBatchCount; i++)
|
||||
{
|
||||
batches[i] = MakeCachedBatch(
|
||||
ibo: 1u, firstIndex: (uint)i, indexCount: 6, texHandle: (ulong)(0x100 + i));
|
||||
ibo: 1u, firstIndex: (uint)i, indexCount: 6, texSlot: (uint)(0x100 + i));
|
||||
}
|
||||
cache.Populate(entityId: 100, landblockHint: 0xA9B40000u, batches);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue