rhi: Fix tessellation support for OpenGL

Added shader stage mapping for tessellation stages.

Manual test rhi/tessellation now works for OpenGL.

Change-Id: I7906b21e9d6e20883f17729f077dba57aa29f4fd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Ben Fletcher 2022-01-28 10:06:01 -08:00
parent 37714d255b
commit 1e07787142
2 changed files with 11 additions and 7 deletions

View File

@ -704,13 +704,13 @@ Q_LOGGING_CATEGORY(QRHI_LOG_INFO, "qt.rhi.general")
\l{QRhiGraphicsPipeline::setPatchControlPointCount()}{setPatchControlPointCount()},
and shaders for tessellation control and evaluation can be specified in the
QRhiShaderStage list. \b{Tessellation is considered an experimental feature
in QRhi and can only be expected to be supported with Vulkan for the time
being}, assuming the Vulkan implementation reports it as supported at run
time. Tessellation shaders have portability issues between APIs (for
example, translating GLSL/SPIR-V to HLSL is problematic due to the way hull
shaders are structured, whereas Metal uses a somewhat different
tessellation pipeline than others), and therefore no guarantees can be
given for a universal solution for now.
in QRhi and can only be expected to be supported with Vulkan, OpenGL and
OpenGL ES for the time being}, assuming the implementation reports it as
supported at run time. Tessellation shaders have portability issues between
APIs (for example, translating GLSL/SPIR-V to HLSL is problematic due to
the way hull shaders are structured, whereas Metal uses a somewhat
different tessellation pipeline than others), and therefore no guarantees
can be given for a universal solution for now.
*/
/*!

View File

@ -4486,6 +4486,10 @@ static inline QShader::Stage toShaderStage(QRhiShaderStage::Type type)
switch (type) {
case QRhiShaderStage::Vertex:
return QShader::VertexStage;
case QRhiShaderStage::TessellationControl:
return QShader::TessellationControlStage;
case QRhiShaderStage::TessellationEvaluation:
return QShader::TessellationEvaluationStage;
case QRhiShaderStage::Fragment:
return QShader::FragmentStage;
case QRhiShaderStage::Compute: