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
Merge requests
!97
Resolve "Dokumentation vervollständigen"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Dokumentation vervollständigen"
96-dokumentation-vervollstandigen
into
develop
Overview
0
Commits
73
Pipelines
36
Changes
1
Merged
Tobias Frisch
requested to merge
96-dokumentation-vervollstandigen
into
develop
3 years ago
Overview
0
Commits
73
Pipelines
36
Changes
1
Expand
Closes
#96 (closed)
Edited
2 years ago
by
Tobias Frisch
0
0
Merge request reports
Viewing commit
d15f3c38
Prev
Next
Show latest version
1 file
+
39
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
d15f3c38
[
#96
] Document Buffer.hpp
· d15f3c38
Alexander Gauggel
authored
3 years ago
include/vkcv/Buffer.hpp
+
39
−
1
Options
@@ -18,44 +18,82 @@ namespace vkcv {
// explicit destruction of default constructor
Buffer
<
T
>
()
=
delete
;
/**
* @return The #BufferHandle to be used with the #Core
*/
[[
nodiscard
]]
const
BufferHandle
&
getHandle
()
const
{
return
m_handle
;
}
/**
* @return The #BufferType of the #Buffer
*/
[[
nodiscard
]]
BufferType
getType
()
const
{
return
m_type
;
};
/**
* @return The number of objects of type T the #Buffer holds
*/
[[
nodiscard
]]
size_t
getCount
()
const
{
return
m_count
;
}
/**
* @return The size of the #Buffer in bytes
*/
[[
nodiscard
]]
size_t
getSize
()
const
{
return
m_count
*
sizeof
(
T
);
}
/**
* @return The vulkan handle of the #Buffer to be used for manual vulkan commands
*/
[[
nodiscard
]]
const
vk
::
Buffer
getVulkanHandle
()
const
{
return
m_manager
->
getBuffer
(
m_handle
);
}
/**
* Fill the #Buffer with data of type T
*
* @param data Pointer to the array of object type T
* @param count The number of objects to copy from the data array
* @param offset The offset into the #Buffer where the data is copied into
*/
void
fill
(
const
T
*
data
,
size_t
count
=
0
,
size_t
offset
=
0
)
{
m_manager
->
fillBuffer
(
m_handle
,
data
,
count
*
sizeof
(
T
),
offset
*
sizeof
(
T
));
}
/**
* Fill the #Buffer with data from a vector of type T
*
* @param vector Vector of type T to be copied into the #Buffer
* @param offset The offset into the #Buffer where the data is copied into
*/
void
fill
(
const
std
::
vector
<
T
>&
vector
,
size_t
offset
=
0
)
{
fill
(
static_cast
<
const
T
*>
(
vector
.
data
()),
static_cast
<
size_t
>
(
vector
.
size
()),
offset
);
}
/**
* Maps memory to the #Buffer and returns it
*
* @param offset Offset of mapping in objects of type T
* @param count Count of objects of type T that are mapped
* @return Pointer to mapped memory as type T
*/
[[
nodiscard
]]
T
*
map
(
size_t
offset
=
0
,
size_t
count
=
0
)
{
return
reinterpret_cast
<
T
*>
(
m_manager
->
mapBuffer
(
m_handle
,
offset
*
sizeof
(
T
),
count
*
sizeof
(
T
)));
}
/**
* Unmap the #Buffer, invalidates the pointer obtained by map()
*/
void
unmap
()
{
m_manager
->
unmapBuffer
(
m_handle
);
}
Loading