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
996a1ffb
Commit
996a1ffb
authored
3 years ago
by
Simeon Hermann
Browse files
Options
Downloads
Patches
Plain Diff
[
#36
] add names of the reflected vertex inputs
parent
2278ebe5
No related branches found
No related tags found
1 merge request
!49
Resolve "Shader Program Reflection"
Pipeline
#25495
passed
3 years ago
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/vkcv/VertexLayout.hpp
+3
-1
3 additions, 1 deletion
include/vkcv/VertexLayout.hpp
src/vkcv/ShaderProgram.cpp
+6
-6
6 additions, 6 deletions
src/vkcv/ShaderProgram.cpp
src/vkcv/VertexLayout.cpp
+2
-1
2 additions, 1 deletion
src/vkcv/VertexLayout.cpp
with
11 additions
and
8 deletions
include/vkcv/VertexLayout.hpp
+
3
−
1
View file @
996a1ffb
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#include
<unordered_map>
#include
<unordered_map>
#include
<vector>
#include
<vector>
#include
<iostream>
#include
<iostream>
#include
<string>
namespace
vkcv
{
namespace
vkcv
{
...
@@ -38,10 +39,11 @@ namespace vkcv{
...
@@ -38,10 +39,11 @@ namespace vkcv{
struct
VertexInputAttachment
{
struct
VertexInputAttachment
{
VertexInputAttachment
()
=
delete
;
VertexInputAttachment
()
=
delete
;
VertexInputAttachment
(
uint32_t
location
,
uint32_t
binding
,
VertexFormat
format
,
uint32_t
offset
)
noexcept
;
VertexInputAttachment
(
uint32_t
location
,
uint32_t
binding
,
std
::
string
name
,
VertexFormat
format
,
uint32_t
offset
)
noexcept
;
uint32_t
location
;
uint32_t
location
;
uint32_t
binding
;
uint32_t
binding
;
std
::
string
name
;
VertexFormat
format
;
VertexFormat
format
;
uint32_t
offset
;
uint32_t
offset
;
};
};
...
...
This diff is collapsed.
Click to expand it.
src/vkcv/ShaderProgram.cpp
+
6
−
6
View file @
996a1ffb
...
@@ -119,9 +119,9 @@ namespace vkcv {
...
@@ -119,9 +119,9 @@ namespace vkcv {
for
(
uint32_t
i
=
0
;
i
<
resources
.
stage_inputs
.
size
();
i
++
)
{
for
(
uint32_t
i
=
0
;
i
<
resources
.
stage_inputs
.
size
();
i
++
)
{
auto
&
u
=
resources
.
stage_inputs
[
i
];
auto
&
u
=
resources
.
stage_inputs
[
i
];
const
spirv_cross
::
SPIRType
&
base_type
=
comp
.
get_type
(
u
.
base_type_id
);
const
spirv_cross
::
SPIRType
&
base_type
=
comp
.
get_type
(
u
.
base_type_id
);
VertexInputAttachment
input
=
VertexInputAttachment
(
comp
.
get_decoration
(
u
.
id
,
spv
::
DecorationLocation
),
VertexInputAttachment
input
=
VertexInputAttachment
(
comp
.
get_decoration
(
u
.
id
,
spv
::
DecorationLocation
),
0
,
0
,
u
.
name
,
convertFormat
(
base_type
.
basetype
,
base_type
.
vecsize
),
convertFormat
(
base_type
.
basetype
,
base_type
.
vecsize
),
offset
);
offset
);
inputVec
.
push_back
(
input
);
inputVec
.
push_back
(
input
);
...
@@ -133,10 +133,10 @@ namespace vkcv {
...
@@ -133,10 +133,10 @@ namespace vkcv {
//Descriptor Sets
//Descriptor Sets
//Storage buffer, uniform Buffer, storage image, sampled image, sampler (?)
//Storage buffer, uniform Buffer, storage image, sampled image, sampler (?)
std
::
vector
<
uint32_t
>
s
ampled
ImageVec
;
std
::
vector
<
uint32_t
>
s
eparate
ImageVec
;
for
(
uint32_t
i
=
0
;
i
<
resources
.
s
ampled
_images
.
size
();
i
++
)
{
for
(
uint32_t
i
=
0
;
i
<
resources
.
s
eparate
_images
.
size
();
i
++
)
{
auto
&
u
=
resources
.
s
ampled
_images
[
i
];
auto
&
u
=
resources
.
s
eparate
_images
[
i
];
s
ampled
ImageVec
.
push_back
(
comp
.
get_decoration
(
u
.
id
,
spv
::
DecorationDescriptorSet
));
s
eparate
ImageVec
.
push_back
(
comp
.
get_decoration
(
u
.
id
,
spv
::
DecorationDescriptorSet
));
}
}
std
::
vector
<
uint32_t
>
storageImageVec
;
std
::
vector
<
uint32_t
>
storageImageVec
;
...
@@ -163,7 +163,7 @@ namespace vkcv {
...
@@ -163,7 +163,7 @@ namespace vkcv {
samplerVec
.
push_back
(
comp
.
get_decoration
(
u
.
id
,
spv
::
DecorationDescriptorSet
));
samplerVec
.
push_back
(
comp
.
get_decoration
(
u
.
id
,
spv
::
DecorationDescriptorSet
));
}
}
m_DescriptorSetLayout
=
DescriptorSetLayout
(
s
ampled
ImageVec
,
storageImageVec
,
uniformBufferVec
,
storageBufferVec
,
samplerVec
);
m_DescriptorSetLayout
=
DescriptorSetLayout
(
s
eparate
ImageVec
,
storageImageVec
,
uniformBufferVec
,
storageBufferVec
,
samplerVec
);
for
(
const
auto
&
pushConstantBuffer
:
resources
.
push_constant_buffers
)
{
for
(
const
auto
&
pushConstantBuffer
:
resources
.
push_constant_buffers
)
{
for
(
const
auto
&
range
:
comp
.
get_active_buffer_ranges
(
pushConstantBuffer
.
id
))
{
for
(
const
auto
&
range
:
comp
.
get_active_buffer_ranges
(
pushConstantBuffer
.
id
))
{
...
...
This diff is collapsed.
Click to expand it.
src/vkcv/VertexLayout.cpp
+
2
−
1
View file @
996a1ffb
...
@@ -30,9 +30,10 @@ namespace vkcv {
...
@@ -30,9 +30,10 @@ namespace vkcv {
return
0
;
return
0
;
}
}
VertexInputAttachment
::
VertexInputAttachment
(
uint32_t
location
,
uint32_t
binding
,
VertexFormat
format
,
uint32_t
offset
)
noexcept
:
VertexInputAttachment
::
VertexInputAttachment
(
uint32_t
location
,
uint32_t
binding
,
std
::
string
name
,
VertexFormat
format
,
uint32_t
offset
)
noexcept
:
location
{
location
},
location
{
location
},
binding
{
binding
},
binding
{
binding
},
name
{
name
},
format
{
format
},
format
{
format
},
offset
{
offset
}
offset
{
offset
}
{}
{}
...
...
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