Commit 1e91a8a
Split Comparison: host-injected output dimensions
D2D pads pixel-shader intermediates to atlas allocation sizes (typically
4096x4096) when an effect output has multiple downstream consumers, so
HLSL `Texture2D::GetDimensions()` returns the atlas size rather than the
true output rect. The previous Split Comparison fix (TRIVIAL_SAMPLING)
got `uv0` into output coordinates, but `GetDimensions()` was still
reporting 4096x4096 -- so the recentering math `uv0 - (W*0.5, H*0.5)`
landed the pivot at (2048, 2048), placing the wipe seam at the bottom
edge of a 3840x2160 video.
Reproducer that I missed last round: two branches forking from the same
upstream effect (e.g. video -> HDR Tone Map -> {Gamut Highlight, Gamut
Highlight}) feeding the two Split inputs. With a single branch
(video -> tone map -> split, with video also direct -> split), D2D
doesn't atlas-pad and GetDimensions matches the rect, so the pivot was
correct. The user's full graph has the fork pattern, exposing the bug.
Fix: dont rely on GetDimensions. Add `OutputW` / `OutputH` (float)
hidden cbuffer fields to the Split shader, and have GraphEvaluator's
pixel-shader EvaluateNode case populate them each frame from the
upstream input's `GetImageLocalBounds`. Generic mechanism: any pixel
shader that declares `OutputW` / `OutputH` parameters gets host-injected
dimensions automatically, gated on the parameter declaration so other
effects pay no per-frame cost.
Bumped Split Comparison effectVersion 4 -> 5.
Also added /render/image-bounds MCP route to expose the raw pre-clamp
GetImageLocalBounds for debugging rect-bloat issues that the capture-node
maxDim clamp would otherwise hide.
Verified: white line at y=1080 of a 2160-tall video output (was at the
bottom edge before). 154/154 tests pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent bad629d commit 1e91a8a
3 files changed
Lines changed: 105 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2392 | 2392 | | |
2393 | 2393 | | |
2394 | 2394 | | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
2395 | 2400 | | |
2396 | 2401 | | |
2397 | 2402 | | |
| |||
2401 | 2406 | | |
2402 | 2407 | | |
2403 | 2408 | | |
2404 | | - | |
2405 | | - | |
2406 | | - | |
2407 | | - | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
2408 | 2416 | | |
2409 | 2417 | | |
2410 | 2418 | | |
2411 | 2419 | | |
2412 | 2420 | | |
2413 | | - | |
2414 | | - | |
2415 | | - | |
2416 | | - | |
2417 | | - | |
2418 | | - | |
2419 | | - | |
2420 | | - | |
2421 | 2421 | | |
2422 | 2422 | | |
2423 | 2423 | | |
| |||
2443 | 2443 | | |
2444 | 2444 | | |
2445 | 2445 | | |
2446 | | - | |
| 2446 | + | |
2447 | 2447 | | |
2448 | 2448 | | |
2449 | 2449 | | |
| |||
2453 | 2453 | | |
2454 | 2454 | | |
2455 | 2455 | | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
2456 | 2460 | | |
2457 | 2461 | | |
2458 | 2462 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1141 | 1175 | | |
1142 | 1176 | | |
1143 | 1177 | | |
| |||
1599 | 1633 | | |
1600 | 1634 | | |
1601 | 1635 | | |
| 1636 | + | |
1602 | 1637 | | |
1603 | 1638 | | |
1604 | 1639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
541 | 594 | | |
542 | 595 | | |
543 | 596 | | |
| |||
0 commit comments