diff options
| author | Codex <codex@users.noreply.github.com> | 2026-11-24 18:41:32 +0500 |
|---|---|---|
| committer | Codex <codex@users.noreply.github.com> | 2026-11-24 18:41:32 +0500 |
| commit | 27781f7f9b296fcdbac5c86792c2f2c2b308ba9b (patch) | |
| tree | eecfd8bb0028ddc686eb940b42967966291dfecf /runtime/test/command_list_test.cpp | |
| parent | 51f31609236a952badeb9c9aba9efc2a6e4dc2ff (diff) | |
d3d12: replay programmable sample positions (D3D-SAMPLE-POSITIONS)
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 4367df6ec..7e95c5fc4 100644 --- a/runtime/test/command_list_test.cpp +++ b/runtime/test/command_list_test.cpp | |||
| @@ -275,6 +275,22 @@ int main() { | |||
| 275 | CHECK(std::get<Predication>(predicated.commands()[1]).offset == 16); | 275 | CHECK(std::get<Predication>(predicated.commands()[1]).offset == 16); |
| 276 | const auto& off = std::get<Predication>(predicated.commands()[2]); | 276 | const auto& off = std::get<Predication>(predicated.commands()[2]); |
| 277 | CHECK(off.buffer == 0 && off.offset == 0 && off.op == 0); | 277 | CHECK(off.buffer == 0 && off.offset == 0 && off.op == 0); |
| 278 | CHECK(SamplePositions::valid_grid(16, 1)); | ||
| 279 | CHECK(SamplePositions::valid_grid(4, 4)); | ||
| 280 | CHECK(!SamplePositions::valid_grid(8, 4)); | ||
| 281 | CHECK(!SamplePositions::valid_grid(3, 1)); | ||
| 282 | CHECK(!SamplePositions::valid_grid(4, 0)); | ||
| 283 | CommandList sampled; | ||
| 284 | SamplePositions pattern{4, 4}; | ||
| 285 | pattern.positions[15] = {-8, 7}; | ||
| 286 | CHECK(sampled.set_sample_positions(pattern)); | ||
| 287 | pattern.positions[15] = {0, 0}; | ||
| 288 | CHECK(sampled.set_sample_positions({})); | ||
| 289 | CHECK(sampled.close()); | ||
| 290 | CHECK(!sampled.set_sample_positions(pattern)); | ||
| 291 | const auto& recorded_pattern = std::get<SamplePositions>(sampled.commands()[0]); | ||
| 292 | CHECK(recorded_pattern.positions[15].x == -8 && recorded_pattern.positions[15].y == 7); | ||
| 293 | CHECK(std::get<SamplePositions>(sampled.commands()[1]).samples == 0); | ||
| 278 | // Queries: timestamps only end; other queries are begun and ended in one list, with the same type, and are not | 294 | // Queries: timestamps only end; other queries are begun and ended in one list, with the same type, and are not |
| 279 | // begun twice or resolved while running. Resolve offsets are multiples of 8; a resolve of nothing records nothing. | 295 | // begun twice or resolved while running. Resolve offsets are multiples of 8; a resolve of nothing records nothing. |
| 280 | namespace q = d3d12_query; | 296 | namespace q = d3d12_query; |