Page MenuHome

Fix T77867: Link Duplicate Object crashes during batch creation
AbandonedPublic

Authored by Jeroen Bakker (jbakker) on Jul 16 2020, 3:27 PM.

Details

Summary

When using link duplicated objects it could happen that one object is
calculating the GPUBuffers and the second object is marking these
buffers invalid. This leads to threading issues.

This patch fixes this by separating the preparation extraction part from
the execution part. The preparation is done on the main thread. And the
execution part is done after all the objects have been handled.

In the future we could optimize this for huge scenes if we are able to
detect if a mesh is used multiple times. If not we could already
schedule the extraction during the preparation loop and making the
execution loop smaller. This patch adds a mechanism for it, but doesn't
use it yet.

Alternative approaches have been checked

  1. sync extraction per object: reduced performance to much (-15%)
  2. post checks: reduced the threading issues, but didn't solve it.

Diff Detail

Repository
rB Blender
Branch
T77867b (branched from master)
Build Status
Buildable 9041
Build 9041: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Jul 16 2020, 3:27 PM
Jeroen Bakker (jbakker) created this revision.

After discussion we want to test the next solution:

  • always store batches per material.
  • have a global tri ibo for non material batches (depth, overlay, etc.)
  • quick path for meshes with one material.
  • quick path for meshes with two materials (fill from beginning and fill from end)
This comment was removed by Jeroen Bakker (jbakker).