From 761162ba3af5e1aecaf949abfb885a4e51fc3fec Mon Sep 17 00:00:00 2001
From: Vanessa Karolek <vaka1997@uni-koblenz.de>
Date: Wed, 18 Aug 2021 13:04:11 +0200
Subject: [PATCH] [#92] add manager for acceleration structures

To be implemented!
---
 modules/rtx/CMakeLists.txt                 | 11 ++++++++++-
 modules/rtx/include/vkcv/rtx/ASManager.hpp | 18 +++++++++++++++++
 modules/rtx/src/vkcv/rtx/ASManager.cpp     | 23 ++++++++++++++++++++++
 3 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 modules/rtx/include/vkcv/rtx/ASManager.hpp
 create mode 100644 modules/rtx/src/vkcv/rtx/ASManager.cpp

diff --git a/modules/rtx/CMakeLists.txt b/modules/rtx/CMakeLists.txt
index 061687c4..2a574bcf 100644
--- a/modules/rtx/CMakeLists.txt
+++ b/modules/rtx/CMakeLists.txt
@@ -11,10 +11,19 @@ set(vkcv_rtx_include ${PROJECT_SOURCE_DIR}/include)
 set(vkcv_rtx_sources
 		${vkcv_rtx_include}/vkcv/rtx/RTX.hpp
 		${vkcv_rtx_source}/vkcv/rtx/RTX.cpp
+
+		${vkcv_rtx_include}/vkcv/rtx/ASManager.hpp
+		${vkcv_rtx_source}/vkcv/rtx/ASManager.cpp
 )
 
 # adding source files to the project
 add_library(vkcv_rtx STATIC ${vkcv_rtx_sources})
 
+# link the required libraries to the module
+target_link_libraries(vkcv_rtx vkcv)
+
+# including headers of dependencies and the VkCV framework
+target_include_directories(vkcv_rtx SYSTEM BEFORE PRIVATE ${vkcv_include})
+
 # add the own include directory for public headers
-target_include_directories(vkcv_rtx BEFORE PUBLIC ${vkcv_rtx_include} ${Vulkan_INCLUDE_DIR} ${Vulkan_LIBRARIES})
\ No newline at end of file
+target_include_directories(vkcv_rtx BEFORE PUBLIC ${vkcv_rtx_include})
\ No newline at end of file
diff --git a/modules/rtx/include/vkcv/rtx/ASManager.hpp b/modules/rtx/include/vkcv/rtx/ASManager.hpp
new file mode 100644
index 00000000..db6c67a6
--- /dev/null
+++ b/modules/rtx/include/vkcv/rtx/ASManager.hpp
@@ -0,0 +1,18 @@
+#pragma once
+
+#include <vkcv/Core.hpp>
+
+namespace vkcv::rtx {
+
+    class ASManager {
+    private:
+        vkcv::BufferHandle m_buffer;
+
+    public:
+
+        /**
+         * @brief TODO
+         */
+        ASManager(vkcv::Core *core);
+    };
+}
\ No newline at end of file
diff --git a/modules/rtx/src/vkcv/rtx/ASManager.cpp b/modules/rtx/src/vkcv/rtx/ASManager.cpp
new file mode 100644
index 00000000..70d12c4b
--- /dev/null
+++ b/modules/rtx/src/vkcv/rtx/ASManager.cpp
@@ -0,0 +1,23 @@
+#include "vkcv/rtx/ASManager.hpp"
+
+namespace vkcv::rtx {
+
+    ASManager::ASManager(vkcv::Core *core) {
+        // RaytracingBuilder : build BLAS
+        // BLAS is a vector of BLASEntries which take entries of BLASInput vector
+
+        // we need to prepare build information for acceleration build command
+//        std::vector<vk::AccelerationStructureBuildGeometryInfoKHR> buildInfos(0 /* size of BLAS vector as uint32_t */);
+
+
+        // list of BLAS -> for each BLAS take AccelKHR -> createAcceleration(VkAccelerationStructureCreateInfoKHR)
+//        vk::AccelerationStructureCreateInfoKHR asCreateInfo = {
+//                {},
+//                /* hier muss ein buffer hin */
+//        };
+//        asCreateInfo.
+
+//        m_buffer = core->createBuffer<void*>(vkcv::BufferType::RT_ACCELERATION, )   // we need the size for the buffer :c
+    }
+
+}
\ No newline at end of file
-- 
GitLab