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
d200f29b
Commit
d200f29b
authored
3 years ago
by
Sebastian Gaida
Browse files
Options
Downloads
Patches
Plain Diff
[
#96
] commented tipsify
parent
f6ed4e09
No related branches found
No related tags found
1 merge request
!97
Resolve "Dokumentation vervollständigen"
Pipeline
#27464
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/meshlet/src/vkcv/meshlet/Tipsify.cpp
+36
-36
36 additions, 36 deletions
modules/meshlet/src/vkcv/meshlet/Tipsify.cpp
with
36 additions
and
36 deletions
modules/meshlet/src/vkcv/meshlet/Tipsify.cpp
+
36
−
36
View file @
d200f29b
...
@@ -18,18 +18,18 @@ namespace vkcv::meshlet {
...
@@ -18,18 +18,18 @@ namespace vkcv::meshlet {
/**
/**
* searches for the next VertexIndex that was used before or returns any vertexIndex if no used was found
* searches for the next VertexIndex that was used before or returns any vertexIndex if no used was found
* @param living
T
riangle
s
* @param living
Vertices vertice that still has a living t
riangle
* @param usedVerticeStack
* @param usedVerticeStack
stack of vertices that are recently used
* @param usedVerticeCount
* @param usedVerticeCount
number of last used vertices that maxes at @param maxUsedVertices
* @param usedVerticeOffset
* @param usedVerticeOffset
the @param usedVerticeStack wraps around and overrides old vertices, this offset keeps the wrapping intact
* @param vertexCount
* @param vertexCount
total vertex count to terminate correctly
* @param lowestLivingVertexIndex
* @param lowestLivingVertexIndex
vertexIndex with the lowest number
* @param currentTriangleIndex
* @param currentTriangleIndex
index of the currently fanned triangle
* @param skippedIndices
* @param skippedIndices
indices that define a new meshlet, even if they are close in memory
* @return a VertexIndex to be used as fanningVertexIndex
* @return a VertexIndex to be used as fanningVertexIndex
*/
*/
int
skipDeadEnd
(
int
skipDeadEnd
(
const
std
::
vector
<
uint8_t
>
&
living
Triangl
es
,
const
std
::
vector
<
uint8_t
>
&
living
Vertic
es
,
const
std
::
vector
<
uint32_t
>
&
usedVerticeStack
,
const
std
::
vector
<
uint32_t
>
&
usedVerticeStack
,
int
&
usedVerticeCount
,
int
&
usedVerticeCount
,
int
&
usedVerticeOffset
,
int
&
usedVerticeOffset
,
...
@@ -43,14 +43,14 @@ namespace vkcv::meshlet {
...
@@ -43,14 +43,14 @@ namespace vkcv::meshlet {
// iterate from the latest to the oldest. + maxUsedVertices to always make it a positive number in the range 0 to maxUsedVertices -1
// iterate from the latest to the oldest. + maxUsedVertices to always make it a positive number in the range 0 to maxUsedVertices -1
int
nextVertex
=
usedVerticeStack
[
mod
(
--
usedVerticeCount
)];
int
nextVertex
=
usedVerticeStack
[
mod
(
--
usedVerticeCount
)];
if
(
living
Triangl
es
[
nextVertex
]
>
0
)
{
if
(
living
Vertic
es
[
nextVertex
]
>
0
)
{
return
nextVertex
;
return
nextVertex
;
}
}
}
}
// returns any vertexIndex since no last used has a living triangle
// returns any vertexIndex since no last used has a living triangle
while
(
lowestLivingVertexIndex
+
1
<
vertexCount
)
{
while
(
lowestLivingVertexIndex
+
1
<
vertexCount
)
{
lowestLivingVertexIndex
++
;
lowestLivingVertexIndex
++
;
if
(
living
Triangl
es
[
lowestLivingVertexIndex
]
>
0
)
{
if
(
living
Vertic
es
[
lowestLivingVertexIndex
]
>
0
)
{
// add index of the vertex to skippedIndices
// add index of the vertex to skippedIndices
skippedIndices
.
push_back
(
static_cast
<
uint32_t
>
(
currentTriangleIndex
*
3
));
skippedIndices
.
push_back
(
static_cast
<
uint32_t
>
(
currentTriangleIndex
*
3
));
return
lowestLivingVertexIndex
;
return
lowestLivingVertexIndex
;
...
@@ -61,19 +61,19 @@ namespace vkcv::meshlet {
...
@@ -61,19 +61,19 @@ namespace vkcv::meshlet {
/**
/**
* searches for the best next candidate as a fanningVertexIndex
* searches for the best next candidate as a fanningVertexIndex
* @param vertexCount
* @param vertexCount
total vertexCount of the mesh
* @param lowestLivingVertexIndex
* @param lowestLivingVertexIndex
vertexIndex with the lowest number
* @param cacheSize
* @param cacheSize
number to determine in which range vertices are prioritized to me reused
* @param possibleCandidates
* @param possibleCandidates
candidates for the next vertex to be fanned out
* @param numPossibleCandidates
* @param numPossibleCandidates
number of all possible candidates
* @param lastTimestampCache
* @param lastTimestampCache
number of the last iteration the vertex was used
* @param currentTimeStamp
* @param currentTimeStamp
current iteration of all vertices
* @param living
T
riangle
s
* @param living
Vertices vertice that still has a living t
riangle
* @param usedVerticeStack
* @param usedVerticeStack
stack of vertices that are recently used
* @param usedVerticeCount
* @param usedVerticeCount
number of last used vertices that maxes at @param maxUsedVertices
* @param usedVerticeOffset
* @param usedVerticeOffset
the @param usedVerticeStack wraps around and overrides old vertices, this offset keeps the wrapping intact
* @param currentTriangleIndex
* @param currentTriangleIndex
index of the currently fanned triangle
* @param skippedIndices
* @param skippedIndices
indices that define a new meshlet, even if they are close in memory
* @return a VertexIndex to be used as fanningVertexIndex
* @return a VertexIndex to be used as fanningVertexIndex
*/
*/
int
getNextVertexIndex
(
int
vertexCount
,
int
getNextVertexIndex
(
int
vertexCount
,
...
@@ -83,7 +83,7 @@ namespace vkcv::meshlet {
...
@@ -83,7 +83,7 @@ namespace vkcv::meshlet {
int
numPossibleCandidates
,
int
numPossibleCandidates
,
const
std
::
vector
<
uint32_t
>
&
lastTimestampCache
,
const
std
::
vector
<
uint32_t
>
&
lastTimestampCache
,
int
currentTimeStamp
,
int
currentTimeStamp
,
const
std
::
vector
<
uint8_t
>
&
living
Triangl
es
,
const
std
::
vector
<
uint8_t
>
&
living
Vertic
es
,
const
std
::
vector
<
uint32_t
>
&
usedVerticeStack
,
const
std
::
vector
<
uint32_t
>
&
usedVerticeStack
,
int
&
usedVerticeCount
,
int
&
usedVerticeCount
,
int
&
usedVerticeOffset
,
int
&
usedVerticeOffset
,
...
@@ -96,12 +96,12 @@ namespace vkcv::meshlet {
...
@@ -96,12 +96,12 @@ namespace vkcv::meshlet {
int
vertexIndex
=
possibleCandidates
[
j
];
int
vertexIndex
=
possibleCandidates
[
j
];
// the candidate needs to be not fanned out yet
// the candidate needs to be not fanned out yet
if
(
living
Triangl
es
[
vertexIndex
]
>
0
)
{
if
(
living
Vertic
es
[
vertexIndex
]
>
0
)
{
int
priority
=
-
1
;
int
priority
=
-
1
;
// prioritizes recent used vertices, but tries not to pick one that has many triangles -> fills holes better
// prioritizes recent used vertices, but tries not to pick one that has many triangles -> fills holes better
if
(
currentTimeStamp
-
lastTimestampCache
[
vertexIndex
]
+
2
*
living
Triangl
es
[
vertexIndex
]
<=
if
(
currentTimeStamp
-
lastTimestampCache
[
vertexIndex
]
+
2
*
living
Vertic
es
[
vertexIndex
]
<=
cacheSize
)
{
cacheSize
)
{
priority
=
currentTimeStamp
-
lastTimestampCache
[
vertexIndex
];
priority
=
currentTimeStamp
-
lastTimestampCache
[
vertexIndex
];
}
}
// select the vertexIndex with the highest priority
// select the vertexIndex with the highest priority
...
@@ -115,14 +115,14 @@ namespace vkcv::meshlet {
...
@@ -115,14 +115,14 @@ namespace vkcv::meshlet {
// if no candidate is alive, try and find another one
// if no candidate is alive, try and find another one
if
(
nextVertexIndex
==
-
1
)
{
if
(
nextVertexIndex
==
-
1
)
{
nextVertexIndex
=
skipDeadEnd
(
nextVertexIndex
=
skipDeadEnd
(
livingTriangl
es
,
livingVertic
es
,
usedVerticeStack
,
usedVerticeStack
,
usedVerticeCount
,
usedVerticeCount
,
usedVerticeOffset
,
usedVerticeOffset
,
vertexCount
,
vertexCount
,
lowestLivingVertexIndex
,
lowestLivingVertexIndex
,
currentTriangleIndex
,
currentTriangleIndex
,
skippedIndices
);
skippedIndices
);
}
}
return
nextVertexIndex
;
return
nextVertexIndex
;
}
}
...
...
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