Fix MSAA 8x crash and eliminate redundant GPU stalls

- Add error handling: revert to 1x if recreateSwapchain fails
- Clamp requested MSAA to device maximum before applying
- Retry MSAA color image allocation without TRANSIENT on failure
- Remove redundant vkDeviceWaitIdle from WMO/M2/Character recreatePipelines
  (caller already waits once, was causing ~13 stalls instead of 1)
This commit is contained in:
Kelsi 2026-02-22 03:05:55 -08:00
parent e12141a673
commit fa1867cf2f
5 changed files with 17 additions and 7 deletions

View file

@ -384,8 +384,13 @@ bool VkContext::createMsaaColorImage() {
allocInfo.preferredFlags = VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT;
if (vmaCreateImage(allocator, &imgInfo, &allocInfo, &msaaColorImage_, &msaaColorAllocation_, nullptr) != VK_SUCCESS) {
LOG_ERROR("Failed to create MSAA color image");
return false;
// Retry without TRANSIENT (some drivers reject it at high sample counts)
imgInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
allocInfo.preferredFlags = 0;
if (vmaCreateImage(allocator, &imgInfo, &allocInfo, &msaaColorImage_, &msaaColorAllocation_, nullptr) != VK_SUCCESS) {
LOG_ERROR("Failed to create MSAA color image");
return false;
}
}
VkImageViewCreateInfo viewInfo{};