diff --git a/modules/asset_loader/src/vkcv/asset/asset_loader.cpp b/modules/asset_loader/src/vkcv/asset/asset_loader.cpp index 3f32d61e9c95ccb51207a3795a590230e9d95b36..5c868b73766899f68be455eb96a140e30abd4910 100644 --- a/modules/asset_loader/src/vkcv/asset/asset_loader.cpp +++ b/modules/asset_loader/src/vkcv/asset/asset_loader.cpp @@ -17,7 +17,7 @@ namespace vkcv::asset { * @param path The path to the file that was responsible for the exception */ static void recurseExceptionPrint(const std::exception& e, const std::string &path) { - vkcv_log(LogLevel::ERROR, "Loading file %s: %s", path.c_str(), e.what()); + vkcv_log(LogLevel::ERROR, "Loading file %s: %s", path.string().c_str(), e.what()); try { std::rethrow_if_nested(e); @@ -554,7 +554,7 @@ namespace vkcv::asset { // file has to contain at least one mesh if (sceneObjects.meshes.empty()) { - vkcv_log(LogLevel::ERROR, "No meshes found! (%s)", path.c_str()); + vkcv_log(LogLevel::ERROR, "No meshes found! (%s)", path.string().c_str()); return ASSET_ERROR; } else { scene.meshes.reserve(sceneObjects.meshes.size()); @@ -565,7 +565,7 @@ namespace vkcv::asset { if (loadVertexGroups(sceneObjects.meshes[i], sceneObjects, scene, mesh) != ASSET_SUCCESS) { vkcv_log(LogLevel::ERROR, "Failed to load vertex groups of '%s'! (%s)", - mesh.name.c_str(), path.c_str()); + mesh.name.c_str(), path.string().c_str()); return ASSET_ERROR; } @@ -625,7 +625,8 @@ namespace vkcv::asset { } if (sceneObjects.samplers.empty()) { - vkcv_log(LogLevel::WARNING, "No samplers found! (%s)", path.c_str()); + vkcv_log(LogLevel::WARNING, "No samplers found! (%s)", + path.string().c_str()); } else { scene.samplers.reserve(sceneObjects.samplers.size()); @@ -635,7 +636,8 @@ namespace vkcv::asset { } if (sceneObjects.textures.empty()) { - vkcv_log(LogLevel::WARNING, "No textures found! (%s)", path.c_str()); + vkcv_log(LogLevel::WARNING, "No textures found! (%s)", + path.string().c_str()); } else { scene.textures.reserve(sceneObjects.textures.size()); @@ -647,7 +649,7 @@ namespace vkcv::asset { } else if (static_cast<size_t>(textureObject.sampler) >= scene.samplers.size()) { vkcv_log(LogLevel::ERROR, "Sampler of texture '%s' missing (%s)", - textureObject.name.c_str(), path.c_str()); + textureObject.name.c_str(), path.string().c_str()); return ASSET_ERROR; } else { texture.sampler = textureObject.sampler; @@ -656,7 +658,7 @@ namespace vkcv::asset { if ((textureObject.source < 0) || (static_cast<size_t>(textureObject.source) >= sceneObjects.images.size())) { vkcv_log(LogLevel::ERROR, "Failed to load texture '%s' (%s)", - textureObject.name.c_str(), path.c_str()); + textureObject.name.c_str(), path.string().c_str()); return ASSET_ERROR; } @@ -679,7 +681,8 @@ namespace vkcv::asset { } if (sceneObjects.materials.empty()) { - vkcv_log(LogLevel::WARNING, "No materials found! (%s)", path.c_str()); + vkcv_log(LogLevel::WARNING, "No materials found! (%s)", + path.string().c_str()); } else { scene.materials.reserve(sceneObjects.materials.size()); @@ -746,7 +749,7 @@ namespace vkcv::asset { if (!data) { vkcv_log(LogLevel::ERROR, "Texture could not be loaded from '%s'", - texture.path.c_str()); + texture.path.string().c_str()); texture.width = 0; texture.height = 0; @@ -777,7 +780,7 @@ namespace vkcv::asset { const int result = loadTextureData(scene.textures[material.baseColor]); if (ASSET_SUCCESS != result) { vkcv_log(LogLevel::ERROR, "Failed loading baseColor texture of mesh '%s'", - mesh.name.c_str()) + mesh.name.c_str()) return result; } } @@ -786,7 +789,7 @@ namespace vkcv::asset { const int result = loadTextureData(scene.textures[material.metalRough]); if (ASSET_SUCCESS != result) { vkcv_log(LogLevel::ERROR, "Failed loading metalRough texture of mesh '%s'", - mesh.name.c_str()) + mesh.name.c_str()) return result; } } @@ -795,7 +798,7 @@ namespace vkcv::asset { const int result = loadTextureData(scene.textures[material.normal]); if (ASSET_SUCCESS != result) { vkcv_log(LogLevel::ERROR, "Failed loading normal texture of mesh '%s'", - mesh.name.c_str()) + mesh.name.c_str()) return result; } } @@ -804,7 +807,7 @@ namespace vkcv::asset { const int result = loadTextureData(scene.textures[material.occlusion]); if (ASSET_SUCCESS != result) { vkcv_log(LogLevel::ERROR, "Failed loading occlusion texture of mesh '%s'", - mesh.name.c_str()) + mesh.name.c_str()) return result; } } @@ -813,7 +816,7 @@ namespace vkcv::asset { const int result = loadTextureData(scene.textures[material.emissive]); if (ASSET_SUCCESS != result) { vkcv_log(LogLevel::ERROR, "Failed loading emissive texture of mesh '%s'", - mesh.name.c_str()) + mesh.name.c_str()) return result; } } @@ -828,7 +831,7 @@ namespace vkcv::asset { if (result != ASSET_SUCCESS) { vkcv_log(LogLevel::ERROR, "Loading scene failed '%s'", - path.c_str()); + path.string().c_str()); return result; } @@ -843,7 +846,7 @@ namespace vkcv::asset { if (result != ASSET_SUCCESS) { vkcv_log(LogLevel::ERROR, "Loading mesh with index %d failed '%s'", - static_cast<int>(i), path.c_str()); + static_cast<int>(i), path.string().c_str()); return result; } } diff --git a/modules/gui/src/vkcv/gui/GUI.cpp b/modules/gui/src/vkcv/gui/GUI.cpp index 7978b10a4a515b022868fb357b6aa3f123a3d7e0..df30951afee81a97c403d5f860676a9d0e361f22 100644 --- a/modules/gui/src/vkcv/gui/GUI.cpp +++ b/modules/gui/src/vkcv/gui/GUI.cpp @@ -15,7 +15,8 @@ namespace vkcv::gui { const auto result = vk::Result(resultCode); - vkcv_log(LogLevel::ERROR, "ImGui has a problem with Vulkan! (%s)", vk::to_string(result).c_str()); + vkcv_log(LogLevel::ERROR, "ImGui has a problem with Vulkan! (%s)", + vk::to_string(result).c_str()); } GUI::GUI(Core& core, WindowHandle& windowHandle) : diff --git a/modules/scene/src/vkcv/scene/Scene.cpp b/modules/scene/src/vkcv/scene/Scene.cpp index b2b65a4a405d5adc9cf1e7933bd096ab61652a52..76b7de782f6d44ed927d4a88b4f323b9871a19f3 100644 --- a/modules/scene/src/vkcv/scene/Scene.cpp +++ b/modules/scene/src/vkcv/scene/Scene.cpp @@ -364,7 +364,8 @@ namespace vkcv::scene { asset::Scene asset_scene; if (!asset::loadScene(path.string(), asset_scene)) { - vkcv_log(LogLevel::ERROR, "Scene could not be loaded (%s)", path.c_str()); + vkcv_log(LogLevel::ERROR, "Scene could not be loaded (%s)", + path.string().c_str()); return create(core); } diff --git a/modules/shader_compiler/src/vkcv/shader/Compiler.cpp b/modules/shader_compiler/src/vkcv/shader/Compiler.cpp index 842ad6ab2ab2edd69bf24c529cf8296b1b3f8b1c..5a7e60e6ec6826e141f7f45e53f0e6c42e334c2d 100644 --- a/modules/shader_compiler/src/vkcv/shader/Compiler.cpp +++ b/modules/shader_compiler/src/vkcv/shader/Compiler.cpp @@ -14,7 +14,8 @@ namespace vkcv::shader { const std::filesystem::path directory = generateTemporaryDirectoryPath(); if (!std::filesystem::create_directory(directory)) { - vkcv_log(LogLevel::ERROR, "The directory could not be created (%s)", directory.c_str()); + vkcv_log(LogLevel::ERROR, "The directory could not be created (%s)", + directory.string().c_str()); return false; } @@ -51,7 +52,8 @@ namespace vkcv::shader { bool result = readTextFromFile(shaderPath, shaderCode); if (!result) { - vkcv_log(LogLevel::ERROR, "Loading shader failed: (%s)", shaderPath.string().c_str()); + vkcv_log(LogLevel::ERROR, "Loading shader failed: (%s)", + shaderPath.string().c_str()); } if (!includePath.empty()) { @@ -61,7 +63,8 @@ namespace vkcv::shader { } if (!result) { - vkcv_log(LogLevel::ERROR, "Shader compilation failed: (%s)", shaderPath.string().c_str()); + vkcv_log(LogLevel::ERROR, "Shader compilation failed: (%s)", + shaderPath.string().c_str()); } if (update) { diff --git a/modules/shader_compiler/src/vkcv/shader/GLSLCompiler.cpp b/modules/shader_compiler/src/vkcv/shader/GLSLCompiler.cpp index e469152fa4023f505959239ed47f5dcacf108923..e6823e5edee8fc180da5727bba6f4f534d5fc2b7 100644 --- a/modules/shader_compiler/src/vkcv/shader/GLSLCompiler.cpp +++ b/modules/shader_compiler/src/vkcv/shader/GLSLCompiler.cpp @@ -236,7 +236,7 @@ namespace vkcv::shader { false, false, messages, &preprocessedGLSL, includer)) { vkcv_log(LogLevel::ERROR, "Shader preprocessing failed {\n%s\n%s\n}", - shader.getInfoLog(), shader.getInfoDebugLog()); + shader.getInfoLog(), shader.getInfoDebugLog()); return false; } @@ -245,7 +245,7 @@ namespace vkcv::shader { if (!shader.parse(&resources, 100, false, messages)) { vkcv_log(LogLevel::ERROR, "Shader parsing failed {\n%s\n%s\n}", - shader.getInfoLog(), shader.getInfoDebugLog()); + shader.getInfoLog(), shader.getInfoDebugLog()); return false; } @@ -253,7 +253,7 @@ namespace vkcv::shader { if (!program.link(messages)) { vkcv_log(LogLevel::ERROR, "Shader linking failed {\n%s\n%s\n}", - shader.getInfoLog(), shader.getInfoDebugLog()); + shader.getInfoLog(), shader.getInfoDebugLog()); return false; } diff --git a/modules/shader_compiler/src/vkcv/shader/HLSLCompiler.cpp b/modules/shader_compiler/src/vkcv/shader/HLSLCompiler.cpp index 0d3991d1aef6787ab8042d67b1ef5f161959a2ba..965664794a3d24a6e7ecb8246e95f946c1ce07a0 100644 --- a/modules/shader_compiler/src/vkcv/shader/HLSLCompiler.cpp +++ b/modules/shader_compiler/src/vkcv/shader/HLSLCompiler.cpp @@ -232,7 +232,7 @@ namespace vkcv::shader { false, false, messages, &preprocessedHLSL, includer)) { vkcv_log(LogLevel::ERROR, "Shader preprocessing failed {\n%s\n%s\n}", - shader.getInfoLog(), shader.getInfoDebugLog()); + shader.getInfoLog(), shader.getInfoDebugLog()); return false; } @@ -241,7 +241,7 @@ namespace vkcv::shader { if (!shader.parse(&resources, 100, false, messages)) { vkcv_log(LogLevel::ERROR, "Shader parsing failed {\n%s\n%s\n}", - shader.getInfoLog(), shader.getInfoDebugLog()); + shader.getInfoLog(), shader.getInfoDebugLog()); return false; } @@ -249,7 +249,7 @@ namespace vkcv::shader { if (!program.link(messages)) { vkcv_log(LogLevel::ERROR, "Shader linking failed {\n%s\n%s\n}", - shader.getInfoLog(), shader.getInfoDebugLog()); + shader.getInfoLog(), shader.getInfoDebugLog()); return false; } diff --git a/modules/shader_compiler/src/vkcv/shader/SlangCompiler.cpp b/modules/shader_compiler/src/vkcv/shader/SlangCompiler.cpp index 7feff09b5190cc36d6f25ee9a230335c1435cf0d..0e610bb7a796c7fc908cfbffe0be2b8bce048ac2 100644 --- a/modules/shader_compiler/src/vkcv/shader/SlangCompiler.cpp +++ b/modules/shader_compiler/src/vkcv/shader/SlangCompiler.cpp @@ -109,7 +109,7 @@ namespace vkcv::shader { sessionDesc.targets = &targetDesc; sessionDesc.targetCount = 1; - const char *searchPath = includePath.c_str(); + const char *searchPath = includePath.string().c_str(); sessionDesc.searchPaths = &searchPath; sessionDesc.searchPathCount = 1; diff --git a/src/vkcv/Core.cpp b/src/vkcv/Core.cpp index 3cefdab895e1f5fb4fc34c2c1f4332f62e86464b..a402067d1d1d76d9791cae7e865a69a3354f9875 100644 --- a/src/vkcv/Core.cpp +++ b/src/vkcv/Core.cpp @@ -896,7 +896,7 @@ namespace vkcv { if ((result != vk::Result::eSuccess) && (result != vk::Result::eSuboptimalKHR)) { vkcv_log(LogLevel::ERROR, "Swapchain presentation failed (%s)", - vk::to_string(result).c_str()); + vk::to_string(result).c_str()); } else if (result == vk::Result::eSuboptimalKHR) { vkcv_log(LogLevel::WARNING, "Swapchain presentation is suboptimal"); m_SwapchainManager->signalRecreation(swapchainHandle); diff --git a/src/vkcv/DescriptorSetManager.cpp b/src/vkcv/DescriptorSetManager.cpp index d4ffce7480853bbd907ef3dc61ed317ae04e9220..74b4b291d309bbc0c8b50e5e35ca1e30acad30f6 100644 --- a/src/vkcv/DescriptorSetManager.cpp +++ b/src/vkcv/DescriptorSetManager.cpp @@ -165,7 +165,7 @@ namespace vkcv { if (result != vk::Result::eSuccess) { vkcv_log(LogLevel::ERROR, "Failed to create descriptor set (%s)", - vk::to_string(result).c_str()); + vk::to_string(result).c_str()); return {}; } }; diff --git a/src/vkcv/FeatureManager.cpp b/src/vkcv/FeatureManager.cpp index fe7537beae0640afba91ee0150e1aa5bd8b3abb9..e18598e06d60d482d09eccab9ab9674f52e21ab9 100644 --- a/src/vkcv/FeatureManager.cpp +++ b/src/vkcv/FeatureManager.cpp @@ -627,13 +627,17 @@ namespace vkcv { const char* clone = strclone(extension.c_str()); if (!clone) { - vkcv_log(LogLevel::WARNING, "Extension '%s' is not valid", extension.c_str()); + vkcv_log(LogLevel::WARNING, "Extension '%s' is not valid", + extension.c_str()); return false; } if (!isExtensionSupported(extension)) { - vkcv_log((required ? LogLevel::ERROR : LogLevel::WARNING), - "Extension '%s' is not supported", extension.c_str()); + vkcv_log( + (required ? LogLevel::ERROR : LogLevel::WARNING), + "Extension '%s' is not supported", + extension.c_str() + ); delete [] clone; if (required) { diff --git a/src/vkcv/File.cpp b/src/vkcv/File.cpp index 702ae899b77a963719e7921ba2625704c205ba81..0b1328f4f790b34f5a2cd6cfbd6a2eb5c6890e8d 100644 --- a/src/vkcv/File.cpp +++ b/src/vkcv/File.cpp @@ -62,7 +62,8 @@ namespace vkcv { std::ofstream file (path.string(), std::ios::out); if (!file.is_open()) { - vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", path.c_str()); + vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", + path.string().c_str()); return false; } @@ -78,7 +79,8 @@ namespace vkcv { std::ofstream file (path.string(), std::ios::out); if (!file.is_open()) { - vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", path.c_str()); + vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", + path.string().c_str()); return false; } @@ -97,7 +99,8 @@ namespace vkcv { std::ofstream file (path.string(), std::ios::out); if (!file.is_open()) { - vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", path.c_str()); + vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", + path.string().c_str()); return false; } @@ -113,7 +116,8 @@ namespace vkcv { std::ifstream file (path.string(), std::ios::ate); if (!file.is_open()) { - vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", path.c_str()); + vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", + path.string().c_str()); return false; } @@ -132,14 +136,16 @@ namespace vkcv { std::ifstream file (path.string(), std::ios::ate); if (!file.is_open()) { - vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", path.c_str()); + vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", + path.string().c_str()); return false; } const std::streamsize fileSize = file.tellg(); if (fileSize % sizeof(uint32_t) != 0) { - vkcv_log(LogLevel::ERROR, "The file is not a valid binary: %s", path.c_str()); + vkcv_log(LogLevel::ERROR, "The file is not a valid binary: %s", + path.string().c_str()); return false; } @@ -160,7 +166,8 @@ namespace vkcv { std::ifstream file (path.string(), std::ios::ate); if (!file.is_open()) { - vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", path.c_str()); + vkcv_log(LogLevel::ERROR, "The file could not be opened (%s)", + path.string().c_str()); return false; } diff --git a/src/vkcv/SwapchainManager.cpp b/src/vkcv/SwapchainManager.cpp index 03dbdc0175b393565bc4235e99f5cb02dd176db5..008d2d1d03c0d751776d34e0d741365116680180 100644 --- a/src/vkcv/SwapchainManager.cpp +++ b/src/vkcv/SwapchainManager.cpp @@ -176,8 +176,12 @@ namespace vkcv { static bool createVulkanSwapchain(const Context &context, const Window &window, SwapchainEntry &entry) { if (!context.getFeatureManager().isExtensionActive(VK_KHR_SWAPCHAIN_EXTENSION_NAME)) { - vkcv_log(LogLevel::WARNING, "Extension required to create a swapchain: '%s'", - VK_KHR_SWAPCHAIN_EXTENSION_NAME); + vkcv_log( + LogLevel::WARNING, + "Extension required to create a swapchain: '%s'", + VK_KHR_SWAPCHAIN_EXTENSION_NAME + ); + return false; } diff --git a/src/vkcv/TypeGuard.cpp b/src/vkcv/TypeGuard.cpp index 742071bb7b8d055ff1e3037a825052b0f24ae84a..91d6358e02765feff5ceb65ba2aba74e369f7d84 100644 --- a/src/vkcv/TypeGuard.cpp +++ b/src/vkcv/TypeGuard.cpp @@ -16,17 +16,21 @@ namespace vkcv { } if (m_typeHash != hash) { - vkcv_log(LogLevel::WARNING, - "Hash (%lu) does not match the specified hash of the type guard (%lu)", hash, - m_typeHash); + vkcv_log( + LogLevel::WARNING, + "Hash (%lu) does not match the specified hash of the type guard (%lu)", + hash, m_typeHash + ); return false; } if (strcmp(m_typeName, name) != 0) { - vkcv_log(LogLevel::WARNING, - "Name (%s) does not match the specified name of the type guard (%s)", name, - m_typeName); + vkcv_log( + LogLevel::WARNING, + "Name (%s) does not match the specified name of the type guard (%s)", + name, m_typeName + ); return false; } else { @@ -37,9 +41,11 @@ namespace vkcv { bool TypeGuard::checkTypeSize(size_t size) const { if (m_typeSize != size) { - vkcv_log(LogLevel::WARNING, - "Size (%lu) does not match the specified size of the type guard (%lu)", size, - m_typeSize); + vkcv_log( + LogLevel::WARNING, + "Size (%lu) does not match the specified size of the type guard (%lu)", + size, m_typeSize + ); return false; } else {