Commit 31db4910 authored by Laszlo Agocs's avatar Laszlo Agocs

Add some support for primitive restart

parent 1508700e
......@@ -275,12 +275,35 @@ QT_BEGIN_NAMESPACE
\enum QRhi::Feature
Flag values to indicate what features are supported by the backend currently in use.
\value MultisampleTexture Textures with sample count larger than 1 are supported.
\value MultisampleRenderBuffer Renderbuffers with sample count larger than 1 are supported.
\value DebugMarkers Debug marker groups (and so QRhiCommandBuffer::debugMarkBegin()) are supported.
\value Timestamps Command buffer timestamps are supported. Relevant for QRhiProfiler::gpuFrameTimes().
\value MultisampleTexture Textures with sample count larger than 1 are
supported.
\value MultisampleRenderBuffer Renderbuffers with sample count larger than
1 are supported.
\value DebugMarkers Debug marker groups (and so
QRhiCommandBuffer::debugMarkBegin()) are supported.
\value Timestamps Command buffer timestamps are supported. Relevant for
QRhiProfiler::gpuFrameTimes().
\value Instancing Instanced drawing is supported.
\value CustomInstanceStepRate Instance step rate other than 1 is supported.
\value PrimitiveRestart Restarting the assembly of primitives when
encountering an index value of 0xFFFF
(\l{QRhiCommandBuffer::IndexUInt16}{IndexUInt16}) or 0xFFFFFFFF
(\l{QRhiCommandBuffer::IndexUInt32}{IndexUInt32}) is always enabled, for
certain primitive topologies at least. Due to the wildly varying primitive
restart behavior and support in the underlying graphics APIs, primitive
restart cannot be controlled with QRhi. Instead, applications must assume
that whenever this feature is reported as supported, the above mentioned
index values \c may be treated specially, depending on the topology. The
only two topologies where primitive restart is guaranteed to behave
identically across backends, as long as this feature is reported as
supported, are \l{QRhiGraphicsPipeline::LineStrip}{LineStrip} and
\l{QRhiGraphicsPipeline::TriangleStrip}{TriangleStrip}.
*/
/*!
......
......@@ -1009,7 +1009,8 @@ public:
DebugMarkers,
Timestamps,
Instancing,
CustomInstanceStepRate
CustomInstanceStepRate,
PrimitiveRestart
};
enum ResourceSizeLimit {
......
......@@ -320,6 +320,8 @@ bool QRhiD3D11::isFeatureSupported(QRhi::Feature feature) const
return true;
case QRhi::CustomInstanceStepRate:
return true;
case QRhi::PrimitiveRestart:
return true;
default:
Q_UNREACHABLE();
return false;
......
......@@ -323,6 +323,8 @@ bool QRhiGles2::isFeatureSupported(QRhi::Feature feature) const
return false;
case QRhi::CustomInstanceStepRate:
return false;
case QRhi::PrimitiveRestart:
return false; // say no to madness
default:
Q_UNREACHABLE();
return false;
......
......@@ -437,6 +437,8 @@ bool QRhiMetal::isFeatureSupported(QRhi::Feature feature) const
return true;
case QRhi::CustomInstanceStepRate:
return true;
case QRhi::PrimitiveRestart:
return true;
default:
Q_UNREACHABLE();
return false;
......
......@@ -2863,6 +2863,8 @@ bool QRhiVulkan::isFeatureSupported(QRhi::Feature feature) const
return true;
case QRhi::CustomInstanceStepRate:
return vertexAttribDivisorAvailable;
case QRhi::PrimitiveRestart:
return true;
default:
Q_UNREACHABLE();
return false;
......@@ -4452,6 +4454,7 @@ bool QVkGraphicsPipeline::build()
memset(&inputAsmInfo, 0, sizeof(inputAsmInfo));
inputAsmInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
inputAsmInfo.topology = toVkTopology(m_topology);
inputAsmInfo.primitiveRestartEnable = (m_topology == TriangleStrip || m_topology == LineStrip);
pipelineInfo.pInputAssemblyState = &inputAsmInfo;
VkPipelineRasterizationStateCreateInfo rastInfo;
......
multiwindow_threaded should demo pulling out the device and importing to another rhi
primitive restart
advanced blend modes
gl: tex formats (texture, readback)
gl: srgb
......@@ -21,7 +20,6 @@ gl: ubuf structs, arrays
test cubemap face as target
test cubemap face readback
object names for other than buf/rb/tex
clang_qdoc ifdefs for q_declare_flags to be removed once qdoc does not choke on them
optional:
compute?
......@@ -48,6 +46,8 @@ dxc for d3d as an alternative to fxc?
hlsl -> dxc -> spirv -> spirv-cross hmmm...
+++ done
primitive restart
fix independent builds
basic docs
vk, d3d, mtl: minimize vertex input changes inside passes
mtl: cbuffers, textures, samplers set should be batched too
......
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