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
!71
Resolve "Descriptor in multiple shader stages"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Descriptor in multiple shader stages"
76-descriptor-in-multiple-shader-stages
into
develop
Overview
6
Commits
13
Pipelines
13
Changes
8
Merged
Ghost User
requested to merge
76-descriptor-in-multiple-shader-stages
into
develop
3 years ago
Overview
6
Commits
13
Pipelines
13
Changes
1
Expand
Closes
#76 (closed)
Edited
3 years ago
by
Ghost User
0
0
Merge request reports
Compare
version 6
version 12
32fe725e
3 years ago
version 11
2180cfac
3 years ago
version 10
7fae0111
3 years ago
version 9
7fae0111
3 years ago
version 8
f32c2548
3 years ago
version 7
9bd9cf11
3 years ago
version 6
5fad3ab1
3 years ago
version 5
e4e646f3
3 years ago
version 4
c420f75a
3 years ago
version 3
1aa46541
3 years ago
version 2
3a986fbf
3 years ago
version 1
1c92affc
3 years ago
develop (base)
and
version 7
latest version
c6074f90
13 commits,
3 years ago
version 12
32fe725e
12 commits,
3 years ago
version 11
2180cfac
11 commits,
3 years ago
version 10
7fae0111
9 commits,
3 years ago
version 9
7fae0111
9 commits,
3 years ago
version 8
f32c2548
8 commits,
3 years ago
version 7
9bd9cf11
7 commits,
3 years ago
version 6
5fad3ab1
6 commits,
3 years ago
version 5
e4e646f3
5 commits,
3 years ago
version 4
c420f75a
4 commits,
3 years ago
version 3
1aa46541
3 commits,
3 years ago
version 2
3a986fbf
2 commits,
3 years ago
version 1
1c92affc
1 commit,
3 years ago
Show latest version
1 file
+
19
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
src/vkcv/ShaderProgram.cpp
+
19
−
7
Options
@@ -138,12 +138,6 @@ namespace vkcv {
m_VertexAttachments
.
emplace_back
(
attachment_loc
,
attachment_name
,
attachment_format
);
}
}
ShaderStages
stages
;
stages
|=
ShaderStage
::
VERTEX
;
stages
|=
ShaderStage
::
FRAGMENT
;
vk
::
ShaderStageFlags
flags
=
vk
::
ShaderStageFlagBits
::
eVertex
|
vk
::
ShaderStageFlagBits
::
eFragment
;
//reflect descriptor sets (uniform buffer, storage buffer, sampler, sampled image, storage image)
std
::
vector
<
std
::
pair
<
uint32_t
,
DescriptorBinding
>>
bindings
;
@@ -201,7 +195,25 @@ namespace vkcv {
if
(
maxSetID
!=
-
1
)
{
if
((
int32_t
)
m_DescriptorSets
.
size
()
<=
maxSetID
)
m_DescriptorSets
.
resize
(
maxSetID
+
1
);
for
(
const
auto
&
binding
:
bindings
)
{
m_DescriptorSets
[
binding
.
first
].
push_back
(
binding
.
second
);
//checking if descriptor has already been reflected in another shader stage
bool
bindingFound
=
false
;
uint32_t
pos
=
0
;
for
(
const
auto
&
descriptor
:
m_DescriptorSets
[
binding
.
first
])
{
if
(
binding
.
second
.
bindingID
==
descriptor
.
bindingID
)
{
if
(
binding
.
second
.
descriptorType
==
descriptor
.
descriptorType
&&
binding
.
second
.
descriptorCount
==
descriptor
.
descriptorCount
)
{
//updating descriptor binding with another shader stage
ShaderStages
updatedShaders
=
descriptor
.
shaderStages
|
shaderStage
;
DescriptorBinding
newBinding
=
DescriptorBinding
(
binding
.
second
.
bindingID
,
binding
.
second
.
descriptorType
,
binding
.
second
.
descriptorCount
,
updatedShaders
);
m_DescriptorSets
[
binding
.
first
][
pos
]
=
newBinding
;
bindingFound
=
true
;
break
;
}
else
vkcv_log
(
LogLevel
::
ERROR
,
"Included shaders contain resources with same identifier but different type or count"
);
}
pos
++
;
}
//append new descriptor if it has not been reflected yet
if
(
!
bindingFound
)
m_DescriptorSets
[
binding
.
first
].
push_back
(
binding
.
second
);
}
}
Loading