upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/command_list_test.cpp
diff options
context:
space:
mode:
authorVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 19:08:54 +0100
committerVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 19:08:54 +0100
commit3af42c619253941610d9809e8a28a07e8dfdfdf2 (patch)
treea675793195f8bc69c3caebb0e9614ecfb65e1c4c /runtime/test/command_list_test.cpp
parente6af0a0931639ff33cdd4a28289da984f194c87e (diff)
parentec8ec4c9a46c6623f1a9c125afd3566da97f1e0c (diff)
merge: preserve upstream changes alongside the asset fix
Diffstat (limited to 'runtime/test/command_list_test.cpp')
-rw-r--r--runtime/test/command_list_test.cpp18
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