Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vulkan2021
VkCV Framework
Commits
4a27ab19
Verified
Commit
4a27ab19
authored
Jan 25, 2022
by
Tobias Frisch
Browse files
Added support for tessellation shader stages
Signed-off-by:
Tobias Frisch
<
tfrisch@uni-koblenz.de
>
parent
40ec3566
Pipeline
#28221
canceled with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
include/vkcv/GraphicsPipelineConfig.hpp
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
src/vkcv/GraphicsPipelineManager.cpp
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
,
...
...
Tobias Frisch
@tfrisch
mentioned in issue
#117 (closed)
·
Jan 25, 2022
mentioned in issue
#117 (closed)
mentioned in issue #117
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment