PathTracedEngine
The path tracer behind the engine seam (rendering-revamp §RVA-3).
| Inherits | construct::rendering::IRenderEngine |
In the namespace construct::pathtrace. Declared in src/libs/libconstruct/construct/pathtrace/PathTracedEngine.hpp.
Detailed description
One code path, two hosts (§RVA-6, §XM-0): the viewport worker runs it on its own QRhi, in its own frames (ruling R22), and PathTraceProducer runs it on a WorkerHost of its own for the inline viewport, whose GUI thread never runs the tracer. The host owns the frame: it begins it, calls advance(), ends it, and then calls frameEnded().
advance() records the tiles of the current sample that fit the slice the host was granted (setSliceMs(), the GPU pacer's answer, §RVA-7), cut by the SubmitPlanner of gpu-timeout-recovery §GTR-D1. The sample's last tile also records the readback of the half-sample buffer when the adaptive criterion wants one (§RVR-6); frameEnded() reads it.
frame() carries the last COMPLETE sample: its radiance is the accumulation, and its view version is the version of the view that sample was traced for. After a restart (setSnapshot(), setCamera()) the frame keeps the old view's version until the first sample of the new view completes, which is the staleness gate of §RVA-5: a host that compares the version never shows the old image as current. A setView() with no restart since the last complete sample re-stamps that sample, because nothing it shows changed.