Bug 1490 - GraphUI Group: Resolve Performance Issues with Shape Mv Transform -> PMVMatrix4f; Group/Scene's temp sorted arrays
Summary: GraphUI Group: Resolve Performance Issues with Shape Mv Transform -> PMVMatri...
Alias: None
Product: GraphUI
Classification: JogAmp
Component: Core (show other bugs)
Version: 2.6.0
Hardware: All all
: P1 critical
Assignee: Sven Gothel
Depends on:
Blocks: 805 1495
  Show dependency treegraph
Reported: 2024-01-22 03:08 CET by Sven Gothel
Modified: 2024-01-31 11:41 CET (History)
0 users

See Also:
SCM Refs:
a883f3e2e1563736df32573141fd5119f0678c92 bf096870c73898963558bef5c9d75760f9f76290 daf9ae20ebc45c851bc3b8384f4cee3cded8d9dc
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2024-01-22 03:08:55 CET
Shape.setTransformMv() is called for each renderer frame and for each shape,
involving 6 Matrix4f.mul() and set*() operations.

Since mutation of shape's position, rotation or scale is less frequent
than rendering one frame (for all shapes),
it is more efficient to maintain a local Matrix4f and update it 
on such single mutations.

Rendering then only needs to perform one Matrix4f.mul() operation
using this internal matrix.

Also change name from setTransformMv(PMVMatrix4f) to transformMvTo(PMVMatrix4f),
as its name might be misleading.


Group/Scene's uses temp arrays for Z oder sorting,
which should be maintained locally to avoid too many temp object creations.
Comment 1 Sven Gothel 2024-01-22 05:55:05 CET
commmit a883f3e2e1563736df32573141fd5119f0678c92

Modified Shape.setTransformMv() as described.

Renamed Shape.setTransformMv(PMVMatrix4f) to applyMatToMv(PMVMatrix4f)
Comment 2 Sven Gothel 2024-01-22 06:03:00 CET
commit bf096870c73898963558bef5c9d75760f9f76290
Bug 1490 - GraphUI Performance: Group/Scene: Use temp sorted arrays
Comment 3 Sven Gothel 2024-01-22 06:38:54 CET
commit daf9ae20ebc45c851bc3b8384f4cee3cded8d9dc (HEAD -> master)

Add missing rename Shape.transformMvTo() -> applyMatToMv(), an transformMvTo() was an intermediate rename (oops)