diff options
| author | Emma <47298336+zzEmmazz@users.noreply.github.com> | 2026-11-23 00:30:55 +0200 |
|---|---|---|
| committer | Emma <47298336+zzEmmazz@users.noreply.github.com> | 2026-11-23 00:30:55 +0200 |
| commit | cec49b014a0e6a684ebd0c9bcfeef1bc82e287e1 (patch) | |
| tree | 929034e4c254c7874fb5019136fe1260f638a892 /runtime | |
| parent | aa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff) | |
Tests: vk_overlapping_occlusion executes only the lists it closed (TEST-859, fails on MoltenVK)
Without pipelineStatisticsQuery the test never records or closes its two
statistics lists, but it handed them to execute(), which returns list_open.
The lists are now left out there. --no-statistics runs the test as such a
device does, and the new ctest entry vk_overlapping_occlusion_no_statistics
uses it, so the path is run on devices that have the feature.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/CMakeLists.txt | 7 | ||||
| -rw-r--r-- | runtime/test/vk_overlapping_occlusion_test.cpp | 19 |
2 files changed, 21 insertions, 5 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 5882f9478..c8cad2c6d 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt | |||
| @@ -933,7 +933,12 @@ if(TARGET Vulkan::Headers) | |||
| 933 | add_test(NAME vk_overlapping_occlusion COMMAND vk_overlapping_occlusion_test | 933 | add_test(NAME vk_overlapping_occlusion COMMAND vk_overlapping_occlusion_test |
| 934 | "${CMAKE_CURRENT_BINARY_DIR}/overlapping_occlusion.vert.spv" | 934 | "${CMAKE_CURRENT_BINARY_DIR}/overlapping_occlusion.vert.spv" |
| 935 | "${CMAKE_CURRENT_BINARY_DIR}/overlapping_occlusion.frag.spv") | 935 | "${CMAKE_CURRENT_BINARY_DIR}/overlapping_occlusion.frag.spv") |
| 936 | set_tests_properties(vk_overlapping_occlusion PROPERTIES SKIP_RETURN_CODE 77) | 936 | # The same test as a device without pipelineStatisticsQuery runs it (MoltenVK), on whatever device is here. |
| 937 | add_test(NAME vk_overlapping_occlusion_no_statistics COMMAND vk_overlapping_occlusion_test | ||
| 938 | "${CMAKE_CURRENT_BINARY_DIR}/overlapping_occlusion.vert.spv" | ||
| 939 | "${CMAKE_CURRENT_BINARY_DIR}/overlapping_occlusion.frag.spv" --no-statistics) | ||
| 940 | set_tests_properties(vk_overlapping_occlusion vk_overlapping_occlusion_no_statistics | ||
| 941 | PROPERTIES SKIP_RETURN_CODE 77) | ||
| 937 | endif() | 942 | endif() |
| 938 | endif() | 943 | endif() |
| 939 | # CPU-only: the ranking that makes these harnesses prefer a native ICD over Mesa's Dozen (#915). No GPU needed. | 944 | # CPU-only: the ranking that makes these harnesses prefer a native ICD over Mesa's Dozen (#915). No GPU needed. |
diff --git a/runtime/test/vk_overlapping_occlusion_test.cpp b/runtime/test/vk_overlapping_occlusion_test.cpp index b668f965c..9be436515 100644 --- a/runtime/test/vk_overlapping_occlusion_test.cpp +++ b/runtime/test/vk_overlapping_occlusion_test.cpp | |||
| @@ -489,7 +489,11 @@ int run(vktest::Device& d, const char* vertex, const char* fragment, const Bisec | |||
| 489 | } | 489 | } |
| 490 | EXPECT(kind_references.resolve_queries({b, occ, 6, 3, dst_id, 184})); | 490 | EXPECT(kind_references.resolve_queries({b, occ, 6, 3, dst_id, 184})); |
| 491 | EXPECT(kind_references.close()); | 491 | EXPECT(kind_references.close()); |
| 492 | const CommandList* overlap_lists[] = {&crossing_stats, &stats_references, &kind_overlap, &kind_references}; | 492 | // The two statistics lists are recorded and closed only where the device has the feature, and execute() |
| 493 | // refuses a list that is not closed (list_open): MoltenVK has no pipelineStatisticsQuery. | ||
| 494 | std::vector<const CommandList*> overlap_lists; | ||
| 495 | if (d.pipeline_statistics_query) overlap_lists = {&crossing_stats, &stats_references}; | ||
| 496 | overlap_lists.insert(overlap_lists.end(), {&kind_overlap, &kind_references}); | ||
| 493 | EXPECT(queue.execute(overlap_lists) == ReplayResult::success); | 497 | EXPECT(queue.execute(overlap_lists) == ReplayResult::success); |
| 494 | EXPECT(!schedule.overflow && schedule.next == schedule.extents.size()); | 498 | EXPECT(!schedule.overflow && schedule.next == schedule.extents.size()); |
| 495 | EXPECT(gate.signal(1)); | 499 | EXPECT(gate.signal(1)); |
| @@ -576,22 +580,29 @@ int run(vktest::Device& d, const char* vertex, const char* fragment, const Bisec | |||
| 576 | 580 | ||
| 577 | } // namespace | 581 | } // namespace |
| 578 | 582 | ||
| 579 | // vk_overlapping_occlusion_test <vert.spv> <frag.spv> [--bisect [--gated] [--no-draw] [--no-resolve] [phase...]] | 583 | // vk_overlapping_occlusion_test <vert.spv> <frag.spv> [--no-statistics] |
| 584 | // [--bisect [--gated] [--no-draw] [--no-resolve] [phase...]] | ||
| 585 | // --no-statistics runs the test as a device without pipelineStatisticsQuery does (MoltenVK): no statistics pool, | ||
| 586 | // no statistics lists. It makes that path testable on a device that has the feature. | ||
| 580 | int main(int argc, char** argv) { | 587 | int main(int argc, char** argv) { |
| 581 | EXPECT(argc >= 3); | 588 | EXPECT(argc >= 3); |
| 582 | Bisect bisect; | 589 | Bisect bisect; |
| 590 | bool no_statistics = false; | ||
| 583 | for (int i = 3; i < argc; ++i) { | 591 | for (int i = 3; i < argc; ++i) { |
| 584 | if (std::strcmp(argv[i], "--bisect") == 0) bisect.enabled = true; | 592 | if (std::strcmp(argv[i], "--no-statistics") == 0) no_statistics = true; |
| 593 | else if (std::strcmp(argv[i], "--bisect") == 0) bisect.enabled = true; | ||
| 585 | else if (std::strcmp(argv[i], "--gated") == 0) bisect.gated = true; | 594 | else if (std::strcmp(argv[i], "--gated") == 0) bisect.gated = true; |
| 586 | else if (std::strcmp(argv[i], "--no-draw") == 0) bisect.no_draw = true; | 595 | else if (std::strcmp(argv[i], "--no-draw") == 0) bisect.no_draw = true; |
| 587 | else if (std::strcmp(argv[i], "--no-resolve") == 0) bisect.no_resolve = true; | 596 | else if (std::strcmp(argv[i], "--no-resolve") == 0) bisect.no_resolve = true; |
| 588 | else bisect.phases.emplace_back(argv[i]); | 597 | else bisect.phases.emplace_back(argv[i]); |
| 589 | } | 598 | } |
| 590 | EXPECT(argc == 3 || bisect.enabled); | 599 | EXPECT(argc == 3 + (no_statistics ? 1 : 0) || bisect.enabled); |
| 591 | vktest::Device device; | 600 | vktest::Device device; |
| 592 | const auto status = device.initialize(); | 601 | const auto status = device.initialize(); |
| 593 | if (status == vktest::DeviceStatus::unavailable) return 77; | 602 | if (status == vktest::DeviceStatus::unavailable) return 77; |
| 594 | EXPECT(status == vktest::DeviceStatus::ready); | 603 | EXPECT(status == vktest::DeviceStatus::ready); |
| 604 | if (no_statistics) device.pipeline_statistics_query = false; | ||
| 605 | std::printf("pipeline statistics: %s\n", device.pipeline_statistics_query ? "checked" : "not checked"); | ||
| 595 | const int result = run(device, argv[1], argv[2], bisect); | 606 | const int result = run(device, argv[1], argv[2], bisect); |
| 596 | EXPECT(device.validation_errors() == 0); | 607 | EXPECT(device.validation_errors() == 0); |
| 597 | return result; | 608 | return result; |