Page MenuHome

Cycles: code refactor to bake using regular render session and tiles
Needs ReviewPublic

Authored by Brecht Van Lommel (brecht) on Mar 17 2018, 5:12 PM.


Group Reviewers

There should be no user visible change from this, except that tile size
now affects performance. The goal here is to simplify bake denoising in
D3099, letting it reuse more denoising tiles and pass code.

A lot of code is now shared with regular rendering, with the two main
differences being that we read some render result passes from the bake API
when starting to render a tile, and call the bake kernel instead of the
path trace kernel.

With this kind of design where Cycles asks for tiles from the bake API,
it should eventually be easier to reduce memory usage, show tiles as
they are baked, or bake multiple passes at once, though there's still
quite some work needed for that.

Diff Detail

rB Blender
arcpatch-D3108 (branched from master)
Build Status
Buildable 3563
Build 3563: arc lint + arc unit

Event Timeline

Rebased to current master, still works fine as far as I can tell.

I think it makes sense to move forward with this patch - I don't think I'll have the time to look into cross-seam baking denoising anytime soon, and that way we could at least improve the code and get regular baking denoising.

Also, the register pressure optimizations seem to be independent from the other changes, maybe we should just commit those separately?

  • Rebase patch to latest master
  • Fix merge issues caused by formatting commits
  • Adapt the fix for T60973 to the new baking implementation
  • Fix two bugs in render_result_from_bake: In the case where the object_id doesn't match, the code was doing a real cast instead of a bitwise cast to -1 and didn't increment to the next pixel