diff --git a/include/rendering/vk_buffer.hpp b/include/rendering/vk_buffer.hpp index 6cb0ba54..f97acb99 100644 --- a/include/rendering/vk_buffer.hpp +++ b/include/rendering/vk_buffer.hpp @@ -24,11 +24,11 @@ public: VkBuffer& operator=(VkBuffer&& other) noexcept; // Create a GPU-local buffer and upload data via staging - bool uploadToGPU(VkContext& ctx, const void* data, VkDeviceSize size, + [[nodiscard]] bool uploadToGPU(VkContext& ctx, const void* data, VkDeviceSize size, VkBufferUsageFlags usage); // Create a host-visible buffer (for uniform/dynamic data updated each frame) - bool createMapped(VmaAllocator allocator, VkDeviceSize size, + [[nodiscard]] bool createMapped(VmaAllocator allocator, VkDeviceSize size, VkBufferUsageFlags usage); // Update mapped buffer contents (only valid for mapped buffers) diff --git a/include/rendering/vk_context.hpp b/include/rendering/vk_context.hpp index c9926cf5..4cc7c109 100644 --- a/include/rendering/vk_context.hpp +++ b/include/rendering/vk_context.hpp @@ -32,11 +32,11 @@ public: VkContext(const VkContext&) = delete; VkContext& operator=(const VkContext&) = delete; - bool initialize(SDL_Window* window); + [[nodiscard]] bool initialize(SDL_Window* window); void shutdown(); // Swapchain management - bool recreateSwapchain(int width, int height); + [[nodiscard]] bool recreateSwapchain(int width, int height); // Frame operations VkCommandBuffer beginFrame(uint32_t& imageIndex); diff --git a/src/rendering/loading_screen.cpp b/src/rendering/loading_screen.cpp index 8bbf4013..6916380f 100644 --- a/src/rendering/loading_screen.cpp +++ b/src/rendering/loading_screen.cpp @@ -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); } } diff --git a/src/rendering/renderer.cpp b/src/rendering/renderer.cpp index 85c5ae5b..2f674153 100644 --- a/src/rendering/renderer.cpp +++ b/src/rendering/renderer.cpp @@ -941,7 +941,7 @@ void Renderer::applyMsaaChange() { if (!vkCtx->recreateSwapchain(window->getWidth(), window->getHeight())) { LOG_ERROR("MSAA change failed — reverting to 1x"); vkCtx->setMsaaSamples(VK_SAMPLE_COUNT_1_BIT); - vkCtx->recreateSwapchain(window->getWidth(), window->getHeight()); + (void)vkCtx->recreateSwapchain(window->getWidth(), window->getHeight()); } // Recreate all sub-renderer pipelines (they embed sample count from render pass) @@ -1051,7 +1051,7 @@ void Renderer::beginFrame() { // Handle swapchain recreation if needed if (vkCtx->isSwapchainDirty()) { - vkCtx->recreateSwapchain(window->getWidth(), window->getHeight()); + (void)vkCtx->recreateSwapchain(window->getWidth(), window->getHeight()); // Rebuild water resources that reference swapchain extent/views if (waterRenderer) { waterRenderer->recreatePipelines(); diff --git a/src/rendering/vk_context.cpp b/src/rendering/vk_context.cpp index b21838ee..bf563c8d 100644 --- a/src/rendering/vk_context.cpp +++ b/src/rendering/vk_context.cpp @@ -1176,7 +1176,8 @@ static uint32_t findMemType(VkPhysicalDevice physDev, uint32_t typeFilter, VkMem if ((typeFilter & (1 << i)) && (memProps.memoryTypes[i].propertyFlags & props) == props) return i; } - return 0; + LOG_ERROR("VkContext: no suitable memory type found"); + return UINT32_MAX; } VkDescriptorSet VkContext::uploadImGuiTexture(const uint8_t* rgba, int width, int height) { diff --git a/src/ui/auth_screen.cpp b/src/ui/auth_screen.cpp index 3c8b2d79..295739ed 100644 --- a/src/ui/auth_screen.cpp +++ b/src/ui/auth_screen.cpp @@ -786,7 +786,8 @@ static uint32_t findMemType(VkPhysicalDevice pd, uint32_t filter, VkMemoryProper for (uint32_t i = 0; i < mp.memoryTypeCount; i++) { if ((filter & (1 << i)) && (mp.memoryTypes[i].propertyFlags & props) == props) return i; } - return 0; + LOG_ERROR("AuthScreen: no suitable memory type found"); + return UINT32_MAX; } bool AuthScreen::loadBackgroundImage() {