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
165dcc32
Commit
165dcc32
authored
3 years ago
by
Alexander Gauggel
Browse files
Options
Downloads
Patches
Plain Diff
[
#96
] Add doxygen comments to PushConstants
parent
929cfc95
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!97
Resolve "Dokumentation vervollständigen"
Pipeline
#27510
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/vkcv/PushConstants.hpp
+44
-0
44 additions, 0 deletions
include/vkcv/PushConstants.hpp
with
44 additions
and
0 deletions
include/vkcv/PushConstants.hpp
+
44
−
0
View file @
165dcc32
...
...
@@ -28,25 +28,44 @@ namespace vkcv {
PushConstants
&
operator
=
(
const
PushConstants
&
other
)
=
default
;
PushConstants
&
operator
=
(
PushConstants
&&
other
)
=
default
;
/**
* @return The size of the data that is bound per drawcall in bytes
*/
[[
nodiscard
]]
size_t
getSizePerDrawcall
()
const
{
return
m_sizePerDrawcall
;
}
/**
* @return The size of the total data stored for push constants in bytes
*/
[[
nodiscard
]]
size_t
getFullSize
()
const
{
return
m_data
.
size
();
}
/**
* @return The number of drawcalls that data is stored for
*/
[[
nodiscard
]]
size_t
getDrawcallCount
()
const
{
return
(
m_data
.
size
()
/
m_sizePerDrawcall
);
}
/**
* @brief Clear the drawcall data
*/
void
clear
()
{
m_data
.
clear
();
}
/**
* @brief Append data for a single drawcall
*
* @tparam T Type of data to append, must match the size of the #PushConstants per drawcall size
* @param value Data to append
* @return If operation was successfull
*/
template
<
typename
T
=
uint8_t
>
bool
appendDrawcall
(
const
T
&
value
)
{
if
(
sizeof
(
T
)
!=
m_sizePerDrawcall
)
{
...
...
@@ -61,24 +80,49 @@ namespace vkcv {
return
true
;
}
/**
* @brief Get the data for a single drawcall as reference
*
* @tparam T Type of data to return
* @param index Index of the drawcall data to return
* @return Drawcall data
*/
template
<
typename
T
=
uint8_t
>
T
&
getDrawcall
(
size_t
index
)
{
const
size_t
offset
=
(
index
*
m_sizePerDrawcall
);
return
*
reinterpret_cast
<
T
*>
(
m_data
.
data
()
+
offset
);
}
/**
* @brief Get the data for a single drawcall as const reference
*
* @tparam T Type of data to return
* @param index Index of the drawcall data to return
* @return Drawcall data
*/
template
<
typename
T
=
uint8_t
>
const
T
&
getDrawcall
(
size_t
index
)
const
{
const
size_t
offset
=
(
index
*
m_sizePerDrawcall
);
return
*
reinterpret_cast
<
const
T
*>
(
m_data
.
data
()
+
offset
);
}
/**
* @brief Get the data for a single drawcall as a void pointer
*
* @param index Index of the drawcall data to return
* @return Drawcall data
*/
[[
nodiscard
]]
const
void
*
getDrawcallData
(
size_t
index
)
const
{
const
size_t
offset
=
(
index
*
m_sizePerDrawcall
);
return
reinterpret_cast
<
const
void
*>
(
m_data
.
data
()
+
offset
);
}
/**
* @return Raw pointer to the entire drawcall data array,
* might be nullptr if data is empty,
* pointer might be invalidated by clearing or adding data
*/
[[
nodiscard
]]
const
void
*
getData
()
const
{
if
(
m_data
.
empty
())
{
...
...
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