Commit 41b6ee4
GraphEvaluator: fix dispatch heuristic + 0-as-passthrough for OutputW/H
Two related bugs surfaced when wiring the new ShaderLab Scale effect
through the bridge:
1) "Fixed-size viewer" detection treated *any* effect declaring
OutputWidth/OutputHeight as a single-group scatter shader and
dispatched (1,1,1). That was correct for CIE Histogram-style
shaders that use [numthreads(32,32,1)] and iterate the whole
source image inside one group, but wrong for per-pixel-tile
shaders like the new Scale that use [numthreads(8,8,1)] and need
(W/8, H/8, 1). With (1,1,1) only 64 threads ran -- painting an
8x8 corner of the output and leaving everything else as the cleared
zeros from the UAV clear (= black).
Replace the parameter-name discriminator with a thread-group-size
one: groups >= 256 threads are treated as single-group scatter
shaders; smaller groups tile per-pixel. The legacy
DiagramSize / OutputSize parameter check stays as a belt-and-
suspenders fallback for any future descriptor that intentionally
uses a small group with single-group dispatch (none today).
2) OutputWidth = 0 / OutputHeight = 0 (= "pass through at source
dims") was being floored at 64 by max(*f, 64.0f). Pass-through
needs to fall through to the upstream-bounds path so the output
texture matches the source.
Drop the floor in the explicitW / explicitH read; treat 0 as
"not set" and let later passes (DiagramSize fallback, then source
bounds fallback) decide. The shaders own per-pixel guard
(`if (dtid.x >= outW) return`) handles the actual size.
Verified: ShaderLab Scale at 0.5x on a 4K HDR video source now
produces correct 1920x1080 Lanczos-3 output (sample center pixel
matches source content, full frame visible).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 1176d79 commit 41b6ee4
1 file changed
Lines changed: 18 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1150 | 1150 | | |
1151 | 1151 | | |
1152 | 1152 | | |
1153 | | - | |
| 1153 | + | |
1154 | 1154 | | |
1155 | | - | |
| 1155 | + | |
1156 | 1156 | | |
1157 | 1157 | | |
1158 | 1158 | | |
1159 | 1159 | | |
1160 | | - | |
| 1160 | + | |
1161 | 1161 | | |
1162 | | - | |
| 1162 | + | |
1163 | 1163 | | |
1164 | 1164 | | |
1165 | 1165 | | |
| |||
1336 | 1336 | | |
1337 | 1337 | | |
1338 | 1338 | | |
1339 | | - | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
1340 | 1352 | | |
1341 | 1353 | | |
1342 | | - | |
1343 | | - | |
1344 | | - | |
1345 | | - | |
| 1354 | + | |
1346 | 1355 | | |
1347 | 1356 | | |
1348 | 1357 | | |
| |||
0 commit comments