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 combining the surface and surface epr material
batches. Most likely the surface per material batches are used and when
requested they also need the surface batches.
During tests it slightly improves performance as batches aren't thrown
away without using it.
After this patch we can add a quick path for meshes with one material
and two materials.
Alternative approaches that have been checked:
- sync extraction per object: reduced performance to much (-15%) (D8292: [WIP] Fix T77867: Crash Link Duplicating Mesh)
- post checks: reduced the threading issues, but didn't solve it.
- separating preparation and execution of the extraction (D8312: Fix T77867: Link Duplicate Object crashes during batch creation)