diff --git a/modules/asset_loader/src/vkcv/asset/asset_loader.cpp b/modules/asset_loader/src/vkcv/asset/asset_loader.cpp index 2f84bcd548b17af6d8162078969ae153e33c71b6..f3823cc8f3fe54b53835f356dd14a086515118dd 100644 --- a/modules/asset_loader/src/vkcv/asset/asset_loader.cpp +++ b/modules/asset_loader/src/vkcv/asset/asset_loader.cpp @@ -41,7 +41,7 @@ uint8_t convertTypeToInt(const fx::gltf::Accessor::Type type) { * @param path path to file that is responsible for error */ void print_what (const std::exception& e, const std::string &path) { - vkcv_log(vkcv::LogLevel::ERROR, "Loading file %s: %s", + vkcv_log(LogLevel::ERROR, "Loading file %s: %s", path.c_str(), e.what()); try { @@ -124,7 +124,7 @@ int loadMesh(const std::string &path, Mesh &mesh) { const size_t off = indexBufferView.byteOffset; const void *const ptr = ((char*)indexBuffer.data.data()) + off; if (!memcpy(indexBufferData.data(), ptr, indexBufferView.byteLength)) { - vkcv_log(vkcv::LogLevel::ERROR, "Copying index buffer data"); + vkcv_log(LogLevel::ERROR, "Copying index buffer data"); return 0; } } @@ -139,7 +139,7 @@ int loadMesh(const std::string &path, Mesh &mesh) { const size_t off = 0; const void *const ptr = ((char*)vertexBuffer.data.data()) + off; if (!memcpy(vertexBufferData.data(), ptr, vertexBuffer.byteLength)) { - vkcv_log(vkcv::LogLevel::ERROR, "Copying vertex buffer data"); + vkcv_log(LogLevel::ERROR, "Copying vertex buffer data"); return 0; } } @@ -153,7 +153,7 @@ int loadMesh(const std::string &path, Mesh &mesh) { case fx::gltf::Accessor::ComponentType::UnsignedInt: indexType = UINT32; break; default: - vkcv_log(vkcv::LogLevel::ERROR, "Index type (%u) not supported", + vkcv_log(LogLevel::ERROR, "Index type (%u) not supported", static_cast<uint16_t>(indexAccessor.componentType)); return 0; } diff --git a/src/vkcv/CommandResources.cpp b/src/vkcv/CommandResources.cpp index 5efb49595394da534ce751b49f39fe8219be0496..a31e6967d85bd099fe5cbbc865b0e062212ca16e 100644 --- a/src/vkcv/CommandResources.cpp +++ b/src/vkcv/CommandResources.cpp @@ -63,7 +63,7 @@ namespace vkcv { return queueManager.getPresentQueue(); } else { - vkcv_log(vkcv::LogLevel::ERROR, "Unknown queue type"); + vkcv_log(LogLevel::ERROR, "Unknown queue type"); return queueManager.getGraphicsQueues().front(); // graphics is the most general queue } } diff --git a/src/vkcv/CommandStreamManager.cpp b/src/vkcv/CommandStreamManager.cpp index 481e44c129c07b9a66f3c1e0cd2bffbebac2f55b..5a5b359b912d9cef36e0b03379d7f0f6f0951381 100644 --- a/src/vkcv/CommandStreamManager.cpp +++ b/src/vkcv/CommandStreamManager.cpp @@ -16,7 +16,7 @@ namespace vkcv { void CommandStreamManager::init(Core* core) { if (!core) { - vkcv_log(vkcv::LogLevel::ERROR, "Requires valid core pointer"); + vkcv_log(LogLevel::ERROR, "Requires valid core pointer"); } m_core = core; } @@ -59,7 +59,7 @@ namespace vkcv { const size_t id = handle.getId(); if (id >= m_commandStreams.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Requires valid handle"); + vkcv_log(LogLevel::ERROR, "Requires valid handle"); return; } @@ -73,7 +73,7 @@ namespace vkcv { const size_t id = handle.getId(); if (id >= m_commandStreams.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Requires valid handle"); + vkcv_log(LogLevel::ERROR, "Requires valid handle"); return; } @@ -88,7 +88,7 @@ namespace vkcv { const size_t id = handle.getId(); if (id >= m_commandStreams.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Requires valid handle"); + vkcv_log(LogLevel::ERROR, "Requires valid handle"); return; } CommandStream& stream = m_commandStreams[id]; @@ -113,7 +113,7 @@ namespace vkcv { vk::CommandBuffer CommandStreamManager::getStreamCommandBuffer(const CommandStreamHandle handle) { const size_t id = handle.getId(); if (id >= m_commandStreams.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Requires valid handle"); + vkcv_log(LogLevel::ERROR, "Requires valid handle"); return nullptr; } return m_commandStreams[id].cmdBuffer; diff --git a/src/vkcv/Core.cpp b/src/vkcv/Core.cpp index bff4ed84d0c98b736e13ee103eb1c030ef65ba8b..cccf51946ba41ed17b4479d151892e946ff17844 100644 --- a/src/vkcv/Core.cpp +++ b/src/vkcv/Core.cpp @@ -127,7 +127,7 @@ namespace vkcv } if (result != vk::Result::eSuccess) { - vkcv_log(vkcv::LogLevel::ERROR, "%s", vk::to_string(result).c_str()); + vkcv_log(LogLevel::ERROR, "%s", vk::to_string(result).c_str()); return Result::ERROR; } @@ -151,7 +151,7 @@ namespace vkcv } if (acquireSwapchainImage() != Result::SUCCESS) { - vkcv_log(vkcv::LogLevel::ERROR, "Acquire failed"); + vkcv_log(LogLevel::ERROR, "Acquire failed"); m_currentSwapchainImageIndex = std::numeric_limits<uint32_t>::max(); } @@ -236,7 +236,7 @@ namespace vkcv 1); if(m_Context.m_Device.createFramebuffer(&createInfo, nullptr, &framebuffer) != vk::Result::eSuccess) { - vkcv_log(vkcv::LogLevel::ERROR, "Failed to create temporary framebuffer"); + vkcv_log(LogLevel::ERROR, "Failed to create temporary framebuffer"); return; } @@ -327,7 +327,7 @@ namespace vkcv } if (result != vk::Result::eSuccess) { - vkcv_log(vkcv::LogLevel::ERROR, "Swapchain present failed (%s)", vk::to_string(result).c_str()); + vkcv_log(LogLevel::ERROR, "Swapchain present failed (%s)", vk::to_string(result).c_str()); } } diff --git a/src/vkcv/DescriptorManager.cpp b/src/vkcv/DescriptorManager.cpp index c0fb34ac3f75ecea5db6c36a65f5d97739bccb20..b805e1367d334d6a2b02a0a19a5a351a5e2da1bf 100644 --- a/src/vkcv/DescriptorManager.cpp +++ b/src/vkcv/DescriptorManager.cpp @@ -55,7 +55,7 @@ namespace vkcv vk::DescriptorSetLayoutCreateInfo layoutInfo({}, setBindings); if(m_Device.createDescriptorSetLayout(&layoutInfo, nullptr, &set.layout) != vk::Result::eSuccess) { - vkcv_log(vkcv::LogLevel::ERROR, "Failed to create descriptor set layout"); + vkcv_log(LogLevel::ERROR, "Failed to create descriptor set layout"); return DescriptorSetHandle(); }; @@ -71,7 +71,7 @@ namespace vkcv result = m_Device.allocateDescriptorSets(&allocInfo, &set.vulkanHandle); } if (result != vk::Result::eSuccess) { - vkcv_log(vkcv::LogLevel::ERROR, "Failed to create descriptor set (%s)", + vkcv_log(LogLevel::ERROR, "Failed to create descriptor set (%s)", vk::to_string(result).c_str()); m_Device.destroy(set.layout); @@ -241,7 +241,7 @@ namespace vkcv case DescriptorType::IMAGE_STORAGE: return vk::DescriptorType::eStorageImage; default: - vkcv_log(vkcv::LogLevel::ERROR, "Unknown DescriptorType"); + vkcv_log(LogLevel::ERROR, "Unknown DescriptorType"); return vk::DescriptorType::eUniformBuffer; } } @@ -268,7 +268,7 @@ namespace vkcv void DescriptorManager::destroyDescriptorSetById(uint64_t id) { if (id >= m_DescriptorSets.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid id"); + vkcv_log(LogLevel::ERROR, "Invalid id"); return; } @@ -284,7 +284,7 @@ namespace vkcv vk::DescriptorPool pool; if (m_Device.createDescriptorPool(&m_PoolInfo, nullptr, &pool) != vk::Result::eSuccess) { - vkcv_log(vkcv::LogLevel::WARNING, "Failed to allocate descriptor pool"); + vkcv_log(LogLevel::WARNING, "Failed to allocate descriptor pool"); pool = nullptr; }; m_Pools.push_back(pool); diff --git a/src/vkcv/ImageManager.cpp b/src/vkcv/ImageManager.cpp index 9c11da144412415bd7664161b2519d9f0e10af72..1e3d19d02d7e86546d142bb64440364407e81824 100644 --- a/src/vkcv/ImageManager.cpp +++ b/src/vkcv/ImageManager.cpp @@ -207,7 +207,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return nullptr; } @@ -220,7 +220,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return nullptr; } @@ -233,7 +233,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return nullptr; } @@ -246,7 +246,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return; } @@ -281,7 +281,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return; } @@ -296,7 +296,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return; } @@ -370,7 +370,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return 0; } @@ -383,7 +383,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return 0; } @@ -396,7 +396,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return 0; } @@ -408,7 +408,7 @@ namespace vkcv { void ImageManager::destroyImageById(uint64_t id) { if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return; } @@ -437,7 +437,7 @@ namespace vkcv { const uint64_t id = handle.getId(); if (id >= m_images.size()) { - vkcv_log(vkcv::LogLevel::ERROR, "Invalid handle"); + vkcv_log(LogLevel::ERROR, "Invalid handle"); return vk::Format::eUndefined; } diff --git a/src/vkcv/PipelineManager.cpp b/src/vkcv/PipelineManager.cpp index 15f77f13f81bea54a346a46d02e65f2dc7eed42e..6572145d34492204b2df1e55028d22c330802ca1 100644 --- a/src/vkcv/PipelineManager.cpp +++ b/src/vkcv/PipelineManager.cpp @@ -38,7 +38,7 @@ namespace vkcv case VertexFormat::INT4: return vk::Format::eR32G32B32A32Sint; default: - vkcv_log(vkcv::LogLevel::WARNING, "Unknown vertex format"); + vkcv_log(LogLevel::WARNING, "Unknown vertex format"); return vk::Format::eUndefined; } } @@ -51,7 +51,7 @@ namespace vkcv const bool existsFragmentShader = config.m_ShaderProgram.existsShader(ShaderStage::FRAGMENT); if (!(existsVertexShader && existsFragmentShader)) { - vkcv_log(vkcv::LogLevel::ERROR, "Requires vertex and fragment shader code"); + vkcv_log(LogLevel::ERROR, "Requires vertex and fragment shader code"); return PipelineHandle(); } diff --git a/src/vkcv/QueueManager.cpp b/src/vkcv/QueueManager.cpp index 308c2c066204afbdc09c2bffac96b914eaf47c71..df6c74cccf6c4652adc6a4c78802f282ea6ae293 100644 --- a/src/vkcv/QueueManager.cpp +++ b/src/vkcv/QueueManager.cpp @@ -96,7 +96,7 @@ namespace vkcv { } } - vkcv_log(vkcv::LogLevel::WARNING, "Not enough %s queues", vk::to_string(qFlag).c_str()); + vkcv_log(LogLevel::WARNING, "Not enough %s queues", vk::to_string(qFlag).c_str()); } break; case vk::QueueFlagBits::eCompute: @@ -118,7 +118,7 @@ namespace vkcv { } } - vkcv_log(vkcv::LogLevel::WARNING, "Not enough %s queues", vk::to_string(qFlag).c_str()); + vkcv_log(LogLevel::WARNING, "Not enough %s queues", vk::to_string(qFlag).c_str()); } break; case vk::QueueFlagBits::eTransfer: @@ -140,7 +140,7 @@ namespace vkcv { } } - vkcv_log(vkcv::LogLevel::WARNING, "Not enough %s queues", vk::to_string(qFlag).c_str()); + vkcv_log(LogLevel::WARNING, "Not enough %s queues", vk::to_string(qFlag).c_str()); } break; default: diff --git a/src/vkcv/ShaderProgram.cpp b/src/vkcv/ShaderProgram.cpp index ef70b818aa10a6648ea3ddfa6571defa40e4d7cb..7c54c301d1301127273303128b0c10a9c2c53942 100644 --- a/src/vkcv/ShaderProgram.cpp +++ b/src/vkcv/ShaderProgram.cpp @@ -18,7 +18,7 @@ namespace vkcv { { std::ifstream file(shaderPath.string(), std::ios::ate | std::ios::binary); if (!file.is_open()) { - vkcv_log(vkcv::LogLevel::ERROR, "The file could not be opened"); + vkcv_log(LogLevel::ERROR, "The file could not be opened"); return std::vector<char>{}; } size_t fileSize = (size_t)file.tellg(); @@ -62,7 +62,7 @@ namespace vkcv { break; } - vkcv_log(vkcv::LogLevel::WARNING, "Unknown vertex format"); + vkcv_log(LogLevel::WARNING, "Unknown vertex format"); return VertexFormat::FLOAT; } @@ -75,7 +75,7 @@ namespace vkcv { bool ShaderProgram::addShader(ShaderStage shaderStage, const std::filesystem::path &shaderPath) { if(m_Shaders.find(shaderStage) != m_Shaders.end()) { - vkcv_log(vkcv::LogLevel::WARNING, "Overwriting existing shader stage"); + vkcv_log(LogLevel::WARNING, "Overwriting existing shader stage"); } const std::vector<char> shaderCode = readShaderCode(shaderPath); diff --git a/src/vkcv/VertexLayout.cpp b/src/vkcv/VertexLayout.cpp index 354eac51c1b67fb899565b330f12cbdb6bb62f34..3c39ad0d39c4b458526ceed54422d320ee6d0e0d 100644 --- a/src/vkcv/VertexLayout.cpp +++ b/src/vkcv/VertexLayout.cpp @@ -25,7 +25,7 @@ namespace vkcv { case VertexFormat::INT4: return 16; default: - vkcv_log(vkcv::LogLevel::WARNING, "No format given"); + vkcv_log(LogLevel::WARNING, "No format given"); return 0; } }