diff options
| author | Parakeet-Wheat <227350947+Parakeet-Wheat@users.noreply.github.com> | 2026-11-22 09:05:33 +1100 |
|---|---|---|
| committer | Parakeet-Wheat <227350947+Parakeet-Wheat@users.noreply.github.com> | 2026-11-22 10:59:11 +1100 |
| commit | be91840c075fba6e1ad0bd6670e7d9813c01fc02 (patch) | |
| tree | e638e37d5bdb4e7abd2ab6a7c709c90345d26711 /runtime/test/command_list_test.cpp | |
| parent | 4abd54571b6efa02d97eda4711792fa00b455dc3 (diff) | |
Runtime: SetPredication on VK_EXT_conditional_rendering (D3D-18)
- command_list.h: a Predication command (offset 8-byte aligned, EQUAL_ZERO or
NOT_EQUAL_ZERO; a null buffer turns it off), recorded by
GraphicsCommandList::SetPredication.
- vulkan_replay.h: begin/end conditional rendering (INVERTED for NOT_EQUAL_ZERO),
ended before a new predicate and at the end of the list. While predicated,
whole-view clears go through vkCmdClearAttachments, which conditional rendering
covers. New ReplayResult::invalid_predication; PreparedList::unpredicated_copies
counts copies Vulkan cannot predicate.
- Device: VK_EXT_conditional_rendering and its feature enabled when present, and
buffers created with VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT; without it a
predicated list is unsupported.
- Tests: command_list_test (recording rules), vk_command_replay_test part C (GPU).
- docs/d3d12_vulkan.md 4.7: what is done; copies and the 64-bit value are open.
AI-assisted (Claude Code).
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 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/test/command_list_test.cpp b/runtime/test/command_list_test.cpp index 148f973e4..50b2db8a3 100644 --- a/runtime/test/command_list_test.cpp +++ b/runtime/test/command_list_test.cpp | |||
| @@ -180,5 +180,21 @@ int main() { | |||
| 180 | CHECK(!open_parent.execute_bundle(open_parent)); // a list cannot execute itself | 180 | CHECK(!open_parent.execute_bundle(open_parent)); // a list cannot execute itself |
| 181 | CHECK(open_parent.commands().empty()); | 181 | CHECK(open_parent.commands().empty()); |
| 182 | 182 | ||
| 183 | // SetPredication (D3D-18): the op must be one of the two D3D12 values and the offset 8-byte aligned; a null | ||
| 184 | // buffer turns it off whatever the other arguments are. | ||
| 185 | namespace pred = d3d12_predication; | ||
| 186 | CommandList predicated; | ||
| 187 | CHECK(predicated.set_predication({7, 0, pred::equal_zero})); | ||
| 188 | CHECK(predicated.set_predication({7, 16, pred::not_equal_zero})); | ||
| 189 | CHECK(!predicated.set_predication({7, 4, pred::equal_zero})); // not 8-byte aligned | ||
| 190 | CHECK(!predicated.set_predication({7, 0, 2})); // no such op | ||
| 191 | CHECK(predicated.set_predication({0, 4, 2})); // off: offset and op ignored | ||
| 192 | CHECK(predicated.close()); | ||
| 193 | CHECK(!predicated.set_predication({7, 0, pred::equal_zero})); // closed | ||
| 194 | CHECK(predicated.commands().size() == 3); | ||
| 195 | CHECK(std::get<Predication>(predicated.commands()[0]).op == pred::equal_zero); | ||
| 196 | CHECK(std::get<Predication>(predicated.commands()[1]).offset == 16); | ||
| 197 | const auto& off = std::get<Predication>(predicated.commands()[2]); | ||
| 198 | CHECK(off.buffer == 0 && off.offset == 0 && off.op == 0); | ||
| 183 | return 0; | 199 | return 0; |
| 184 | } | 200 | } |