diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2165184fa..706db54ce 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -95,19 +95,19 @@ jobs: uses: lukka/run-cmake@v10 with: cmakeListsTxtPath: '${{ github.workspace }}/src/CMakeLists.txt' - configurePreset: '${{ matrix.profile }}-publish' - buildPreset: '${{ matrix.profile }}-publish' + configurePreset: '${{ matrix.profile }}-release' + buildPreset: '${{ matrix.profile }}-release' - name: Upload build artifacts (Release) uses: actions/upload-artifact@v3 if: failure() with: name: LiteFX-${{ matrix.triplet }}-build-rel - path: '${{ github.workspace }}/out/build/${{ matrix.profile }}-publish' + path: '${{ github.workspace }}/out/build/${{ matrix.profile }}-release' - name: Install with CMake (Release) run: | - Set-Location '${{ github.workspace }}/out/build/${{ matrix.profile }}-publish' + Set-Location '${{ github.workspace }}/out/build/${{ matrix.profile }}-release' cmake --install . - name: Sign binaries @@ -122,7 +122,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: LiteFX-${{ matrix.triplet }}-install - path: '${{ github.workspace }}/out/install/${{ matrix.profile }}-publish' + path: '${{ github.workspace }}/out/install/${{ matrix.profile }}-release' if-no-files-found: error publish: diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 29e328e11..8b055529a 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -22,12 +22,16 @@ jobs: strategy: fail-fast: false matrix: - os: [ windows-latest ] + profile: [ windows-x64, windows-x86 ] include: - - os: windows-latest + - profile: windows-x64 triplet: x64-windows - configuration: windows-x64-publish + configuration: windows-x64-release architecture: x64 + - profile: windows-x86 + triplet: x86-windows + configuration: windows-x86-release + architecture: x86 steps: - name: Checking out sources diff --git a/src/Backends/DirectX12/src/blas.cpp b/src/Backends/DirectX12/src/blas.cpp index a10c3a98e..e67214e43 100644 --- a/src/Backends/DirectX12/src/blas.cpp +++ b/src/Backends/DirectX12/src/blas.cpp @@ -180,7 +180,7 @@ void DirectX12BottomLevelAccelerationStructure::build(const DirectX12CommandBuff else if (maxSize < requiredMemory) [[unlikely]] throw ArgumentOutOfRangeException("maxSize", 0ull, maxSize, requiredMemory, "The maximum available size is not sufficient to contain the acceleration structure."); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // Perform the build. commandBuffer.buildAccelerationStructure(*this, scratchBuffer, *buffer, offset); @@ -222,7 +222,7 @@ void DirectX12BottomLevelAccelerationStructure::update(const DirectX12CommandBuf else if (maxSize < requiredMemory) [[unlikely]] throw ArgumentOutOfRangeException("maxSize", 0ull, maxSize, requiredMemory, "The maximum available size is not sufficient to contain the acceleration structure."); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // Perform the update. commandBuffer.updateAccelerationStructure(*this, scratchBuffer, *buffer, offset); @@ -257,7 +257,7 @@ void DirectX12BottomLevelAccelerationStructure::copy(const DirectX12CommandBuffe if (buffer == nullptr) buffer = destination.m_impl->m_buffer->size() >= requiredMemory ? destination.m_impl->m_buffer : device.factory().createBuffer(BufferType::AccelerationStructure, ResourceHeap::Resource, requiredMemory, 1, ResourceUsage::AllowWrite); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // Store the buffer and the offset. destination.m_impl->m_offset = offset; diff --git a/src/Backends/DirectX12/src/queue.cpp b/src/Backends/DirectX12/src/queue.cpp index 0dc4c16bb..02283e823 100644 --- a/src/Backends/DirectX12/src/queue.cpp +++ b/src/Backends/DirectX12/src/queue.cpp @@ -1,5 +1,8 @@ #include + +#if defined(LITEFX_BUILD_SUPPORT_DEBUG_MARKERS) && defined(LITEFX_BUILD_WITH_PIX_RUNTIME) #include +#endif defined(LITEFX_BUILD_SUPPORT_DEBUG_MARKERS) && defined(LITEFX_BUILD_WITH_PIX_RUNTIME) using namespace LiteFX::Rendering::Backends; diff --git a/src/Backends/DirectX12/src/render_pass.cpp b/src/Backends/DirectX12/src/render_pass.cpp index e799ffa1c..7022508fb 100644 --- a/src/Backends/DirectX12/src/render_pass.cpp +++ b/src/Backends/DirectX12/src/render_pass.cpp @@ -1,6 +1,9 @@ #include #include + +#if defined(LITEFX_BUILD_SUPPORT_DEBUG_MARKERS) && defined(LITEFX_BUILD_WITH_PIX_RUNTIME) #include +#endif // defined(LITEFX_BUILD_SUPPORT_DEBUG_MARKERS) && defined(LITEFX_BUILD_WITH_PIX_RUNTIME) using namespace LiteFX::Rendering::Backends; diff --git a/src/Backends/DirectX12/src/shader_program.cpp b/src/Backends/DirectX12/src/shader_program.cpp index a5d9ab2e5..7c94d19b2 100644 --- a/src/Backends/DirectX12/src/shader_program.cpp +++ b/src/Backends/DirectX12/src/shader_program.cpp @@ -486,13 +486,13 @@ class DirectX12ShaderProgram::DirectX12ShaderProgramImpl : public Implement(m_device, std::move(descriptors), descriptorSet.space, descriptorSet.stage); } - }() | std::views::as_rvalue; + }() | std::views::as_rvalue | std::ranges::to>>(); // Create the push constants layout. auto pushConstants = [&pushConstantRanges]() -> std::generator> { for (auto range = pushConstantRanges.begin(); range != pushConstantRanges.end(); ++range) co_yield makeUnique(range->stage, range->offset, range->size, range->space, range->location); - }() | std::views::as_rvalue; + }() | std::views::as_rvalue | std::ranges::to>>(); auto overallSize = std::accumulate(pushConstantRanges.begin(), pushConstantRanges.end(), 0, [](UInt32 currentSize, const auto& range) { return currentSize + range.size; }); auto pushConstantsLayout = makeUnique(std::move(pushConstants), overallSize); diff --git a/src/Backends/DirectX12/src/tlas.cpp b/src/Backends/DirectX12/src/tlas.cpp index 2b272508c..943564263 100644 --- a/src/Backends/DirectX12/src/tlas.cpp +++ b/src/Backends/DirectX12/src/tlas.cpp @@ -144,7 +144,7 @@ void DirectX12TopLevelAccelerationStructure::build(const DirectX12CommandBuffer& else if (maxSize < requiredMemory) [[unlikely]] throw ArgumentOutOfRangeException("maxSize", 0ull, maxSize, requiredMemory, "The maximum available size is not sufficient to contain the acceleration structure."); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // Perform the build. commandBuffer.buildAccelerationStructure(*this, scratchBuffer, *buffer, offset); @@ -186,7 +186,7 @@ void DirectX12TopLevelAccelerationStructure::update(const DirectX12CommandBuffer else if (maxSize < requiredMemory) [[unlikely]] throw ArgumentOutOfRangeException("maxSize", 0ull, maxSize, requiredMemory, "The maximum available size is not sufficient to contain the acceleration structure."); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // Perform the update. commandBuffer.updateAccelerationStructure(*this, scratchBuffer, *buffer, offset); @@ -221,7 +221,7 @@ void DirectX12TopLevelAccelerationStructure::copy(const DirectX12CommandBuffer& if (buffer == nullptr) buffer = destination.m_impl->m_buffer->size() >= requiredMemory ? destination.m_impl->m_buffer : device.factory().createBuffer(BufferType::AccelerationStructure, ResourceHeap::Resource, requiredMemory, 1, ResourceUsage::AllowWrite); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // Store the buffer and the offset. destination.m_impl->m_offset = offset; diff --git a/src/Backends/Vulkan/src/blas.cpp b/src/Backends/Vulkan/src/blas.cpp index 8a10f25dc..0fcfcc849 100644 --- a/src/Backends/Vulkan/src/blas.cpp +++ b/src/Backends/Vulkan/src/blas.cpp @@ -163,7 +163,7 @@ void VulkanBottomLevelAccelerationStructure::build(const VulkanCommandBuffer& co else if (maxSize < requiredMemory) [[unlikely]] throw ArgumentOutOfRangeException("maxSize", 0ull, maxSize, requiredMemory, "The maximum available size is not sufficient to contain the acceleration structure."); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // If the acceleration structure allows for compaction, create a query pool in order to query the compacted size later. if (LITEFX_FLAG_IS_SET(m_impl->m_flags, AccelerationStructureFlags::AllowCompaction)) @@ -229,7 +229,7 @@ void VulkanBottomLevelAccelerationStructure::update(const VulkanCommandBuffer& c else if (maxSize < requiredMemory) [[unlikely]] throw ArgumentOutOfRangeException("maxSize", 0ull, maxSize, requiredMemory, "The maximum available size is not sufficient to contain the acceleration structure."); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // If the acceleration structure allows for compaction, reset the query pool. if (LITEFX_FLAG_IS_SET(m_impl->m_flags, AccelerationStructureFlags::AllowCompaction)) @@ -280,7 +280,7 @@ void VulkanBottomLevelAccelerationStructure::copy(const VulkanCommandBuffer& com if (buffer == nullptr) buffer = destination.m_impl->m_buffer->size() >= requiredMemory[0] ? destination.m_impl->m_buffer : device.factory().createBuffer(BufferType::AccelerationStructure, ResourceHeap::Resource, requiredMemory[0], 1, ResourceUsage::AllowWrite); else if (buffer->size() < offset + requiredMemory[0]) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory[0], "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory[0], "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // Create or reset query pool on destination, if required. if (LITEFX_FLAG_IS_SET(destination.flags(), AccelerationStructureFlags::AllowCompaction)) diff --git a/src/Backends/Vulkan/src/queue.cpp b/src/Backends/Vulkan/src/queue.cpp index 438c1d83f..c05407670 100644 --- a/src/Backends/Vulkan/src/queue.cpp +++ b/src/Backends/Vulkan/src/queue.cpp @@ -41,7 +41,7 @@ class VulkanQueue::VulkanQueueImpl : public Implement { { m_submittedCommandBuffers.clear(); - if (m_timelineSemaphore != nullptr) + if (m_timelineSemaphore != VK_NULL_HANDLE) ::vkDestroySemaphore(m_device.handle(), m_timelineSemaphore, nullptr); m_timelineSemaphore = {}; diff --git a/src/Backends/Vulkan/src/shader_program.cpp b/src/Backends/Vulkan/src/shader_program.cpp index dfdb9ccad..9601a4f18 100644 --- a/src/Backends/Vulkan/src/shader_program.cpp +++ b/src/Backends/Vulkan/src/shader_program.cpp @@ -342,13 +342,13 @@ class VulkanShaderProgram::VulkanShaderProgramImpl : public Implement(m_device, std::move(descriptorLayouts), descriptorSet.space, descriptorSet.stage); } - }() | std::views::as_rvalue; + }() | std::views::as_rvalue | std::ranges::to>>(); // Create the push constants layout. auto pushConstants = [&pushConstantRanges]() -> std::generator> { for (auto it = pushConstantRanges.begin(); it != pushConstantRanges.end(); ++it) co_yield makeUnique(it->stage, it->offset, it->size, 0, 0); // No space or binding for Vulkan push constants. - }() | std::views::as_rvalue; + }() | std::views::as_rvalue | std::ranges::to>>(); auto overallSize = std::accumulate(pushConstantRanges.begin(), pushConstantRanges.end(), 0, [](UInt32 currentSize, const auto& range) { return currentSize + range.size; }); auto pushConstantsLayout = makeUnique(std::move(pushConstants), overallSize); diff --git a/src/Backends/Vulkan/src/tlas.cpp b/src/Backends/Vulkan/src/tlas.cpp index 820dfca00..cf7039682 100644 --- a/src/Backends/Vulkan/src/tlas.cpp +++ b/src/Backends/Vulkan/src/tlas.cpp @@ -113,7 +113,7 @@ void VulkanTopLevelAccelerationStructure::build(const VulkanCommandBuffer& comma else if (maxSize < requiredMemory) [[unlikely]] throw ArgumentOutOfRangeException("maxSize", 0ull, maxSize, requiredMemory, "The maximum available size is not sufficient to contain the acceleration structure."); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // If the acceleration structure allows for compaction, create a query pool in order to query the compacted size later. if (LITEFX_FLAG_IS_SET(m_impl->m_flags, AccelerationStructureFlags::AllowCompaction)) @@ -174,7 +174,7 @@ void VulkanTopLevelAccelerationStructure::update(const VulkanCommandBuffer& comm else if (maxSize < requiredMemory) [[unlikely]] throw ArgumentOutOfRangeException("maxSize", 0ull, maxSize, requiredMemory, "The maximum available size is not sufficient to contain the acceleration structure."); else if (buffer->size() < offset + requiredMemory) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory, "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // If the acceleration structure allows for compaction, reset the query pool. if (LITEFX_FLAG_IS_SET(m_impl->m_flags, AccelerationStructureFlags::AllowCompaction)) @@ -220,7 +220,7 @@ void VulkanTopLevelAccelerationStructure::copy(const VulkanCommandBuffer& comman if (buffer == nullptr) buffer = destination.m_impl->m_buffer->size() >= requiredMemory[0] ? destination.m_impl->m_buffer : device.factory().createBuffer(BufferType::AccelerationStructure, ResourceHeap::Resource, requiredMemory[0], 1, ResourceUsage::AllowWrite); else if (buffer->size() < offset + requiredMemory[0]) [[unlikely]] - throw ArgumentOutOfRangeException("buffer", 0ull, buffer->size(), offset + requiredMemory[0], "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); + throw ArgumentOutOfRangeException("buffer", 0ull, (UInt64)buffer->size(), offset + requiredMemory[0], "The buffer does not contain enough memory after offset {0} to fully contain the acceleration structure.", offset); // Create or reset query pool on destination, if required. if (LITEFX_FLAG_IS_SET(destination.flags(), AccelerationStructureFlags::AllowCompaction)) diff --git a/src/CMakePresets.json b/src/CMakePresets.json index 380fe79e2..982e220a4 100644 --- a/src/CMakePresets.json +++ b/src/CMakePresets.json @@ -99,11 +99,11 @@ ], "buildPresets": [ { - "name": "windows-x86-publish", + "name": "windows-x86-release", "configurePreset": "windows-x86-release" }, { - "name": "windows-x64-publish", + "name": "windows-x64-release", "configurePreset": "windows-x64-release" } ], diff --git a/src/Core/include/litefx/exceptions.hpp b/src/Core/include/litefx/exceptions.hpp index d7f719a89..66e9ee681 100644 --- a/src/Core/include/litefx/exceptions.hpp +++ b/src/Core/include/litefx/exceptions.hpp @@ -132,13 +132,13 @@ namespace LiteFX { /// /// The type of the argument that was out of range. /// The name of the argument that was out of range. - /// The lower bound of the valid range. + /// The lower bound of the valid range. /// The upper bound of the valid range. /// The actual value of provided to the argument. /// The error message. template - explicit ArgumentOutOfRangeException(std::string_view argument, T fromIncluse, T toExclusive, T value, std::string_view message) noexcept : - Exception(std::format("Argument was out of range: {} (valid range is [{}, {}) but actual value was {}). {}", argument, fromIncluse, toExclusive, value, message), std::source_location::current(), std::stacktrace::current()), m_argument(argument) { } + explicit ArgumentOutOfRangeException(std::string_view argument, T fromInclusive, T toExclusive, T value, std::string_view message) noexcept : + Exception(std::format("Argument was out of range: {} (valid range is [{}, {}) but actual value was {}). {}", argument, fromInclusive, toExclusive, value, message), std::source_location::current(), std::stacktrace::current()), m_argument(argument) { } /// /// Initializes a new exception. @@ -155,14 +155,14 @@ namespace LiteFX { /// /// The type of the argument that was out of range. /// The name of the argument that was out of range. - /// The lower bound of the valid range. + /// The lower bound of the valid range. /// The upper bound of the valid range. /// The actual value of provided to the argument. /// The format string for the error message. /// The arguments passed to the error message format string. template - explicit ArgumentOutOfRangeException(std::string_view argument, T fromIncluse, T toExclusive, T value, std::string_view format, TArgs&&... args) noexcept : - Exception(std::format("Argument was out of range: {} (valid range is [{}, {}) but actual value was {}). {}", argument, fromIncluse, toExclusive, value, std::vformat(format, std::make_format_args(args...))), std::source_location::current(), std::stacktrace::current()), m_argument(argument) { } + explicit ArgumentOutOfRangeException(std::string_view argument, T fromInclusive, T toExclusive, T value, std::string_view format, TArgs&&... args) noexcept : + Exception(std::format("Argument was out of range: {} (valid range is [{}, {}) but actual value was {}). {}", argument, fromInclusive, toExclusive, value, std::vformat(format, std::make_format_args(args...))), std::source_location::current(), std::stacktrace::current()), m_argument(argument) { } ArgumentOutOfRangeException(const ArgumentOutOfRangeException&) = default; ArgumentOutOfRangeException(ArgumentOutOfRangeException&&) = default;