1
0
mirror of synced 2024-09-23 19:18:24 +02:00

fix: 3D visualizer running very slowly with energy saving enabled (#1866)

### Problem description
The bug described in #1663 was caused by an optimization of the display
rendering that uses drawlists to detect changes. The changes in the 3-d
visualizer don't contain drawlists when axes are turned off.

### Implementation description
The fix is to identify the 3d visualizer among the command lists of the
main window and, if found, avoid skipping frames regardless of the
result of the comparison of drawlists.

Closes #1663
This commit is contained in:
paxcut 2024-09-15 06:23:58 -07:00 committed by GitHub
parent a587c5ff74
commit e0b4931a54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -692,8 +692,9 @@ namespace hex {
auto drawData = viewPort->DrawData;
for (int n = 0; n < drawData->CmdListsCount; n++) {
const ImDrawList *cmdList = drawData->CmdLists[n];
std::string ownerName = cmdList->_OwnerName;
if (vtxDataSize == previousVtxDataSize) {
if (vtxDataSize == previousVtxDataSize && (!ownerName.contains("##Popup") || !ownerName.contains("##image"))) {
shouldRender = shouldRender || std::memcmp(previousVtxData.data() + offset, cmdList->VtxBuffer.Data, cmdList->VtxBuffer.size() * sizeof(ImDrawVert)) != 0;
} else {
shouldRender = true;