fix(vulkan): re-allocate megaBoneSet_ after descriptor pool reset and fix PlayerFrame ImGui crash
Some checks failed
Build / Build (arm64) (push) Has been cancelled
Build / Build (x86-64) (push) Has been cancelled
Build / Build (macOS arm64) (push) Has been cancelled
Build / Build (windows-arm64) (push) Has been cancelled
Build / Build (windows-x86-64) (push) Has been cancelled
Security / CodeQL (C/C++) (push) Has been cancelled
Security / Semgrep (push) Has been cancelled
Security / Sanitizer Build (ASan/UBSan) (push) Has been cancelled

Re-allocate megaBoneSet_[0..1] in M2Renderer::clear() after vkResetDescriptorPool invalidates all
sets from boneDescPool_. Stale handles were bound to command buffers during rendering, causing
cascading validation errors. Also add ImGui::Dummy() after SetCursorScreenPos in the shaman totem
bar to satisfy ImGui's window boundary extension assertion.
This commit is contained in:
Kelsi 2026-04-15 13:22:30 -07:00
parent 01fecbf3e0
commit f9f02569d6
2 changed files with 18 additions and 0 deletions

View file

@ -330,6 +330,23 @@ void M2Renderer::clear() {
write.pBufferInfo = &bufInfo;
vkUpdateDescriptorSets(device, 1, &write, 0, nullptr);
}
// Re-allocate mega bone sets (invalidated by pool reset)
for (int i = 0; i < 2; i++) {
megaBoneSet_[i] = allocateBoneSet();
if (megaBoneSet_[i] && megaBoneBuffer_[i]) {
VkDescriptorBufferInfo mbInfo{};
mbInfo.buffer = megaBoneBuffer_[i];
mbInfo.offset = 0;
mbInfo.range = MEGA_BONE_MAX_INSTANCES * MAX_BONES_PER_INSTANCE * sizeof(glm::mat4);
VkWriteDescriptorSet mw{VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET};
mw.dstSet = megaBoneSet_[i];
mw.dstBinding = 0;
mw.descriptorCount = 1;
mw.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
mw.pBufferInfo = &mbInfo;
vkUpdateDescriptorSets(device, 1, &mw, 0, nullptr);
}
}
}
}
models.clear();

View file

@ -464,6 +464,7 @@ void GameScreen::renderPlayerFrame(game::GameHandler& gameHandler) {
}
}
ImGui::SetCursorScreenPos(ImVec2(cursor.x, cursor.y + slotH + 2.0f));
ImGui::Dummy(ImVec2(totalW, 0.0f));
}
}