diff options
Diffstat (limited to 'runtime/test/command_list_test.cpp')
| -rw-r--r-- | runtime/test/command_list_test.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/test/command_list_test.cpp b/runtime/test/command_list_test.cpp index 69fe14679..e459b4cc8 100644 --- a/runtime/test/command_list_test.cpp +++ b/runtime/test/command_list_test.cpp | |||
| @@ -223,6 +223,24 @@ int main() { | |||
| 223 | CHECK(std::get<CopyResource>(parent.commands()[1]).src == 4); | 223 | CHECK(std::get<CopyResource>(parent.commands()[1]).src == 4); |
| 224 | CHECK(!parent.execute_bundle(bundle)); // parent is closed | 224 | CHECK(!parent.execute_bundle(bundle)); // parent is closed |
| 225 | 225 | ||
| 226 | // The range form: [first, last) of the bundle, with last clamped to its size. | ||
| 227 | { | ||
| 228 | CommandList source, target, other; | ||
| 229 | CHECK(source.copy_resource({1, 2}) && source.copy_resource({3, 4}) && source.copy_resource({5, 6})); | ||
| 230 | CHECK(source.close()); | ||
| 231 | CHECK(target.execute_bundle(source, 1, 2)); // the middle command only | ||
| 232 | CHECK(target.commands().size() == 1 && std::get<CopyResource>(target.commands()[0]).src == 4); | ||
| 233 | CHECK(target.execute_bundle(source, 2, 100)); // last beyond the size is clamped | ||
| 234 | CHECK(target.commands().size() == 2 && std::get<CopyResource>(target.commands()[1]).src == 6); | ||
| 235 | CHECK(target.execute_bundle(source, 1, 1) && target.commands().size() == 2); // first == last: nothing | ||
| 236 | CHECK(target.execute_bundle(source, 3, 3) && target.execute_bundle(source, 7, 9)); // first beyond the size | ||
| 237 | CHECK(target.execute_bundle(source, 2, 1) && target.commands().size() == 2); // first after last: nothing | ||
| 238 | CHECK(target.commands().size() == 2); | ||
| 239 | CHECK(other.execute_bundle(source)); // the default arguments copy all of it, as before | ||
| 240 | CHECK(other.commands().size() == 3 && std::get<CopyResource>(other.commands()[0]).src == 2 && | ||
| 241 | std::get<CopyResource>(other.commands()[2]).src == 6); | ||
| 242 | } | ||
| 243 | |||
| 226 | CommandList open_parent, open_bundle; | 244 | CommandList open_parent, open_bundle; |
| 227 | CHECK(!open_parent.execute_bundle(open_bundle)); // bundle must be closed | 245 | CHECK(!open_parent.execute_bundle(open_bundle)); // bundle must be closed |
| 228 | CHECK(!open_parent.execute_bundle(open_parent)); // a list cannot execute itself | 246 | CHECK(!open_parent.execute_bundle(open_parent)); // a list cannot execute itself |