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
4a27ab19
Verified
Commit
4a27ab19
authored
3 years ago
by
Tobias Frisch
Browse files
Options
Downloads
Patches
Plain Diff
Added support for tessellation shader stages
Signed-off-by:
Tobias Frisch
<
tfrisch@uni-koblenz.de
>
parent
40ec3566
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#28221
canceled
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/vkcv/GraphicsPipelineConfig.hpp
+1
-0
1 addition, 0 deletions
include/vkcv/GraphicsPipelineConfig.hpp
src/vkcv/GraphicsPipelineManager.cpp
+55
-2
55 additions, 2 deletions
src/vkcv/GraphicsPipelineManager.cpp
with
56 additions
and
2 deletions
include/vkcv/GraphicsPipelineConfig.hpp
+
1
−
0
View file @
4a27ab19
...
@@ -39,6 +39,7 @@ namespace vkcv {
...
@@ -39,6 +39,7 @@ namespace vkcv {
DepthTest
m_depthTest
=
DepthTest
::
LessEqual
;
DepthTest
m_depthTest
=
DepthTest
::
LessEqual
;
bool
m_depthWrite
=
true
;
bool
m_depthWrite
=
true
;
bool
m_alphaToCoverage
=
false
;
bool
m_alphaToCoverage
=
false
;
uint32_t
m_tessellationControlPoints
=
0
;
};
};
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/vkcv/GraphicsPipelineManager.cpp
+
55
−
2
View file @
4a27ab19
...
@@ -195,6 +195,15 @@ namespace vkcv
...
@@ -195,6 +195,15 @@ namespace vkcv
return
pipelineInputAssemblyStateCreateInfo
;
return
pipelineInputAssemblyStateCreateInfo
;
}
}
vk
::
PipelineTessellationStateCreateInfo
createPipelineTessellationStateCreateInfo
(
const
GraphicsPipelineConfig
&
config
)
{
vk
::
PipelineTessellationStateCreateInfo
pipelineTessellationStateCreateInfo
(
{},
config
.
m_tessellationControlPoints
);
return
pipelineTessellationStateCreateInfo
;
}
/**
/**
* Creates a Pipeline Viewport State Create Info Struct with default set viewport and scissor settings.
* Creates a Pipeline Viewport State Create Info Struct with default set viewport and scissor settings.
* @param config provides with and height of the output window
* @param config provides with and height of the output window
...
@@ -424,7 +433,13 @@ namespace vkcv
...
@@ -424,7 +433,13 @@ namespace vkcv
const
bool
existsVertexShader
=
config
.
m_ShaderProgram
.
existsShader
(
ShaderStage
::
VERTEX
);
const
bool
existsVertexShader
=
config
.
m_ShaderProgram
.
existsShader
(
ShaderStage
::
VERTEX
);
const
bool
existsFragmentShader
=
config
.
m_ShaderProgram
.
existsShader
(
ShaderStage
::
FRAGMENT
);
const
bool
existsFragmentShader
=
config
.
m_ShaderProgram
.
existsShader
(
ShaderStage
::
FRAGMENT
);
const
bool
existsGeometryShader
=
config
.
m_ShaderProgram
.
existsShader
(
ShaderStage
::
GEOMETRY
);
const
bool
existsGeometryShader
=
config
.
m_ShaderProgram
.
existsShader
(
ShaderStage
::
GEOMETRY
);
const
bool
validGeometryStages
=
existsVertexShader
||
(
existsTaskShader
&&
existsMeshShader
);
const
bool
existsTessellationControlShader
=
config
.
m_ShaderProgram
.
existsShader
(
ShaderStage
::
TESS_CONTROL
);
const
bool
existsTessellationEvaluationShader
=
config
.
m_ShaderProgram
.
existsShader
(
ShaderStage
::
TESS_EVAL
);
const
bool
validGeometryStages
=
(
(
existsVertexShader
&&
(
existsTessellationControlShader
==
existsTessellationEvaluationShader
))
||
(
existsTaskShader
&&
existsMeshShader
)
);
if
(
!
validGeometryStages
)
if
(
!
validGeometryStages
)
{
{
...
@@ -529,6 +544,40 @@ namespace vkcv
...
@@ -529,6 +544,40 @@ namespace vkcv
return
GraphicsPipelineHandle
();
return
GraphicsPipelineHandle
();
}
}
}
}
if
(
existsTessellationControlShader
)
{
vk
::
PipelineShaderStageCreateInfo
createInfo
;
const
bool
success
=
createPipelineShaderStageCreateInfo
(
config
.
m_ShaderProgram
,
ShaderStage
::
TESS_CONTROL
,
m_Device
,
&
createInfo
);
if
(
success
)
{
shaderStages
.
push_back
(
createInfo
);
}
else
{
destroyShaderModules
();
return
GraphicsPipelineHandle
();
}
}
if
(
existsTessellationEvaluationShader
)
{
vk
::
PipelineShaderStageCreateInfo
createInfo
;
const
bool
success
=
createPipelineShaderStageCreateInfo
(
config
.
m_ShaderProgram
,
ShaderStage
::
TESS_EVAL
,
m_Device
,
&
createInfo
);
if
(
success
)
{
shaderStages
.
push_back
(
createInfo
);
}
else
{
destroyShaderModules
();
return
GraphicsPipelineHandle
();
}
}
// vertex input state
// vertex input state
// Fill up VertexInputBindingDescription and VertexInputAttributeDescription Containers
// Fill up VertexInputBindingDescription and VertexInputAttributeDescription Containers
...
@@ -545,6 +594,10 @@ namespace vkcv
...
@@ -545,6 +594,10 @@ namespace vkcv
vk
::
PipelineInputAssemblyStateCreateInfo
pipelineInputAssemblyStateCreateInfo
=
vk
::
PipelineInputAssemblyStateCreateInfo
pipelineInputAssemblyStateCreateInfo
=
createPipelineInputAssemblyStateCreateInfo
(
config
);
createPipelineInputAssemblyStateCreateInfo
(
config
);
// tesselation state
vk
::
PipelineTessellationStateCreateInfo
pipelineTessellationStateCreateInfo
=
createPipelineTessellationStateCreateInfo
(
config
);
// viewport state
// viewport state
vk
::
PipelineViewportStateCreateInfo
pipelineViewportStateCreateInfo
=
vk
::
PipelineViewportStateCreateInfo
pipelineViewportStateCreateInfo
=
createPipelineViewportStateCreateInfo
(
config
);
createPipelineViewportStateCreateInfo
(
config
);
...
@@ -601,7 +654,7 @@ namespace vkcv
...
@@ -601,7 +654,7 @@ namespace vkcv
shaderStages
.
data
(),
shaderStages
.
data
(),
&
pipelineVertexInputStateCreateInfo
,
&
pipelineVertexInputStateCreateInfo
,
&
pipelineInputAssemblyStateCreateInfo
,
&
pipelineInputAssemblyStateCreateInfo
,
nullptr
,
&
pipelineTessellationStateCreateInfo
,
&
pipelineViewportStateCreateInfo
,
&
pipelineViewportStateCreateInfo
,
&
pipelineRasterizationStateCreateInfo
,
&
pipelineRasterizationStateCreateInfo
,
&
pipelineMultisampleStateCreateInfo
,
&
pipelineMultisampleStateCreateInfo
,
...
...
This diff is collapsed.
Click to expand it.
Tobias Frisch
@tfrisch
mentioned in issue
#117 (closed)
·
3 years ago
mentioned in issue
#117 (closed)
mentioned in issue #117
Toggle commit list
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