Commit 04371b08 authored by Laszlo Agocs's avatar Laszlo Agocs

Add back geometry stage and add feat.flag for geom/tess.

parent 8ed6c6c3
......@@ -331,6 +331,11 @@ QT_BEGIN_NAMESPACE
identically across backends, as long as this feature is reported as
supported, are \l{QRhiGraphicsPipeline::LineStrip}{LineStrip} and
\l{QRhiGraphicsPipeline::TriangleStrip}{TriangleStrip}.
\value GeometryShaders Indicates that geometry shaders are supported.
\value TessellationShaders Indicates that tessellation control and
evaluation shaders are supported.
*/
/*!
......@@ -966,8 +971,10 @@ uint qHash(const QRhiVertexInputLayout &v, uint seed) Q_DECL_NOTHROW
\inmodule QtRhi
\brief Specifies the type and the shader code for a shader stage in the graphics pipeline.
\note There is no geometry stage because some graphics APIs (Metal) have no support
for it.
\note Some backends only support a subset of the stages. Use
QRhi::isFeatureSupported() to query for support at runtime. For example,
Metal has no geometry shader support, while the OpenGL 2.x backend only
supports the vertex and fragment stages.
*/
/*!
......@@ -976,6 +983,7 @@ uint qHash(const QRhiVertexInputLayout &v, uint seed) Q_DECL_NOTHROW
\value Vertex Vertex stage
\value Fragment Fragment (pixel) stage
\value Geometry Geometry stage
\value TessellationControl Tessellation control (hull) stage
\value TessellationEvaluation Tessellation evaluation (domain) stage
*/
......@@ -2105,6 +2113,7 @@ bool QRhiShaderResourceBindings::isLayoutCompatible(const QRhiShaderResourceBind
\value VertexStage Vertex stage
\value FragmentStage Fragment (pixel) stage
\value GeometryStage Geometry stage
\value TessellationControlStage Tessellation control (hull) stage
\value TessellationEvaluationStage Tessellation evaluation (domain) stage
*/
......
......@@ -255,6 +255,7 @@ public:
enum Type {
Vertex,
Fragment,
Geometry,
TessellationControl,
TessellationEvaluation
};
......@@ -296,8 +297,9 @@ public:
enum StageFlag {
VertexStage = 1 << 0,
FragmentStage = 1 << 1,
TessellationControlStage = 1 << 2,
TessellationEvaluationStage = 1 << 3
GeometryStage = 1 << 2,
TessellationControlStage = 1 << 3,
TessellationEvaluationStage = 1 << 4
};
Q_DECLARE_FLAGS(StageFlags, StageFlag)
......@@ -1215,7 +1217,9 @@ public:
Timestamps,
Instancing,
CustomInstanceStepRate,
PrimitiveRestart
PrimitiveRestart,
GeometryShaders,
TessellationShaders
};
enum BeginFrameFlag {
......
......@@ -391,6 +391,10 @@ bool QRhiD3D11::isFeatureSupported(QRhi::Feature feature) const
return true;
case QRhi::PrimitiveRestart:
return true;
case QRhi::GeometryShaders:
return false; // for now
case QRhi::TessellationShaders:
return false; // for now
default:
Q_UNREACHABLE();
return false;
......
......@@ -501,6 +501,10 @@ bool QRhiGles2::isFeatureSupported(QRhi::Feature feature) const
return false;
case QRhi::PrimitiveRestart:
return false; // say no to madness
case QRhi::GeometryShaders:
return false;
case QRhi::TessellationShaders:
return false;
default:
Q_UNREACHABLE();
return false;
......
......@@ -508,6 +508,10 @@ bool QRhiMetal::isFeatureSupported(QRhi::Feature feature) const
return true;
case QRhi::PrimitiveRestart:
return true;
case QRhi::GeometryShaders:
return false;
case QRhi::TessellationShaders:
return false; // for now
default:
Q_UNREACHABLE();
return false;
......
......@@ -3029,6 +3029,10 @@ bool QRhiVulkan::isFeatureSupported(QRhi::Feature feature) const
return vertexAttribDivisorAvailable;
case QRhi::PrimitiveRestart:
return true;
case QRhi::GeometryShaders:
return true;
case QRhi::TessellationShaders:
return true;
default:
Q_UNREACHABLE();
return false;
......@@ -3451,6 +3455,8 @@ static inline VkShaderStageFlagBits toVkShaderStage(QRhiGraphicsShaderStage::Typ
return VK_SHADER_STAGE_VERTEX_BIT;
case QRhiGraphicsShaderStage::Fragment:
return VK_SHADER_STAGE_FRAGMENT_BIT;
case QRhiGraphicsShaderStage::Geometry:
return VK_SHADER_STAGE_GEOMETRY_BIT;
case QRhiGraphicsShaderStage::TessellationControl:
return VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
case QRhiGraphicsShaderStage::TessellationEvaluation:
......@@ -3689,6 +3695,8 @@ static inline VkShaderStageFlags toVkShaderStageFlags(QRhiShaderResourceBinding:
s |= VK_SHADER_STAGE_VERTEX_BIT;
if (stage.testFlag(QRhiShaderResourceBinding::FragmentStage))
s |= VK_SHADER_STAGE_FRAGMENT_BIT;
if (stage.testFlag(QRhiShaderResourceBinding::GeometryStage))
s |= VK_SHADER_STAGE_GEOMETRY_BIT;
if (stage.testFlag(QRhiShaderResourceBinding::TessellationControlStage))
s |= VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
if (stage.testFlag(QRhiShaderResourceBinding::TessellationEvaluationStage))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment