mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-29 14:33:51 +00:00
fix: return UINT32_MAX from findMemType on failure, add [[nodiscard]]
The findMemType/findMemoryType helper in auth_screen, loading_screen, and vk_context returned 0 on failure — a valid memory type index. Changed to return UINT32_MAX and log an error, so vkAllocateMemory receives an invalid index and fails cleanly rather than silently using the wrong memory type. Add [[nodiscard]] to VkBuffer::uploadToGPU/createMapped and VkContext::initialize/recreateSwapchain so callers that ignore failure are flagged at compile time. Suppress with (void) cast at 3 call sites where failure is non-actionable (resize best-effort).
This commit is contained in:
parent
7028dd64c1
commit
5b91ef398e
6 changed files with 13 additions and 10 deletions
|
|
@ -78,7 +78,8 @@ static uint32_t findMemoryType(VkPhysicalDevice physDevice, uint32_t typeFilter,
|
|||
return i;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
LOG_ERROR("LoadingScreen: no suitable memory type found");
|
||||
return UINT32_MAX;
|
||||
}
|
||||
|
||||
bool LoadingScreen::loadImage(const std::string& path) {
|
||||
|
|
@ -420,7 +421,7 @@ void LoadingScreen::render() {
|
|||
int w = 0, h = 0;
|
||||
SDL_GetWindowSize(sdlWindow, &w, &h);
|
||||
if (w > 0 && h > 0) {
|
||||
vkCtx->recreateSwapchain(w, h);
|
||||
(void)vkCtx->recreateSwapchain(w, h);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue