Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
93033951
Commit
93033951
authored
3 years ago
by
Vanessa Karolek
Browse files
Options
Downloads
Patches
Plain Diff
[
#92
][doc] add & edit documentation
parent
6474b395
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!75
Resolve "RTX-Module"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/rtx/include/vkcv/rtx/ASManager.hpp
+27
-7
27 additions, 7 deletions
modules/rtx/include/vkcv/rtx/ASManager.hpp
with
27 additions
and
7 deletions
modules/rtx/include/vkcv/rtx/ASManager.hpp
+
27
−
7
View file @
93033951
...
@@ -4,12 +4,18 @@
...
@@ -4,12 +4,18 @@
namespace
vkcv
::
rtx
{
namespace
vkcv
::
rtx
{
/**
* @brief Used for @#RTXBuffer creation depending on the @#RTXBufferType.
*/
enum
class
RTXBufferType
{
enum
class
RTXBufferType
{
CPU
,
CPU
,
GPU
,
GPU
,
ACCELERATION
ACCELERATION
};
};
/**
* @brief Used as a container to handle buffer creation and destruction in RTX-specific use cases.
*/
struct
RTXBuffer
{
struct
RTXBuffer
{
RTXBufferType
bufferType
;
RTXBufferType
bufferType
;
void
*
data
;
void
*
data
;
...
@@ -20,6 +26,9 @@ namespace vkcv::rtx {
...
@@ -20,6 +26,9 @@ namespace vkcv::rtx {
vk
::
Buffer
vulkanHandle
;
vk
::
Buffer
vulkanHandle
;
};
};
/**
* @brief Used as a container to handle bottom-level acceleration structure (BLAS) construction and destruction.
*/
struct
BottomLevelAccelerationStructure
{
struct
BottomLevelAccelerationStructure
{
RTXBuffer
vertexBuffer
;
RTXBuffer
vertexBuffer
;
RTXBuffer
indexBuffer
;
RTXBuffer
indexBuffer
;
...
@@ -27,6 +36,9 @@ namespace vkcv::rtx {
...
@@ -27,6 +36,9 @@ namespace vkcv::rtx {
vk
::
AccelerationStructureKHR
vulkanHandle
;
vk
::
AccelerationStructureKHR
vulkanHandle
;
};
};
/**
* @brief Used as a container to handle top-level acceleration structure (TLAS) construction and destruction.
*/
struct
TopLevelAccelerationStructure
{
struct
TopLevelAccelerationStructure
{
RTXBuffer
gpuBufferInstances
;
RTXBuffer
gpuBufferInstances
;
RTXBuffer
tlasBuffer
;
RTXBuffer
tlasBuffer
;
...
@@ -34,6 +46,9 @@ namespace vkcv::rtx {
...
@@ -34,6 +46,9 @@ namespace vkcv::rtx {
vk
::
AccelerationStructureKHR
vulkanHandle
;
vk
::
AccelerationStructureKHR
vulkanHandle
;
};
};
/**
* @brief A class for managing acceleration structures (bottom, top).
*/
class
ASManager
{
class
ASManager
{
private:
private:
Core
*
m_core
;
Core
*
m_core
;
...
@@ -45,7 +60,7 @@ namespace vkcv::rtx {
...
@@ -45,7 +60,7 @@ namespace vkcv::rtx {
/**
/**
* @brief Returns a #RTXBuffer object holding data of type uint16_t from given @p data of type uint8_t.
* @brief Returns a #RTXBuffer object holding data of type uint16_t from given @p data of type uint8_t.
* @param data The input data of type uint8_t.
* @param data The input data of type uint8_t.
* @return A #RTXBuffer object holding @p data.
* @return A
@
#RTXBuffer object holding @p data.
*/
*/
RTXBuffer
makeBufferFromData
(
std
::
vector
<
uint8_t
>
&
data
);
RTXBuffer
makeBufferFromData
(
std
::
vector
<
uint8_t
>
&
data
);
...
@@ -59,7 +74,7 @@ namespace vkcv::rtx {
...
@@ -59,7 +74,7 @@ namespace vkcv::rtx {
/**
/**
* @brief Copies @p cpuBuffer data into a @p gpuBuffer. Typical use case is a staging buffer (namely,
* @brief Copies @p cpuBuffer data into a @p gpuBuffer. Typical use case is a staging buffer (namely,
* @p cpuBuffer) used to fill a @p gpuBuffer with vk::MemoryPropertyFlagBits::eDeviceLocal flag set.
* @p cpuBuffer) used to fill a @p gpuBuffer with
@p
vk::MemoryPropertyFlagBits::eDeviceLocal flag set.
* @p cpuBuffer is destroyed and freed after copying.
* @p cpuBuffer is destroyed and freed after copying.
* @param cpuBuffer
* @param cpuBuffer
* @param gpuBuffer
* @param gpuBuffer
...
@@ -69,13 +84,13 @@ namespace vkcv::rtx {
...
@@ -69,13 +84,13 @@ namespace vkcv::rtx {
public:
public:
/**
/**
* @brief Constructor of #ASManager .
* @brief Constructor of
@
#ASManager .
* @param core
* @param core
*/
*/
ASManager
(
vkcv
::
Core
*
core
);
ASManager
(
vkcv
::
Core
*
core
);
/**
/**
* @brief Default destructor of #ASManager.
* @brief Default destructor of
@
#ASManager.
*/
*/
~
ASManager
();
~
ASManager
();
...
@@ -88,16 +103,21 @@ namespace vkcv::rtx {
...
@@ -88,16 +103,21 @@ namespace vkcv::rtx {
/**
/**
* @brief Build a Top Level Acceleration Structure (TLAS) object from the created
* @brief Build a Top Level Acceleration Structure (TLAS) object from the created
* #ASManager::m_accelerationStructures objects.
*
@
#ASManager::m_accelerationStructures objects.
*/
*/
void
buildTLAS
();
void
buildTLAS
();
/**
/**
* @brief Returns the top
level acceleration structure buffer
* @brief Returns the top
-
level acceleration structure buffer
.
* @return A #TopLevelAccelerationStructure object holding the tlas.
* @return A
@
#TopLevelAccelerationStructure object holding the tlas.
*/
*/
TopLevelAccelerationStructure
getTLAS
();
TopLevelAccelerationStructure
getTLAS
();
/**
* @brief Returns the bottom-level acceleration structure at @p id.
* @param id The ID used for indexing.
* @return The specified @#BottomLevelAccelerationStructure object.
*/
BottomLevelAccelerationStructure
getBLAS
(
uint32_t
id
);
BottomLevelAccelerationStructure
getBLAS
(
uint32_t
id
);
};
};
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment