Commit bcd0c67
committed
perf(glsm): upload only the vertex range a client-array draw actually reads
Root cause of the F3/GUI FPS collapse (140+ -> 15 fps with the debug
overlay open, sluggish inventory/video-settings screens): 2f54db7 widened
captured client pointers to the whole underlying allocation to stay
correct when HBM-CE mutates the BufferBuilder limit after setting a
pointer. uploadClientArraysToVBO then re-uploaded that entire allocation
(>4MB observed, ~1.1ms per upload on PCIe) on EVERY draw issued while a
mod leaves client-state attribs enabled. Text/rect-heavy GUI frames issue
hundreds of draws, multiplying this into ~57ms/frame.
glDrawArrays (and the QUADS path through QuadConverter, whose shared EBO
references exactly [first, first+count)) knows the drawn vertex range, so
per-attrib uploads are now clamped to the bytes that range can read via
VertexAttribState.computeUploadLength; indexed draws with an unknown max
index keep the full-allocation upload. Escape hatch:
-Dactinium.glsmFullClientArrayUpload=true.
Also adds clientArray.stackSample caller attribution to the periodic GLSM
perf report to identify which mod drives large uploads.1 parent f499c63 commit bcd0c67
4 files changed
Lines changed: 165 additions & 8 deletions
File tree
- glsm/src/main/java/com/gtnewhorizons/angelica/glsm
- debug
- states
- src/test/java/com/gtnewhorizons/angelica/glsm/states
Lines changed: 26 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
434 | 436 | | |
435 | 437 | | |
436 | 438 | | |
| 439 | + | |
437 | 440 | | |
438 | 441 | | |
439 | 442 | | |
| |||
2517 | 2520 | | |
2518 | 2521 | | |
2519 | 2522 | | |
2520 | | - | |
| 2523 | + | |
2521 | 2524 | | |
2522 | 2525 | | |
2523 | 2526 | | |
| |||
2548 | 2551 | | |
2549 | 2552 | | |
2550 | 2553 | | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2551 | 2558 | | |
2552 | 2559 | | |
2553 | 2560 | | |
2554 | | - | |
| 2561 | + | |
2555 | 2562 | | |
2556 | 2563 | | |
2557 | 2564 | | |
2558 | 2565 | | |
2559 | 2566 | | |
2560 | 2567 | | |
2561 | 2568 | | |
2562 | | - | |
2563 | | - | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
2564 | 2575 | | |
2565 | | - | |
| 2576 | + | |
2566 | 2577 | | |
2567 | 2578 | | |
| 2579 | + | |
2568 | 2580 | | |
2569 | 2581 | | |
2570 | 2582 | | |
2571 | 2583 | | |
2572 | 2584 | | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
2573 | 2588 | | |
2574 | | - | |
| 2589 | + | |
2575 | 2590 | | |
2576 | 2591 | | |
2577 | 2592 | | |
| |||
2600 | 2615 | | |
2601 | 2616 | | |
2602 | 2617 | | |
2603 | | - | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
2604 | 2621 | | |
2605 | 2622 | | |
2606 | 2623 | | |
2607 | 2624 | | |
2608 | 2625 | | |
2609 | 2626 | | |
| 2627 | + | |
2610 | 2628 | | |
2611 | 2629 | | |
2612 | 2630 | | |
| |||
2628 | 2646 | | |
2629 | 2647 | | |
2630 | 2648 | | |
2631 | | - | |
| 2649 | + | |
2632 | 2650 | | |
2633 | 2651 | | |
2634 | 2652 | | |
| |||
Lines changed: 40 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
115 | 118 | | |
| |||
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
153 | 170 | | |
154 | 171 | | |
155 | 172 | | |
| |||
228 | 245 | | |
229 | 246 | | |
230 | 247 | | |
| 248 | + | |
231 | 249 | | |
232 | 250 | | |
233 | 251 | | |
| |||
298 | 316 | | |
299 | 317 | | |
300 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
301 | 341 | | |
302 | 342 | | |
303 | 343 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
104 | 123 | | |
105 | 124 | | |
106 | 125 | | |
| |||
Lines changed: 80 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
0 commit comments