Page MenuHome

Cleanup: Optimize gl query code path
ClosedPublic

Authored by Jesse Yurkovich (deadpin) on Jan 10 2022, 7:42 AM.

Details

Summary

Currently whenever gl queries are performed for the viewport, a large
1024 byte array is allocated to store the query results (256 of them).

Unfortunately, if any gizmo using a draw_select callback is active
(e.g. the transform gizmos), these queries (and allocations) will occur
during every mouse move event.

Change the vector to allow for up to 16 query results before making an
allocation. This provides enough space for every built-in gizmo except
Scale Cage (which needs 27 queries). It also removes unnecessary
allocations from two other related vectors used during query processing.

Diff Detail

Repository
rB Blender

Event Timeline

Jesse Yurkovich (deadpin) requested review of this revision.Jan 10 2022, 7:42 AM
Jesse Yurkovich (deadpin) created this revision.

Using small vector optimization is a good way to increase performance in this case.

This revision is now accepted and ready to land.Feb 11 2022, 3:27 PM
This revision was automatically updated to reflect the committed changes.