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
6a9d197e
Commit
6a9d197e
authored
3 years ago
by
Mark Oliver Mints
Browse files
Options
Downloads
Patches
Plain Diff
[
#71
] Refactor: implement a create function for Layout and Depth Stencil
parent
5bc6e1a6
No related branches found
No related tags found
1 merge request
!83
Resolve "Refactor Pipeline Config and Manager"
Pipeline
#26695
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
+38
-21
38 additions, 21 deletions
src/vkcv/PipelineManager.cpp
src/vkcv/PipelineManager.hpp
+15
-0
15 additions, 0 deletions
src/vkcv/PipelineManager.hpp
with
53 additions
and
21 deletions
src/vkcv/PipelineManager.cpp
+
38
−
21
View file @
6a9d197e
...
...
@@ -271,16 +271,10 @@ namespace vkcv
createPipelineColorBlendStateCreateInfo
(
config
);
// pipeline layout
const
size_t
pushConstantSize
=
config
.
m_ShaderProgram
.
getPushConstantSize
();
const
vk
::
PushConstantRange
pushConstantRange
(
vk
::
ShaderStageFlagBits
::
eAll
,
0
,
pushConstantSize
);
vk
::
PipelineLayoutCreateInfo
pipelineLayoutCreateInfo
(
{},
(
config
.
m_DescriptorLayouts
),
(
pushConstantRange
));
if
(
pushConstantSize
==
0
)
{
pipelineLayoutCreateInfo
.
pushConstantRangeCount
=
0
;
}
vk
::
PipelineLayoutCreateInfo
pipelineLayoutCreateInfo
=
createPipelineLayoutCreateInfo
(
config
);
vk
::
PipelineLayout
vkPipelineLayout
{};
if
(
m_Device
.
createPipelineLayout
(
&
pipelineLayoutCreateInfo
,
nullptr
,
&
vkPipelineLayout
)
!=
vk
::
Result
::
eSuccess
)
...
...
@@ -290,18 +284,8 @@ namespace vkcv
}
// Depth Stencil
const
vk
::
PipelineDepthStencilStateCreateInfo
depthStencilCreateInfo
(
vk
::
PipelineDepthStencilStateCreateFlags
(),
config
.
m_depthTest
!=
DepthTest
::
None
,
config
.
m_depthWrite
,
depthTestToVkCompareOp
(
config
.
m_depthTest
),
false
,
false
,
{},
{},
0.0
f
,
1.0
f
);
const
vk
::
PipelineDepthStencilStateCreateInfo
depthStencilCreateInfo
=
createPipelineDepthStencilStateCreateInfo
(
config
);
const
vk
::
PipelineDepthStencilStateCreateInfo
*
p_depthStencilCreateInfo
=
nullptr
;
const
PassConfig
&
passConfig
=
passManager
.
getPassConfig
(
config
.
m_PassHandle
);
...
...
@@ -638,4 +622,37 @@ namespace vkcv
);
return
pipelineColorBlendStateCreateInfo
;
}
vk
::
PipelineLayoutCreateInfo
PipelineManager
::
createPipelineLayoutCreateInfo
(
const
PipelineConfig
&
config
)
{
const
size_t
pushConstantSize
=
config
.
m_ShaderProgram
.
getPushConstantSize
();
const
vk
::
PushConstantRange
pushConstantRange
(
vk
::
ShaderStageFlagBits
::
eAll
,
0
,
pushConstantSize
);
vk
::
PipelineLayoutCreateInfo
pipelineLayoutCreateInfo
(
{},
(
config
.
m_DescriptorLayouts
),
(
pushConstantRange
));
if
(
pushConstantSize
==
0
)
{
pipelineLayoutCreateInfo
.
pushConstantRangeCount
=
0
;
}
return
pipelineLayoutCreateInfo
;
}
vk
::
PipelineDepthStencilStateCreateInfo
PipelineManager
::
createPipelineDepthStencilStateCreateInfo
(
const
PipelineConfig
&
config
)
{
const
vk
::
PipelineDepthStencilStateCreateInfo
pipelineDepthStencilCreateInfo
(
vk
::
PipelineDepthStencilStateCreateFlags
(),
config
.
m_depthTest
!=
DepthTest
::
None
,
config
.
m_depthWrite
,
depthTestToVkCompareOp
(
config
.
m_depthTest
),
false
,
false
,
{},
{},
0.0
f
,
1.0
f
);
return
pipelineDepthStencilCreateInfo
;
}
}
This diff is collapsed.
Click to expand it.
src/vkcv/PipelineManager.hpp
+
15
−
0
View file @
6a9d197e
...
...
@@ -115,5 +115,20 @@ namespace vkcv
* @return
*/
vk
::
PipelineColorBlendStateCreateInfo
createPipelineColorBlendStateCreateInfo
(
const
PipelineConfig
&
config
);
/**
* Creates a Pipeline Layout Create Info Struct.
* @param config sets Push Constant Size and Descriptor Layouts.
* @return Pipeline Layout Create Info Struct
*/
vk
::
PipelineLayoutCreateInfo
createPipelineLayoutCreateInfo
(
const
PipelineConfig
&
config
);
/**
* Creates a Pipeline Depth Stencil State Create Info Struct.
* @param config sets if depth test in enabled or not.
* @return Pipeline Layout Create Info Struct
*/
vk
::
PipelineDepthStencilStateCreateInfo
createPipelineDepthStencilStateCreateInfo
(
const
PipelineConfig
&
config
);
};
}
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