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
55937807
Commit
55937807
authored
3 years ago
by
Alexander Gauggel
Browse files
Options
Downloads
Patches
Plain Diff
[
#87
] Add task index visualisation
parent
60ab534c
No related branches found
No related tags found
1 merge request
!74
Resolve "Mesh Shader Implementation"
Pipeline
#26373
passed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/mesh_shader/resources/shaders/shader.frag
+24
-1
24 additions, 1 deletion
projects/mesh_shader/resources/shaders/shader.frag
projects/mesh_shader/resources/shaders/shader.mesh
+3
-0
3 additions, 0 deletions
projects/mesh_shader/resources/shaders/shader.mesh
with
27 additions
and
1 deletion
projects/mesh_shader/resources/shaders/shader.frag
+
24
−
1
View file @
55937807
...
...
@@ -2,8 +2,31 @@
#extension GL_ARB_separate_shader_objects : enable
layout
(
location
=
0
)
in
vec3
passNormal
;
layout
(
location
=
1
)
in
flat
uint
passTaskIndex
;
layout
(
location
=
0
)
out
vec3
outColor
;
uint
lowbias32
(
uint
x
)
{
x
^=
x
>>
16
;
x
*=
0x7feb352dU
;
x
^=
x
>>
15
;
x
*=
0x846ca68bU
;
x
^=
x
>>
16
;
return
x
;
}
float
hashToFloat
(
uint
hash
){
return
(
hash
%
255
)
/
255
.
f
;
}
vec3
colorFromIndex
(
uint
i
){
return
vec3
(
hashToFloat
(
lowbias32
(
i
+
0
)),
hashToFloat
(
lowbias32
(
i
+
1
)),
hashToFloat
(
lowbias32
(
i
+
2
)));
}
void
main
()
{
outColor
=
normalize
(
passNormal
)
*
0
.
5
+
0
.
5
;
outColor
=
normalize
(
passNormal
)
*
0
.
5
+
0
.
5
;
outColor
=
colorFromIndex
(
passTaskIndex
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
projects/mesh_shader/resources/shaders/shader.mesh
+
3
−
0
View file @
55937807
...
...
@@ -12,6 +12,7 @@ layout( push_constant ) uniform constants{
};
layout(location = 0) out vec3 passNormal[];
layout(location = 1) out uint passTaskIndex[];
struct Vertex
{
...
...
@@ -45,8 +46,10 @@ void main() {
vec3 inPos = vertices[index].position;
vec3 inNormal = vertices[index].normal;
gl_MeshVerticesNV[workIndex].gl_Position = mvp * vec4(inPos, 1);
passNormal[workIndex] = inNormal;
passTaskIndex[workIndex] = previousMeshGroupCount;
if(gl_LocalInvocationID.x == 0){
gl_PrimitiveCountNV = 10;
...
...
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