Page MenuHome

DrawManager: Cache material offsets.
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Jun 15 2021, 1:33 PM.

Details

Summary

When using multiple materials in a single mesh the most time is spend in
counting the offsets of each material for the sorting.

This patch moves the counting of the offsets to render mesh data and
caches it as long as the geometry doesn't change.

This patch doesn't include multithreading of this code.

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 15209
Build 15209: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Jun 15 2021, 1:33 PM
Jeroen Bakker (jbakker) created this revision.
  • Renamed SEQ_sequence_lookup_destruct to SEQ_sequence_lookup_free.
  • Removed unused parameter in seq_sequence_lookup_new.
  • Use BLI_ghash_str_new to create lookup hashmap, all names are zero-terminated.
  • Revert "DrawManager: Cache material offsets."

Resend diff after incorrect sending the previous time.

Looks good.
Maybe the name mat_offsets.tri could be more descriptive like mat_offsets.tri_len, but it's not really a problem.

This revision is now accepted and ready to land.Jun 15 2021, 3:22 PM

Well they aren't really lengths or counts. in the end they are offsets. I found mat_offsets.tri_offsets a bit too long.

This revision was automatically updated to reflect the committed changes.