tests: expect an inclusive child limit to bound one more record

This commit is contained in:
Claxten authored and nmzik committed 2026-10-27 04:23:00 +01:00
1 parent d118afbeae
commit ff5d16eefc
1 file changed
+13 -5
+13 -5
View File
@@ -1282,15 +1282,18 @@ void TestIndexedPointerImageTable() {
{image, sampler, fixture->ImageAddress(), parent}, fixture->AddMemory(image_memory, 0x8bcu)); {image, sampler, fixture->ImageAddress(), parent}, fixture->AddMemory(image_memory, 0x8bcu));
return fixture; return fixture;
}; };
const auto nested_geometry = [](const auto& plan, uint32_t count) {
const auto& indirect = *plan.descriptor_sources[plan.info.images[0].source].indirect_descriptor;
return indirect.table_maximum == 1u && indirect.pointer_table &&
indirect.pointer_table->indexed && indirect.pointer_table->count == count &&
indirect.pointer_table->stride == 368u && indirect.pointer_table->offset == 64u;
};
auto fixture = make(); auto fixture = make();
fixture->PlanAndTrack(); fixture->PlanAndTrack();
const auto plan = ExtractResourcePlan(fixture->program); const auto plan = ExtractResourcePlan(fixture->program);
Check(plan.info.images.size() == 1u && plan.info.buffers.size() == 1u, Check(plan.info.images.size() == 1u && plan.info.buffers.size() == 1u,
"indexed nested table expanded IR candidates or discarded the GPU pointer load"); "indexed nested table expanded IR candidates or discarded the GPU pointer load");
const auto& indirect = *plan.descriptor_sources[plan.info.images[0].source].indirect_descriptor; Check(nested_geometry(plan, 3u),
Check(indirect.table_maximum == 1u && indirect.pointer_table &&
indirect.pointer_table->indexed && indirect.pointer_table->count == 3u &&
indirect.pointer_table->stride == 368u && indirect.pointer_table->offset == 64u,
"nested table did not preserve separate parent and child geometry"); "nested table did not preserve separate parent and child geometry");
constexpr uint64_t high = uint64_t{1} << 32u; constexpr uint64_t high = uint64_t{1} << 32u;
constexpr uint32_t table = 0x2000u, objects = 0x10000u, row_bytes = 1536u; constexpr uint32_t table = 0x2000u, objects = 0x10000u, row_bytes = 1536u;
@@ -1389,8 +1392,13 @@ void TestIndexedPointerImageTable() {
"explicit null pointer bypassed the specialization reader"); "explicit null pointer bypassed the specialization reader");
auto reversed = make(Case::ReverseSigned); auto reversed = make(Case::ReverseSigned);
reversed->PlanAndTrack(); reversed->PlanAndTrack();
// An inclusive child limit bounds one more child record, never the exclusive count.
auto inclusive = make(Case::InclusiveChild);
inclusive->PlanAndTrack();
Check(nested_geometry(ExtractResourcePlan(inclusive->program), 4u),
"an inclusive child limit did not bound one more child record");
for (const auto variant : {Case::MissingParent, Case::WrongParent, Case::MissingChild, for (const auto variant : {Case::MissingParent, Case::WrongParent, Case::MissingChild,
Case::InclusiveChild, Case::MismatchedPair, Case::DifferentLaneMask, Case::MismatchedPair, Case::DifferentLaneMask,
Case::ExtraUse, Case::UnboundedChoice, Case::MissingOuterWitness, Case::WrongOuterWitness, Case::ExtraUse, Case::UnboundedChoice, Case::MissingOuterWitness, Case::WrongOuterWitness,
Case::CyclicChoice, Case::ExcessiveDomain}) { Case::CyclicChoice, Case::ExcessiveDomain}) {
auto invalid = make(variant); auto invalid = make(variant);