From c7e450fc69865aba47d6e01a8da6f9b3ecfa1bff Mon Sep 17 00:00:00 2001 From: kotorvr <332716892+kotorvr@users.noreply.github.com> Date: Sun, 22 Nov 2026 02:55:44 +0000 Subject: D3D-26: keep a null discard region apart from an explicit UINT_MAX count A region with NumSubresources = UINT_MAX was recorded like a null region and skipped the FirstSubresource check. DiscardResource now has a whole flag; explicit ranges are checked in 64-bit at recording and replay. Tests at the UINT_MAX boundary in command_list_test, part F and the COM device test. Found by matheuskshn in review. Co-Authored-By: Claude Opus 5.5 --- runtime/test/command_list_test.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'runtime/test/command_list_test.cpp') diff --git a/runtime/test/command_list_test.cpp b/runtime/test/command_list_test.cpp index 968288697..49b7e27a8 100644 --- a/runtime/test/command_list_test.cpp +++ b/runtime/test/command_list_test.cpp @@ -149,11 +149,13 @@ int main() { // D3D-26: discards, immediate writes and atomic copies. CHECK(list.reset()); - CHECK(list.discard({40, 0, all_subresources, false})); + CHECK(list.discard({40, 0, 0, false, true})); // the whole resource CHECK(list.discard({40, 2, 3, true})); CHECK(list.discard({40, 0, 0, false})); // nothing to discard: not recorded - CHECK(!list.discard({0, 0, all_subresources, false})); + CHECK(!list.discard({0, 0, 0, false, true})); CHECK(!list.discard({40, 0xfffffff0u, 0x20, false})); // past the last subresource index + CHECK(!list.discard({40, 1, all_subresources, false})); // an explicit count of UINT_MAX is a range + CHECK(!list.discard({40, all_subresources, 1, false})); CHECK(list.write_immediate({0x1000, 7, write_immediate_mode::marker_out})); CHECK(!list.write_immediate({0, 7, 0})); // null address CHECK(!list.write_immediate({0x1002, 7, 0})); // not 4-byte aligned @@ -168,10 +170,11 @@ int main() { CHECK(!list.atomic_copy({42, 8, 43, 16, 4, {{0, 0, 0, 4}}})); // a null dependent resource CHECK(!list.atomic_copy({0, 8, 43, 16, 4, {dependent}})); CHECK(list.close()); - CHECK(!list.discard({40, 0, all_subresources, false}) && !list.discard({40, 0, 0, false})); + CHECK(!list.discard({40, 0, 0, false, true}) && !list.discard({40, 0, 0, false})); CHECK(list.commands().size() == 5); + CHECK(std::get(list.commands()[0]).whole); CHECK(std::get(list.commands()[1]).first_subresource == 2 && - std::get(list.commands()[1]).partial); + std::get(list.commands()[1]).partial && !std::get(list.commands()[1]).whole); CHECK(std::get(list.commands()[2]).value == 7); const auto& atomic = std::get(list.commands()[3]); CHECK(atomic.bytes == 8 && atomic.dst_offset == 8 && atomic.dependencies.size() == 1 && -- cgit v1.2.3