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
bd79dfe9
Commit
bd79dfe9
authored
3 years ago
by
Mark Oliver Mints
Browse files
Options
Downloads
Patches
Plain Diff
[
#71
] Refactor: implement a create function for Pipeline Vertex Input State Create Info Struct
parent
6e84ab3a
No related branches found
No related tags found
1 merge request
!83
Resolve "Refactor Pipeline Config and Manager"
Pipeline
#26686
passed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/vkcv/PipelineManager.cpp
+30
-7
30 additions, 7 deletions
src/vkcv/PipelineManager.cpp
src/vkcv/PipelineManager.hpp
+6
-0
6 additions, 0 deletions
src/vkcv/PipelineManager.hpp
with
36 additions
and
7 deletions
src/vkcv/PipelineManager.cpp
+
30
−
7
View file @
bd79dfe9
...
...
@@ -246,13 +246,9 @@ namespace vkcv
fillVertexInputDescription
(
vertexAttributeDescriptions
,
vertexBindingDescriptions
,
existsVertexShader
,
config
);
// Handover Containers to PipelineVertexInputStateCreateIngo Struct
vk
::
PipelineVertexInputStateCreateInfo
pipelineVertexInputStateCreateInfo
(
{},
vertexBindingDescriptions
.
size
(),
vertexBindingDescriptions
.
data
(),
vertexAttributeDescriptions
.
size
(),
vertexAttributeDescriptions
.
data
()
);
vk
::
PipelineVertexInputStateCreateInfo
pipelineVertexInputStateCreateInfo
=
createPipelineVertexInputStateCreateInfo
(
vertexAttributeDescriptions
,
vertexBindingDescriptions
);
// input assembly state
vk
::
PipelineInputAssemblyStateCreateInfo
pipelineInputAssemblyStateCreateInfo
(
...
...
@@ -543,6 +539,13 @@ namespace vkcv
return
m_Device
.
createShaderModule
(
&
moduleInfo
,
nullptr
,
&
module
);
}
/**
* Fills Vertex Attribute and Binding Description with the corresponding objects form the Vertex Layout.
* @param vertexAttributeDescriptions
* @param vertexBindingDescriptions
* @param existsVertexShader
* @param config
*/
void
PipelineManager
::
fillVertexInputDescription
(
std
::
vector
<
vk
::
VertexInputAttributeDescription
>
&
vertexAttributeDescriptions
,
std
::
vector
<
vk
::
VertexInputBindingDescription
>
&
vertexBindingDescriptions
,
...
...
@@ -570,4 +573,24 @@ namespace vkcv
}
}
}
/**
* Create a Pipeline Vertex Input State Create Info Struct and fills it with Attribute and Binding data.
* @param vertexAttributeDescriptions
* @param vertexBindingDescriptions
* @return Pipeline Vertex Input State Create Info Struct
*/
vk
::
PipelineVertexInputStateCreateInfo
PipelineManager
::
createPipelineVertexInputStateCreateInfo
(
std
::
vector
<
vk
::
VertexInputAttributeDescription
>
&
vertexAttributeDescriptions
,
std
::
vector
<
vk
::
VertexInputBindingDescription
>
&
vertexBindingDescriptions
)
{
vk
::
PipelineVertexInputStateCreateInfo
pipelineVertexInputStateCreateInfo
(
{},
vertexBindingDescriptions
.
size
(),
vertexBindingDescriptions
.
data
(),
vertexAttributeDescriptions
.
size
(),
vertexAttributeDescriptions
.
data
()
);
return
pipelineVertexInputStateCreateInfo
;
}
}
This diff is collapsed.
Click to expand it.
src/vkcv/PipelineManager.hpp
+
6
−
0
View file @
bd79dfe9
...
...
@@ -23,12 +23,18 @@ namespace vkcv
void
destroyPipelineById
(
uint64_t
id
);
vk
::
Result
createShaderModule
(
vk
::
ShaderModule
&
module
,
const
ShaderProgram
&
shaderProgram
,
ShaderStage
stage
);
void
fillVertexInputDescription
(
std
::
vector
<
vk
::
VertexInputAttributeDescription
>
&
vertexAttributeDescriptions
,
std
::
vector
<
vk
::
VertexInputBindingDescription
>
&
vertexBindingDescriptions
,
const
bool
existsVertexShader
,
const
PipelineConfig
&
config
);
vk
::
PipelineVertexInputStateCreateInfo
createPipelineVertexInputStateCreateInfo
(
std
::
vector
<
vk
::
VertexInputAttributeDescription
>
&
vertexAttributeDescriptions
,
std
::
vector
<
vk
::
VertexInputBindingDescription
>
&
vertexBindingDescriptions
);
public
:
PipelineManager
()
=
delete
;
// no default ctor
explicit
PipelineManager
(
vk
::
Device
device
)
noexcept
;
// ctor
...
...
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