Bug 1490

Summary: GraphUI Group: Resolve Performance Issues with Shape Mv Transform -> PMVMatrix4f; Group/Scene's temp sorted arrays
Product: [JogAmp] GraphUI Reporter: Sven Gothel <sgothel>
Component: CoreAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: critical    
Priority: P1    
Version: 2.6.0   
Hardware: All   
OS: all   
Type: DEFECT SCM Refs:
a883f3e2e1563736df32573141fd5119f0678c92 bf096870c73898963558bef5c9d75760f9f76290 daf9ae20ebc45c851bc3b8384f4cee3cded8d9dc
Workaround: ---
Bug Depends on:    
Bug Blocks: 805, 1495    

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)