Drop a detail pass that changes nothing when it sits between two others
Capture sharpening at a scale too coarse to draw its radius emits one pass with an empty body (`nothing_to_sharpen`), so that a chain still ends in something that performs the output transform. At fit on any modern sensor that is most of the time. When another neighbourhood operation follows it - dehaze, clarity, texture - the pass is not last and does nothing: it reads the rgba16float intermediate and writes the same texels to the other one. It still cost a full render-sized read and write every frame: scene before after sharpen+clarity 2560x1600 fit 18.66 ms 14.16 ms sharpen+clarity 3840x2160 fit 37.93 ms 27.88 ms every operation 2560x1600 fit 71.80 ms 67.24 ms clarity alone 2560x1600 fit 14.23 ms 14.20 ms (control) sharpen+clarity 2560x1600 1:1 23.01 ms 22.97 ms (control: resolves) (Laptop RTX 3050 held at 420/810 MHz by its power cap, synthetic 60 MP source, median of five alternated runs of forty frames each.) `compose_detail_with` now drops such a pass where dropping it is exact: not the last pass, whose output transform would otherwise move onto the previous pass's f32 result and round differently; and not a pass right after a reduced one, because a full-resolution pass is what closes the reduced chain for the operation after it. `DetailPass::is_identity` says what "changes nothing" means: full size, nothing bound at binding 3, and a body with no code in it. The rgba8 output is bit-identical: every scene above hashed the same before and after, and the sharpen+clarity frame hashes the same as clarity on its own, which is the claim in one line. A new dr-pipeline test pins the three cases - dropped ahead of another operation, kept when last, kept when alone.
This commit is contained in:
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user