diff options
Diffstat (limited to 'runtime/test/command_list_test.cpp')
| -rw-r--r-- | runtime/test/command_list_test.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/runtime/test/command_list_test.cpp b/runtime/test/command_list_test.cpp index d4dbe855d..797ba03d5 100644 --- a/runtime/test/command_list_test.cpp +++ b/runtime/test/command_list_test.cpp | |||
| @@ -119,12 +119,25 @@ int main() { | |||
| 119 | CHECK(!list.copy_texture({texture, 0, 0, 0, texture, true, {2, 2, 0, 2, 6, 1}})); // empty box | 119 | CHECK(!list.copy_texture({texture, 0, 0, 0, texture, true, {2, 2, 0, 2, 6, 1}})); // empty box |
| 120 | CHECK(list.copy_resource({5, 6})); | 120 | CHECK(list.copy_resource({5, 6})); |
| 121 | CHECK(!list.copy_resource({5, 5})); | 121 | CHECK(!list.copy_resource({5, 5})); |
| 122 | // A volume's box has a z range, and its footprint a depth; a resolve needs two different resources. | ||
| 123 | CHECK(list.copy_texture({texture, 0, 0, 2, {4, true, 0, 512, 4, 4, 4, 256}, true, {0, 0, 1, 4, 4, 3}})); | ||
| 124 | CHECK(!list.copy_texture({texture, 0, 0, 0, {4, true, 0, 512, 4, 4, 0, 256}, false, {}})); // no slices | ||
| 125 | CHECK(!list.copy_texture({texture, 0, 0, 0, texture, true, {0, 0, 2, 4, 4, 2}})); // empty in z | ||
| 126 | CHECK(list.resolve_subresource({7, 1, 8, 0})); | ||
| 127 | CHECK(!list.resolve_subresource({7, 0, 7, 0})); | ||
| 128 | CHECK(!list.resolve_subresource({0, 0, 8, 0})); | ||
| 129 | CHECK(!list.resolve_subresource({7, 0, 0, 0})); | ||
| 122 | CHECK(list.close()); | 130 | CHECK(list.close()); |
| 123 | CHECK(list.commands().size() == 4); | 131 | CHECK(!list.resolve_subresource({7, 1, 8, 0})); |
| 132 | CHECK(list.commands().size() == 6); | ||
| 124 | CHECK(std::get<CopyBuffer>(list.commands()[0]).src_offset == 16); | 133 | CHECK(std::get<CopyBuffer>(list.commands()[0]).src_offset == 16); |
| 125 | CHECK(std::get<CopyTexture>(list.commands()[1]).src.footprint && !std::get<CopyTexture>(list.commands()[1]).has_box); | 134 | CHECK(std::get<CopyTexture>(list.commands()[1]).src.footprint && !std::get<CopyTexture>(list.commands()[1]).has_box); |
| 126 | CHECK(std::get<CopyTexture>(list.commands()[2]).box.right == 6); | 135 | CHECK(std::get<CopyTexture>(list.commands()[2]).box.right == 6); |
| 127 | CHECK(std::get<CopyResource>(list.commands()[3]).src == 6); | 136 | CHECK(std::get<CopyResource>(list.commands()[3]).src == 6); |
| 137 | const auto& slices = std::get<CopyTexture>(list.commands()[4]); | ||
| 138 | CHECK(slices.z == 2 && slices.src.depth == 4 && slices.box.front == 1 && slices.box.back == 3); | ||
| 139 | const auto& resolved = std::get<ResolveSubresource>(list.commands()[5]); | ||
| 140 | CHECK(resolved.dst == 7 && resolved.dst_subresource == 1 && resolved.src == 8 && resolved.src_subresource == 0); | ||
| 128 | 141 | ||
| 129 | CHECK(list.reset()); | 142 | CHECK(list.reset()); |
| 130 | CHECK(!list.closed() && list.commands().empty()); | 143 | CHECK(!list.closed() && list.commands().empty()); |