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
Laszlo Agocs
qtrhi
Commits
31db4910
Commit
31db4910
authored
Jan 18, 2019
by
Laszlo Agocs
Browse files
Add some support for primitive restart
parent
1508700e
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/rhi/qrhi.cpp
View file @
31db4910
...
...
@@ -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}.
*/
/*!
...
...
src/rhi/qrhi.h
View file @
31db4910
...
...
@@ -1009,7 +1009,8 @@ public:
DebugMarkers
,
Timestamps
,
Instancing
,
CustomInstanceStepRate
CustomInstanceStepRate
,
PrimitiveRestart
};
enum
ResourceSizeLimit
{
...
...
src/rhi/qrhid3d11.cpp
View file @
31db4910
...
...
@@ -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
;
...
...
src/rhi/qrhigles2.cpp
View file @
31db4910
...
...
@@ -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
;
...
...
src/rhi/qrhimetal.mm
View file @
31db4910
...
...
@@ -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
;
...
...
src/rhi/qrhivulkan.cpp
View file @
31db4910
...
...
@@ -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
;
...
...
todo.txt
View file @
31db4910
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
...
...
Write
Preview
Markdown
is supported
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