Skip to content
Snippets Groups Projects
Verified Commit 9a5486ac authored by Tobias Frisch's avatar Tobias Frisch
Browse files

Fix alignment issue of geometry buffers for ray tracing

parent 03ca4e3c
No related branches found
No related tags found
1 merge request!112Resolve "Raytracing module improvements"
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <vkcv/Logger.hpp> #include <vkcv/Logger.hpp>
#include <limits> #include <limits>
#include <numeric>
namespace vkcv { namespace vkcv {
...@@ -169,6 +170,10 @@ namespace vkcv { ...@@ -169,6 +170,10 @@ namespace vkcv {
if (m_shaderDeviceAddress) { if (m_shaderDeviceAddress) {
usageFlags |= vk::BufferUsageFlagBits::eShaderDeviceAddress; usageFlags |= vk::BufferUsageFlagBits::eShaderDeviceAddress;
} }
if (usageFlags & vk::BufferUsageFlagBits::eAccelerationStructureBuildInputReadOnlyKHR) {
alignment = (alignment > 0? std::lcm(alignment, 16) : 16);
}
const vma::Allocator &allocator = getCore().getContext().getAllocator(); const vma::Allocator &allocator = getCore().getContext().getAllocator();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment