diff --git a/lib/graphics_engine/src/ge_vulkan_shader_manager.cpp b/lib/graphics_engine/src/ge_vulkan_shader_manager.cpp index dfff09c0a..9ddcd68b8 100644 --- a/lib/graphics_engine/src/ge_vulkan_shader_manager.cpp +++ b/lib/graphics_engine/src/ge_vulkan_shader_manager.cpp @@ -126,7 +126,14 @@ void GEVulkanShaderManager::loadAllShaders() GEVulkanCommandLoader::addMultiThreadingCommand( [pair, kind, filename]() { - pair->second = loadShader(kind, filename); + try + { + pair->second = loadShader(kind, filename); + } + catch (std::exception& e) + { + printf("%s", e.what()); + } pair->first.unlock(); }); } @@ -272,6 +279,8 @@ VkShaderModule GEVulkanShaderManager::getShader(const std::string& filename) auto it = g_shaders.at(filename); it->first.lock(); it->first.unlock(); + if (it->second == VK_NULL_HANDLE) + throw std::runtime_error(std::string("Missing shader ") + filename); return it->second; } // getShader