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
a3f22be8
Commit
a3f22be8
authored
3 years ago
by
Mark Oliver Mints
Browse files
Options
Downloads
Patches
Plain Diff
[
#71
] remove compute pipeline stuff from pipeline manager
parent
b6b892eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!83
Resolve "Refactor Pipeline Config and Manager"
Pipeline
#27057
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
+0
-62
0 additions, 62 deletions
src/vkcv/PipelineManager.cpp
src/vkcv/PipelineManager.hpp
+0
-8
0 additions, 8 deletions
src/vkcv/PipelineManager.hpp
with
0 additions
and
70 deletions
src/vkcv/PipelineManager.cpp
+
0
−
62
View file @
a3f22be8
...
@@ -678,66 +678,4 @@ namespace vkcv
...
@@ -678,66 +678,4 @@ namespace vkcv
return
m_Pipelines
[
id
].
m_config
;
return
m_Pipelines
[
id
].
m_config
;
}
}
PipelineHandle
PipelineManager
::
createComputePipeline
(
const
ShaderProgram
&
shaderProgram
,
const
std
::
vector
<
vk
::
DescriptorSetLayout
>
&
descriptorSetLayouts
)
{
// Temporally handing over the Shader Program instead of a pipeline config
vk
::
ShaderModule
computeModule
{};
if
(
createShaderModule
(
computeModule
,
shaderProgram
,
ShaderStage
::
COMPUTE
)
!=
vk
::
Result
::
eSuccess
)
return
PipelineHandle
();
vk
::
PipelineShaderStageCreateInfo
pipelineComputeShaderStageInfo
(
{},
vk
::
ShaderStageFlagBits
::
eCompute
,
computeModule
,
"main"
,
nullptr
);
vk
::
PipelineLayoutCreateInfo
pipelineLayoutCreateInfo
({},
descriptorSetLayouts
);
const
size_t
pushConstantSize
=
shaderProgram
.
getPushConstantSize
();
vk
::
PushConstantRange
pushConstantRange
(
vk
::
ShaderStageFlagBits
::
eCompute
,
0
,
pushConstantSize
);
if
(
pushConstantSize
>
0
)
{
pipelineLayoutCreateInfo
.
setPushConstantRangeCount
(
1
);
pipelineLayoutCreateInfo
.
setPPushConstantRanges
(
&
pushConstantRange
);
}
vk
::
PipelineLayout
vkPipelineLayout
{};
if
(
m_Device
.
createPipelineLayout
(
&
pipelineLayoutCreateInfo
,
nullptr
,
&
vkPipelineLayout
)
!=
vk
::
Result
::
eSuccess
)
{
m_Device
.
destroy
(
computeModule
);
return
PipelineHandle
();
}
vk
::
ComputePipelineCreateInfo
computePipelineCreateInfo
{};
computePipelineCreateInfo
.
stage
=
pipelineComputeShaderStageInfo
;
computePipelineCreateInfo
.
layout
=
vkPipelineLayout
;
vk
::
Pipeline
vkPipeline
;
if
(
m_Device
.
createComputePipelines
(
nullptr
,
1
,
&
computePipelineCreateInfo
,
nullptr
,
&
vkPipeline
)
!=
vk
::
Result
::
eSuccess
)
{
m_Device
.
destroy
(
computeModule
);
return
PipelineHandle
();
}
m_Device
.
destroy
(
computeModule
);
const
uint64_t
id
=
m_Pipelines
.
size
();
m_Pipelines
.
push_back
({
vkPipeline
,
vkPipelineLayout
,
PipelineConfig
()
});
return
PipelineHandle
(
id
,
[
&
](
uint64_t
id
)
{
destroyPipelineById
(
id
);
});
}
// There is an issue for refactoring the Pipeline Manager.
// While including Compute Pipeline Creation, some private helper functions where introduced:
vk
::
Result
PipelineManager
::
createShaderModule
(
vk
::
ShaderModule
&
module
,
const
ShaderProgram
&
shaderProgram
,
const
ShaderStage
stage
)
{
std
::
vector
<
char
>
code
=
shaderProgram
.
getShader
(
stage
).
shaderCode
;
vk
::
ShaderModuleCreateInfo
moduleInfo
({},
code
.
size
(),
reinterpret_cast
<
uint32_t
*>
(
code
.
data
()));
return
m_Device
.
createShaderModule
(
&
moduleInfo
,
nullptr
,
&
module
);
}
}
}
This diff is collapsed.
Click to expand it.
src/vkcv/PipelineManager.hpp
+
0
−
8
View file @
a3f22be8
...
@@ -40,11 +40,6 @@ namespace vkcv
...
@@ -40,11 +40,6 @@ namespace vkcv
*/
*/
PipelineHandle
createPipeline
(
const
PipelineConfig
&
config
,
PassManager
&
passManager
);
PipelineHandle
createPipeline
(
const
PipelineConfig
&
config
,
PassManager
&
passManager
);
// TODO: Move to ComputePipelineManager
PipelineHandle
createComputePipeline
(
const
ShaderProgram
&
shaderProgram
,
const
std
::
vector
<
vk
::
DescriptorSetLayout
>&
descriptorSetLayouts
);
/**
/**
* Returns a vk::Pipeline object by handle.
* Returns a vk::Pipeline object by handle.
* @param handle Directing to the requested pipeline.
* @param handle Directing to the requested pipeline.
...
@@ -81,8 +76,5 @@ namespace vkcv
...
@@ -81,8 +76,5 @@ namespace vkcv
void
destroyPipelineById
(
uint64_t
id
);
void
destroyPipelineById
(
uint64_t
id
);
// TODO: Move to ComputePipelineManager
vk
::
Result
createShaderModule
(
vk
::
ShaderModule
&
module
,
const
ShaderProgram
&
shaderProgram
,
ShaderStage
stage
);
};
};
}
}
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