Page MenuHome

Fix T88456: DrawManager: Keep subset RenderMeshData around when geometry does not change.
ClosedPublic

Authored by Jeroen Bakker (jbakker) on May 21 2021, 1:42 PM.

Details

Summary

Reuse loose geometry during selection (and other operations) from
previous calculation. Loose geometry stays the same, but was
recalculated to determine the size of GPU buffers. This patch would
reuse the previous loose geometry when geometry wasn't changed.

Although not the main bottleneck during selection it is measurable.

Master.


rdata 46ms iter 55ms (frame 410ms)

This patch.

rdata 5ms iter 52ms (frame 342ms)

Diff Detail

Repository
rB Blender
Branch
T88456-draw-manager-cache-loose-geometry (branched from master)
Build Status
Buildable 14687
Build 14687: arc lint + arc unit

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.May 21 2021, 1:42 PM
Jeroen Bakker (jbakker) created this revision.
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)May 21 2021, 1:43 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)May 21 2021, 2:06 PM

Changed cache pattern to ensure/load.

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)May 21 2021, 2:19 PM

I like the idea of caching some things that are not changed between renderers.
Could this cache of loose elements be useful in other areas, such as snapping? If so, I think it could be moved outside of MeshRenderData somewhere in the mesh->runtime (I'm just not sure how to handle the different types of mesh - final, cage and uv).
I also find it a bit strange to have a mesh_buffer_cache_clear but leave the tris_per_mat out. It is not really a problem thou.

For now I wouldn't share caches. This allows us to create other optimized structures for drawing and editing and keep good code separation.
And yes this cache could be extended with other stuff as well.

Currently there is a lot of random access to RAM due to the BMesh structure that has measurable performance penalty. If we could accelerate lookup by doing the lookup once and reuse a mapping the next time would be a huge benefit.

Germano Cavalcante (mano-wii) accepted this revision.EditedMay 21 2021, 3:56 PM

OK then.
I will test the patch later. But from what I can see it looks fine.

This revision is now accepted and ready to land.May 31 2021, 9:31 AM