mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-16 22:43:24 +09:00
[Test] fix the two new stage-chunk cases' own expectations
Both cases were written against the wrong property and went red on the first WGB build, which is the one thing a case may not do. TextureEmit.ALevelTooLargeForTheStageChunkIsCutIntoSlabs asserted D == 8 slices for every slab of the 512x128x33 level, whose last slab is the 33rd slice alone. The per-slab check now names the scheme (Z = 8 * index, D = 8 for every slab but the remainder) instead of restating one number for all of them. StagedTextureStoreTest.ALevelWithAPieceMissingIsRefusedAsAWholeLevelReadByName wanted "not covered" out of a single LEADING run, and the store cannot answer that: it knows no format, so it cannot know how many bytes the level should have - the check is "the range the reader asks is covered". The case now uses the shape the check really is about, two runs with a hole between them (ServerLoopTest's R-11 coverage case, one store over), and the looseness is written down: in the header's coverage ruling, and as an assertion on the leading-run case beside it.
This commit is contained in:
@@ -666,12 +666,14 @@ TEST(TextureEmit, ALevelTooLargeForTheStageChunkIsCutIntoSlabs) {
|
||||
const Uint64 volumeBytes = 512ull * 128ull * 33ull * 16ull;
|
||||
const std::vector<MGPipeTextureSlab> volumeSlabs = cut(volume, volumeBytes, cap);
|
||||
ASSERT_EQ(volumeSlabs.size(), 5u);
|
||||
for (const MGPipeTextureSlab& slab : volumeSlabs) {
|
||||
for (SizeT i = 0; i < volumeSlabs.size(); ++i) {
|
||||
const MGPipeTextureSlab& slab = volumeSlabs[i];
|
||||
EXPECT_EQ(slab.Box.X, 0);
|
||||
EXPECT_EQ(slab.Box.Y, 0);
|
||||
EXPECT_EQ(slab.Box.W, 512u) << "a slab is not the level's full width";
|
||||
EXPECT_EQ(slab.Box.H, 128u);
|
||||
EXPECT_EQ(slab.Box.D, 8u);
|
||||
EXPECT_EQ(slab.Box.Z, static_cast<Int32>(8 * i)) << "the slabs are not in slice order";
|
||||
EXPECT_EQ(slab.Box.D, i + 1 == volumeSlabs.size() ? 1u : 8u);
|
||||
}
|
||||
EXPECT_EQ(volumeSlabs.back().Box.D, 1u) << "the remainder slice is its own piece";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user