diff options
| author | kotorvr <332716892+kotorvr@users.noreply.github.com> | 2026-11-22 02:55:44 +0000 |
|---|---|---|
| committer | kotorvr <332716892+kotorvr@users.noreply.github.com> | 2026-11-22 02:55:44 +0000 |
| commit | c7e450fc69865aba47d6e01a8da6f9b3ecfa1bff (patch) | |
| tree | d64f94c852bf131c752ddd91aba6fbadf73c11e4 /runtime/test/command_list_test.cpp | |
| parent | e40bd6563e2efe885e8c13884a34c798b15610b5 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/command_list_test.cpp')
| -rw-r--r-- | runtime/test/command_list_test.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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() { | |||
| 149 | 149 | ||
| 150 | // D3D-26: discards, immediate writes and atomic copies. | 150 | // D3D-26: discards, immediate writes and atomic copies. |
| 151 | CHECK(list.reset()); | 151 | CHECK(list.reset()); |
| 152 | CHECK(list.discard({40, 0, all_subresources, false})); | 152 | CHECK(list.discard({40, 0, 0, false, true})); // the whole resource |
| 153 | CHECK(list.discard({40, 2, 3, true})); | 153 | CHECK(list.discard({40, 2, 3, true})); |
| 154 | CHECK(list.discard({40, 0, 0, false})); // nothing to discard: not recorded | 154 | CHECK(list.discard({40, 0, 0, false})); // nothing to discard: not recorded |
| 155 | CHECK(!list.discard({0, 0, all_subresources, false})); | 155 | CHECK(!list.discard({0, 0, 0, false, true})); |
| 156 | CHECK(!list.discard({40, 0xfffffff0u, 0x20, false})); // past the last subresource index | 156 | CHECK(!list.discard({40, 0xfffffff0u, 0x20, false})); // past the last subresource index |
| 157 | CHECK(!list.discard({40, 1, all_subresources, false})); // an explicit count of UINT_MAX is a range | ||
| 158 | CHECK(!list.discard({40, all_subresources, 1, false})); | ||
| 157 | CHECK(list.write_immediate({0x1000, 7, write_immediate_mode::marker_out})); | 159 | CHECK(list.write_immediate({0x1000, 7, write_immediate_mode::marker_out})); |
| 158 | CHECK(!list.write_immediate({0, 7, 0})); // null address | 160 | CHECK(!list.write_immediate({0, 7, 0})); // null address |
| 159 | CHECK(!list.write_immediate({0x1002, 7, 0})); // not 4-byte aligned | 161 | CHECK(!list.write_immediate({0x1002, 7, 0})); // not 4-byte aligned |
| @@ -168,10 +170,11 @@ int main() { | |||
| 168 | CHECK(!list.atomic_copy({42, 8, 43, 16, 4, {{0, 0, 0, 4}}})); // a null dependent resource | 170 | CHECK(!list.atomic_copy({42, 8, 43, 16, 4, {{0, 0, 0, 4}}})); // a null dependent resource |
| 169 | CHECK(!list.atomic_copy({0, 8, 43, 16, 4, {dependent}})); | 171 | CHECK(!list.atomic_copy({0, 8, 43, 16, 4, {dependent}})); |
| 170 | CHECK(list.close()); | 172 | CHECK(list.close()); |
| 171 | CHECK(!list.discard({40, 0, all_subresources, false}) && !list.discard({40, 0, 0, false})); | 173 | CHECK(!list.discard({40, 0, 0, false, true}) && !list.discard({40, 0, 0, false})); |
| 172 | CHECK(list.commands().size() == 5); | 174 | CHECK(list.commands().size() == 5); |
| 175 | CHECK(std::get<DiscardResource>(list.commands()[0]).whole); | ||
| 173 | CHECK(std::get<DiscardResource>(list.commands()[1]).first_subresource == 2 && | 176 | CHECK(std::get<DiscardResource>(list.commands()[1]).first_subresource == 2 && |
| 174 | std::get<DiscardResource>(list.commands()[1]).partial); | 177 | std::get<DiscardResource>(list.commands()[1]).partial && !std::get<DiscardResource>(list.commands()[1]).whole); |
| 175 | CHECK(std::get<WriteImmediate>(list.commands()[2]).value == 7); | 178 | CHECK(std::get<WriteImmediate>(list.commands()[2]).value == 7); |
| 176 | const auto& atomic = std::get<AtomicCopyBuffer>(list.commands()[3]); | 179 | const auto& atomic = std::get<AtomicCopyBuffer>(list.commands()[3]); |
| 177 | CHECK(atomic.bytes == 8 && atomic.dst_offset == 8 && atomic.dependencies.size() == 1 && | 180 | CHECK(atomic.bytes == 8 && atomic.dst_offset == 8 && atomic.dependencies.size() == 1 && |