Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QRhiGraphicsPipeline Class Referenceabstract

\inmodule QtGui More...

#include <qrhi.h>

+ Inheritance diagram for QRhiGraphicsPipeline:
+ Collaboration diagram for QRhiGraphicsPipeline:

Classes

struct  StencilOpState
 \variable QRhiGraphicsPipeline::TargetBlend::colorWrite More...
 
struct  TargetBlend
 \inmodule QtGui More...
 

Public Types

enum  Flag { UsesBlendConstants = 1 << 0 , UsesStencilRef = 1 << 1 , UsesScissor = 1 << 2 , CompileShadersWithDebugInfo = 1 << 3 }
 Flag values for describing the dynamic state of the pipeline, and other options. More...
 
enum  Topology {
  Triangles , TriangleStrip , TriangleFan , Lines ,
  LineStrip , Points , Patches
}
 Specifies the primitive topology. More...
 
enum  CullMode { None , Front , Back }
 Specifies the culling mode. More...
 
enum  FrontFace { CCW , CW }
 Specifies the front face winding order. More...
 
enum  ColorMaskComponent { R = 1 << 0 , G = 1 << 1 , B = 1 << 2 , A = 1 << 3 }
 Flag values for specifying the color write mask. More...
 
enum  BlendFactor {
  Zero , One , SrcColor , OneMinusSrcColor ,
  DstColor , OneMinusDstColor , SrcAlpha , OneMinusSrcAlpha ,
  DstAlpha , OneMinusDstAlpha , ConstantColor , OneMinusConstantColor ,
  ConstantAlpha , OneMinusConstantAlpha , SrcAlphaSaturate , Src1Color ,
  OneMinusSrc1Color , Src1Alpha , OneMinusSrc1Alpha
}
 Specifies the blend factor. More...
 
enum  BlendOp {
  Add , Subtract , ReverseSubtract , Min ,
  Max
}
 Specifies the blend operation. More...
 
enum  CompareOp {
  Never , Less , Equal , LessOrEqual ,
  Greater , NotEqual , GreaterOrEqual , Always
}
 Specifies the depth or stencil comparison function. More...
 
enum  StencilOp {
  StencilZero , Keep , Replace , IncrementAndClamp ,
  DecrementAndClamp , Invert , IncrementAndWrap , DecrementAndWrap
}
 Specifies the stencil operation. More...
 
enum  PolygonMode { Fill , Line }
 Specifies the polygon rasterization mode. More...
 
- Public Types inherited from QRhiResource
enum  Type {
  Buffer , Texture , Sampler , RenderBuffer ,
  RenderPassDescriptor , SwapChainRenderTarget , TextureRenderTarget , ShaderResourceBindings ,
  GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer
}
 Specifies type of the resource. More...
 

Public Member Functions

QRhiResource::Type resourceType () const override
 
Flags flags () const
 
void setFlags (Flags f)
 Sets the flags f.
 
Topology topology () const
 
void setTopology (Topology t)
 Sets the primitive topology t.
 
CullMode cullMode () const
 
void setCullMode (CullMode mode)
 Sets the specified face culling mode.
 
FrontFace frontFace () const
 
void setFrontFace (FrontFace f)
 Sets the front face mode f.
 
void setTargetBlends (std::initializer_list< TargetBlend > list)
 Sets the list of render target blend settings.
 
template<typename InputIterator >
void setTargetBlends (InputIterator first, InputIterator last)
 Sets the list of render target blend settings from the iterators first and last.
 
const TargetBlendcbeginTargetBlends () const
 
const TargetBlendcendTargetBlends () const
 
const TargetBlendtargetBlendAt (qsizetype index) const
 
qsizetype targetBlendCount () const
 
bool hasDepthTest () const
 
void setDepthTest (bool enable)
 Enables or disables depth testing based on enable.
 
bool hasDepthWrite () const
 
void setDepthWrite (bool enable)
 Controls the writing out of depth data into the depth buffer based on enable.
 
CompareOp depthOp () const
 
void setDepthOp (CompareOp op)
 Sets the depth comparison function op.
 
bool hasStencilTest () const
 
void setStencilTest (bool enable)
 Enables or disables stencil tests based on enable.
 
StencilOpState stencilFront () const
 
void setStencilFront (const StencilOpState &state)
 Sets the stencil test state for front faces.
 
StencilOpState stencilBack () const
 
void setStencilBack (const StencilOpState &state)
 Sets the stencil test state for back faces.
 
quint32 stencilReadMask () const
 
void setStencilReadMask (quint32 mask)
 Sets the stencil read mask.
 
quint32 stencilWriteMask () const
 
void setStencilWriteMask (quint32 mask)
 Sets the stencil write mask.
 
int sampleCount () const
 
void setSampleCount (int s)
 Sets the sample count.
 
float lineWidth () const
 
void setLineWidth (float width)
 Sets the line width.
 
int depthBias () const
 
void setDepthBias (int bias)
 Sets the depth bias.
 
float slopeScaledDepthBias () const
 
void setSlopeScaledDepthBias (float bias)
 Sets the slope scaled depth bias.
 
void setShaderStages (std::initializer_list< QRhiShaderStage > list)
 Sets the list of shader stages.
 
template<typename InputIterator >
void setShaderStages (InputIterator first, InputIterator last)
 Sets the list of shader stages from the iterators first and last.
 
const QRhiShaderStagecbeginShaderStages () const
 
const QRhiShaderStagecendShaderStages () const
 
const QRhiShaderStageshaderStageAt (qsizetype index) const
 
qsizetype shaderStageCount () const
 
QRhiVertexInputLayout vertexInputLayout () const
 
void setVertexInputLayout (const QRhiVertexInputLayout &layout)
 Specifies the vertex input layout.
 
QRhiShaderResourceBindingsshaderResourceBindings () const
 
void setShaderResourceBindings (QRhiShaderResourceBindings *srb)
 Associates with srb describing the resource binding layout and the resources (QRhiBuffer, QRhiTexture) themselves.
 
QRhiRenderPassDescriptorrenderPassDescriptor () const
 
void setRenderPassDescriptor (QRhiRenderPassDescriptor *desc)
 Associates with the specified QRhiRenderPassDescriptor desc.
 
int patchControlPointCount () const
 
void setPatchControlPointCount (int count)
 Sets the number of patch control points to count.
 
PolygonMode polygonMode () const
 
void setPolygonMode (PolygonMode mode)
 Sets the polygon mode.
 
int multiViewCount () const
 
void setMultiViewCount (int count)
 Sets the view count for multiview rendering.
 
virtual bool create ()=0
 Creates the corresponding native graphics resources.
 
- Public Member Functions inherited from QRhiResource
virtual ~QRhiResource ()
 Destructor.
 
virtual void destroy ()=0
 Releases (or requests deferred releasing of) the underlying native graphics resources.
 
void deleteLater ()
 When called without a frame being recorded, this function is equivalent to deleting the object.
 
QByteArray name () const
 
void setName (const QByteArray &name)
 Sets a name for the object.
 
quint64 globalResourceId () const
 
QRhirhi () const
 

Protected Member Functions

 QRhiGraphicsPipeline (QRhiImplementation *rhi)
 \variable QRhiGraphicsPipeline::StencilOpState::failOp
 
- Protected Member Functions inherited from QRhiResource
 QRhiResource (QRhiImplementation *rhi)
 

Protected Attributes

Flags m_flags
 
Topology m_topology = Triangles
 
CullMode m_cullMode = None
 
FrontFace m_frontFace = CCW
 
QVarLengthArray< TargetBlend, 8 > m_targetBlends
 
bool m_depthTest = false
 
bool m_depthWrite = false
 
CompareOp m_depthOp = Less
 
bool m_stencilTest = false
 
StencilOpState m_stencilFront
 
StencilOpState m_stencilBack
 
quint32 m_stencilReadMask = 0xFF
 
quint32 m_stencilWriteMask = 0xFF
 
int m_sampleCount = 1
 
float m_lineWidth = 1.0f
 
int m_depthBias = 0
 
float m_slopeScaledDepthBias = 0.0f
 
int m_patchControlPointCount = 3
 
PolygonMode m_polygonMode = Fill
 
int m_multiViewCount = 0
 
QVarLengthArray< QRhiShaderStage, 4 > m_shaderStages
 
QRhiVertexInputLayout m_vertexInputLayout
 
QRhiShaderResourceBindingsm_shaderResourceBindings = nullptr
 
QRhiRenderPassDescriptorm_renderPassDesc = nullptr
 
- Protected Attributes inherited from QRhiResource
QRhiImplementationm_rhi = nullptr
 
quint64 m_id
 
QByteArray m_objectName
 

Detailed Description

\inmodule QtGui

Since
6.6

Graphics pipeline state resource.

Represents a graphics pipeline. What exactly this map to in the underlying native graphics API, varies. Where there is a concept of pipeline objects, for example with Vulkan, the QRhi backend will create such an object upon calling create(). Elsewhere, for example with OpenGL, the QRhiGraphicsPipeline may merely collect the various state, and create()'s main task is to set up the corresponding shader program, but deferring looking at any of the requested state to a later point.

As with all QRhiResource subclasses, the two-phased initialization pattern applies: setting any values via the setters, for example setDepthTest(), is only effective after calling create(). Avoid changing any values once the QRhiGraphicsPipeline has been initialized via create(). To change some state, set the new value and call create() again. However, that will effectively release all underlying native resources and create new ones. As a result, it may be a heavy, expensive operation. Rather, prefer creating multiple pipelines with the different states, and \l{QRhiCommandBuffer::setGraphicsPipeline()}{switch between them} when recording the render pass.

Note
Setting the shader stages is mandatory. There must be at least one stage, and there must be a vertex stage.
Setting the shader resource bindings is mandatory. The referenced QRhiShaderResourceBindings must already have create() called on it by the time create() is called. Associating with a QRhiShaderResourceBindings that has no bindings is also valid, as long as no shader in any stage expects any resources. Using a QRhiShaderResourceBindings object that does not specify any actual resources (i.e., the buffers, textures, etc. for the binding points are set to \nullptr) is valid as well, as long as a \l{QRhiShaderResourceBindings::isLayoutCompatible()}{layout-compatible} QRhiShaderResourceBindings, that specifies resources for all the bindings, is going to be set via \l{QRhiCommandBuffer::setShaderResources()}{setShaderResources()} when recording the render pass.
Setting the render pass descriptor is mandatory. To obtain a QRhiRenderPassDescriptor that can be passed to setRenderPassDescriptor(), use either QRhiTextureRenderTarget::newCompatibleRenderPassDescriptor() or QRhiSwapChain::newCompatibleRenderPassDescriptor().
Setting the vertex input layout is mandatory.
sampleCount() defaults to 1 and must match the sample count of the render target's color and depth stencil attachments.
The depth test, depth write, and stencil test are disabled by default. The face culling mode defaults to no culling.
stencilReadMask() and stencilWriteMask() apply to both faces. They both default to 0xFF.

Definition at line 1269 of file qrhi.h.

Member Enumeration Documentation

◆ BlendFactor

Specifies the blend factor.

\value Zero \value One \value SrcColor \value OneMinusSrcColor \value DstColor \value OneMinusDstColor \value SrcAlpha \value OneMinusSrcAlpha \value DstAlpha \value OneMinusDstAlpha \value ConstantColor \value OneMinusConstantColor \value ConstantAlpha \value OneMinusConstantAlpha \value SrcAlphaSaturate \value Src1Color \value OneMinusSrc1Color \value Src1Alpha \value OneMinusSrc1Alpha

Enumerator
Zero 
One 
SrcColor 
OneMinusSrcColor 
DstColor 
OneMinusDstColor 
SrcAlpha 
OneMinusSrcAlpha 
DstAlpha 
OneMinusDstAlpha 
ConstantColor 
OneMinusConstantColor 
ConstantAlpha 
OneMinusConstantAlpha 
SrcAlphaSaturate 
Src1Color 
OneMinusSrc1Color 
Src1Alpha 
OneMinusSrc1Alpha 

Definition at line 1309 of file qrhi.h.

◆ BlendOp

Specifies the blend operation.

\value Add \value Subtract \value ReverseSubtract \value Min \value Max

Enumerator
Add 
Subtract 
ReverseSubtract 
Min 
Max 

Definition at line 1331 of file qrhi.h.

◆ ColorMaskComponent

Flag values for specifying the color write mask.

\value R \value G \value B \value A

Enumerator

Definition at line 1301 of file qrhi.h.

◆ CompareOp

Specifies the depth or stencil comparison function.

\value Never \value Less (default for depth) \value Equal \value LessOrEqual \value Greater \value NotEqual \value GreaterOrEqual \value Always (default for stencil)

Enumerator
Never 
Less 
Equal 
LessOrEqual 
Greater 
NotEqual 
GreaterOrEqual 
Always 

Definition at line 1350 of file qrhi.h.

◆ CullMode

Specifies the culling mode.

\value None No culling (default) \value Front Cull front faces \value Back Cull back faces

Enumerator
None 
Front 
Back 

Definition at line 1290 of file qrhi.h.

◆ Flag

Flag values for describing the dynamic state of the pipeline, and other options.

The viewport is always dynamic.

\value UsesBlendConstants Indicates that a blend color constant will be set via QRhiCommandBuffer::setBlendConstants()

\value UsesStencilRef Indicates that a stencil reference value will be set via QRhiCommandBuffer::setStencilRef()

\value UsesScissor Indicates that a scissor rectangle will be set via QRhiCommandBuffer::setScissor()

\value CompileShadersWithDebugInfo Requests compiling shaders with debug information enabled. This is relevant only when runtime shader compilation from source code is involved, and only when the underlying infrastructure supports this. With concrete examples, this is not relevant with Vulkan and SPIR-V, because the GLSL-to-SPIR-V compilation does not happen at run time. On the other hand, consider Direct3D and HLSL, where there are multiple options: when the QShader packages ship with pre-compiled bytecode (DXBC), debug information is to be requested through the tool that generates the {.qsb} file, similarly to the case of Vulkan and SPIR-V. However, when having HLSL source code in the pre- or runtime-generated QShader packages, the first phase of compilation (HLSL source to intermediate format) happens at run time too, with this flag taken into account. Debug information is relevant in particular with tools like RenderDoc since it allows seeing the original source code when investigating the pipeline and when performing vertex or fragment shader debugging.

Enumerator
UsesBlendConstants 
UsesStencilRef 
UsesScissor 
CompileShadersWithDebugInfo 

Definition at line 1272 of file qrhi.h.

◆ FrontFace

Specifies the front face winding order.

\value CCW Counter clockwise (default) \value CW Clockwise

Enumerator
CCW 
CW 

Definition at line 1296 of file qrhi.h.

◆ PolygonMode

Specifies the polygon rasterization mode.

Polygon Mode (Triangle Fill Mode in Metal, Fill Mode in D3D) specifies the fill mode used when rasterizing polygons. Polygons may be drawn as solids (Fill), or as a wire mesh (Line).

Support for non-fill polygon modes is optional and is indicated by the QRhi::NonFillPolygonMode feature. With OpenGL ES and some Vulkan implementations the feature will likely be reported as unsupported, which then means values other than Fill cannot be used.

\value Fill The interior of the polygon is filled (default) \value Line Boundary edges of the polygon are drawn as line segments.

Enumerator
Fill 
Line 

Definition at line 1379 of file qrhi.h.

◆ StencilOp

Specifies the stencil operation.

\value StencilZero \value Keep (default) \value Replace \value IncrementAndClamp \value DecrementAndClamp \value Invert \value IncrementAndWrap \value DecrementAndWrap

Enumerator
StencilZero 
Keep 
Replace 
IncrementAndClamp 
DecrementAndClamp 
Invert 
IncrementAndWrap 
DecrementAndWrap 

Definition at line 1361 of file qrhi.h.

◆ Topology

Specifies the primitive topology.

\value Triangles (default) \value TriangleStrip \value TriangleFan (only available if QRhi::TriangleFanTopology is supported) \value Lines \value LineStrip \value Points

\value Patches (only available if QRhi::Tessellation is supported, and requires the tessellation stages to be present in the pipeline)

Enumerator
Triangles 
TriangleStrip 
TriangleFan 
Lines 
LineStrip 
Points 
Patches 

Definition at line 1280 of file qrhi.h.

Constructor & Destructor Documentation

◆ QRhiGraphicsPipeline()

Member Function Documentation

◆ cbeginShaderStages()

const QRhiShaderStage * QRhiGraphicsPipeline::cbeginShaderStages ( ) const
inline
Returns
a const iterator pointing to the first item in the shader stage list.

Definition at line 1453 of file qrhi.h.

Referenced by QRhiImplementation::sanityCheckGraphicsPipeline().

+ Here is the caller graph for this function:

◆ cbeginTargetBlends()

const QRhiGraphicsPipeline::TargetBlend * QRhiGraphicsPipeline::cbeginTargetBlends ( ) const
inline
Returns
a const iterator pointing to the first item in the render target blend setting list.

Definition at line 1405 of file qrhi.h.

◆ cendShaderStages()

const QRhiShaderStage * QRhiGraphicsPipeline::cendShaderStages ( ) const
inline
Returns
a const iterator pointing just after the last item in the shader stage list.

Definition at line 1454 of file qrhi.h.

Referenced by QRhiImplementation::sanityCheckGraphicsPipeline().

+ Here is the caller graph for this function:

◆ cendTargetBlends()

const QRhiGraphicsPipeline::TargetBlend * QRhiGraphicsPipeline::cendTargetBlends ( ) const
inline
Returns
a const iterator pointing just after the last item in the render target blend setting list.

Definition at line 1406 of file qrhi.h.

◆ create()

bool QRhiGraphicsPipeline::create ( )
pure virtual

Creates the corresponding native graphics resources.

If there are already resources present due to an earlier create() with no corresponding destroy(), then destroy() is called implicitly first.

Returns
true when successful, false when a graphics operation failed. Regardless of the return value, calling destroy() is always safe.
Note
This may be, depending on the underlying graphics API, an expensive operation, especially when shaders get compiled/optimized from source or from an intermediate bytecode format to the GPU's own instruction set. Where applicable, the QRhi backend automatically sets up the relevant non-persistent facilities to accelerate this, for example the Vulkan backend automatically creates a VkPipelineCache to improve data reuse during the lifetime of the application.
Drivers may also employ various persistent (disk-based) caching strategies for shader and pipeline data, which is hidden to and is outside of Qt's control. In some cases, depending on the graphics API and the QRhi backend, there are facilities within QRhi for manually managing such a cache, allowing the retrieval of a serializable blob that can then be reloaded in the future runs of the application to ensure faster pipeline creation times. See QRhi::pipelineCacheData() and QRhi::setPipelineCacheData() for details. Note also that when working with a QRhi instance managed by a higher level Qt framework, such as Qt Quick, it is possible that such disk-based caching is taken care of automatically, for example QQuickWindow uses a disk-based pipeline cache by default (which comes in addition to any driver-level caching).

Implemented in QD3D11GraphicsPipeline, QGles2GraphicsPipeline, QMetalGraphicsPipeline, QNullGraphicsPipeline, and QVkGraphicsPipeline.

Referenced by createGraphicsPipeline(), QSSGRhiContextPrivate::pipeline(), and QVideoWindowPrivate::setupGraphicsPipeline().

+ Here is the caller graph for this function:

◆ cullMode()

QRhiGraphicsPipeline::CullMode QRhiGraphicsPipeline::cullMode ( ) const
inline
Returns
the currently set face culling mode.

Definition at line 1392 of file qrhi.h.

◆ depthBias()

int QRhiGraphicsPipeline::depthBias ( ) const
inline
Returns
the currently set depth bias.

Definition at line 1440 of file qrhi.h.

◆ depthOp()

QRhiGraphicsPipeline::CompareOp QRhiGraphicsPipeline::depthOp ( ) const
inline
Returns
the depth comparison function.

Definition at line 1416 of file qrhi.h.

◆ flags()

QRhiGraphicsPipeline::Flags QRhiGraphicsPipeline::flags ( ) const
inline
Returns
the currently set flags.

Definition at line 1386 of file qrhi.h.

◆ frontFace()

QRhiGraphicsPipeline::FrontFace QRhiGraphicsPipeline::frontFace ( ) const
inline
Returns
the currently set front face mode.

Definition at line 1395 of file qrhi.h.

◆ hasDepthTest()

bool QRhiGraphicsPipeline::hasDepthTest ( ) const
inline
Returns
true if depth testing is enabled.

Definition at line 1410 of file qrhi.h.

◆ hasDepthWrite()

bool QRhiGraphicsPipeline::hasDepthWrite ( ) const
inline
Returns
true if depth write is enabled.

Definition at line 1413 of file qrhi.h.

◆ hasStencilTest()

bool QRhiGraphicsPipeline::hasStencilTest ( ) const
inline
Returns
true if stencil testing is enabled.

Definition at line 1419 of file qrhi.h.

◆ lineWidth()

float QRhiGraphicsPipeline::lineWidth ( ) const
inline
Returns
the currently set line width. The default is 1.0f.

Definition at line 1437 of file qrhi.h.

◆ multiViewCount()

int QRhiGraphicsPipeline::multiViewCount ( ) const
inline
Returns
the view count. The default is 0, indicating no multiview rendering.
Since
6.7

Definition at line 1473 of file qrhi.h.

◆ patchControlPointCount()

int QRhiGraphicsPipeline::patchControlPointCount ( ) const
inline
Returns
the currently set patch control point count.

Definition at line 1467 of file qrhi.h.

◆ polygonMode()

QRhiGraphicsPipeline::PolygonMode QRhiGraphicsPipeline::polygonMode ( ) const
inline
Returns
the polygon mode.

Definition at line 1470 of file qrhi.h.

◆ renderPassDescriptor()

QRhiRenderPassDescriptor * QRhiGraphicsPipeline::renderPassDescriptor ( ) const
inline
Returns
the currently set QRhiRenderPassDescriptor.

Definition at line 1464 of file qrhi.h.

Referenced by QRhiImplementation::sanityCheckGraphicsPipeline(), and QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().

+ Here is the caller graph for this function:

◆ resourceType()

QRhiResource::Type QRhiGraphicsPipeline::resourceType ( ) const
overridevirtual
Returns
the resource type.

Implements QRhiResource.

Definition at line 6712 of file qrhi.cpp.

References QRhiResource::GraphicsPipeline.

◆ sampleCount()

int QRhiGraphicsPipeline::sampleCount ( ) const
inline
Returns
the currently set sample count. 1 means no multisample antialiasing.

Definition at line 1434 of file qrhi.h.

◆ setCullMode()

void QRhiGraphicsPipeline::setCullMode ( CullMode mode)
inline

Sets the specified face culling mode.

Definition at line 1393 of file qrhi.h.

Referenced by QSSGRenderReflectionMap::addReflectionMapEntry(), QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), and QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setDepthBias()

void QRhiGraphicsPipeline::setDepthBias ( int bias)
inline

Sets the depth bias.

The default value is 0.

Definition at line 1441 of file qrhi.h.

Referenced by QMetalGraphicsPipeline::makeActiveForCurrentRenderPassEncoder(), and QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setDepthOp()

void QRhiGraphicsPipeline::setDepthOp ( CompareOp op)
inline

Sets the depth comparison function op.

Definition at line 1417 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setDepthTest()

void QRhiGraphicsPipeline::setDepthTest ( bool enable)
inline

Enables or disables depth testing based on enable.

Both depth test and the writing out of depth data are disabled by default.

See also
setDepthWrite()

Definition at line 1411 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setDepthWrite()

void QRhiGraphicsPipeline::setDepthWrite ( bool enable)
inline

Controls the writing out of depth data into the depth buffer based on enable.

By default this is disabled. Depth write is typically enabled together with the depth test.

Note
Enabling depth write without having depth testing enabled may not lead to the desired result, and should be avoided.
See also
setDepthTest()

Definition at line 1414 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setFlags()

void QRhiGraphicsPipeline::setFlags ( Flags f)
inline

Sets the flags f.

Definition at line 1387 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setFrontFace()

void QRhiGraphicsPipeline::setFrontFace ( FrontFace f)
inline

Sets the front face mode f.

Definition at line 1396 of file qrhi.h.

◆ setLineWidth()

void QRhiGraphicsPipeline::setLineWidth ( float width)
inline

Sets the line width.

If the QRhi::WideLines feature is reported as unsupported at runtime, values other than 1.0f are ignored.

Definition at line 1438 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setMultiViewCount()

void QRhiGraphicsPipeline::setMultiViewCount ( int count)
inline

Sets the view count for multiview rendering.

The default is 0, indicating no multiview rendering. count must be 2 or larger to trigger multiview rendering.

Multiview is only available when the \l{QRhi::MultiView}{MultiView feature} is reported as supported. The render target must be a 2D texture array, and the color attachment for the render target must have the same count set.

See QRhiColorAttachment::setMultiViewCount() for further details on multiview rendering.

Since
6.7
See also
QRhi::MultiView, QRhiColorAttachment::setMultiViewCount()

Definition at line 1474 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setPatchControlPointCount()

void QRhiGraphicsPipeline::setPatchControlPointCount ( int count)
inline

Sets the number of patch control points to count.

The default value is

  1. This is used only when the topology is set to \l Patches.

Definition at line 1468 of file qrhi.h.

◆ setPolygonMode()

void QRhiGraphicsPipeline::setPolygonMode ( PolygonMode mode)
inline

Sets the polygon mode.

The default is Fill.

See also
QRhi::NonFillPolygonMode

Definition at line 1471 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setRenderPassDescriptor()

void QRhiGraphicsPipeline::setRenderPassDescriptor ( QRhiRenderPassDescriptor * desc)
inline

Associates with the specified QRhiRenderPassDescriptor desc.

Definition at line 1465 of file qrhi.h.

Referenced by createGraphicsPipeline(), QSSGRhiContextPrivate::pipeline(), and QVideoWindowPrivate::setupGraphicsPipeline().

+ Here is the caller graph for this function:

◆ setSampleCount()

void QRhiGraphicsPipeline::setSampleCount ( int s)
inline

Sets the sample count.

Typical values for s are 1, 4, or 8. The pipeline must always be compatible with the render target, i.e. the sample counts must match.

See also
QRhi::supportedSampleCounts()

Definition at line 1435 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setShaderResourceBindings()

void QRhiGraphicsPipeline::setShaderResourceBindings ( QRhiShaderResourceBindings * srb)
inline

Associates with srb describing the resource binding layout and the resources (QRhiBuffer, QRhiTexture) themselves.

The latter is optional, because only the layout matters during pipeline creation. Therefore, the srb passed in here can leave the actual buffer or texture objects unspecified (\nullptr) as long as there is another, \l{QRhiShaderResourceBindings::isLayoutCompatible()}{layout-compatible} QRhiShaderResourceBindings bound via \l{QRhiCommandBuffer::setShaderResources()}{setShaderResources()} before recording the draw calls.

Definition at line 1462 of file qrhi.h.

Referenced by createGraphicsPipeline(), QSSGRhiContextPrivate::pipeline(), and QVideoWindowPrivate::setupGraphicsPipeline().

+ Here is the caller graph for this function:

◆ setShaderStages() [1/2]

template<typename InputIterator >
template< typename InputIterator > void QRhiGraphicsPipeline::setShaderStages ( InputIterator first,
InputIterator last )
inline

Sets the list of shader stages from the iterators first and last.

Definition at line 1448 of file qrhi.h.

◆ setShaderStages() [2/2]

void QRhiGraphicsPipeline::setShaderStages ( std::initializer_list< QRhiShaderStage > list)
inline

Sets the list of shader stages.

Definition at line 1446 of file qrhi.h.

References list.

Referenced by createGraphicsPipeline(), QSSGRhiContextPrivate::pipeline(), and QVideoWindowPrivate::setupGraphicsPipeline().

+ Here is the caller graph for this function:

◆ setSlopeScaledDepthBias()

void QRhiGraphicsPipeline::setSlopeScaledDepthBias ( float bias)
inline

Sets the slope scaled depth bias.

The default value is 0.

Definition at line 1444 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setStencilBack()

void QRhiGraphicsPipeline::setStencilBack ( const StencilOpState & state)
inline

Sets the stencil test state for back faces.

Definition at line 1426 of file qrhi.h.

References state.

◆ setStencilFront()

void QRhiGraphicsPipeline::setStencilFront ( const StencilOpState & state)
inline

Sets the stencil test state for front faces.

Definition at line 1423 of file qrhi.h.

References state.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setStencilReadMask()

void QRhiGraphicsPipeline::setStencilReadMask ( quint32 mask)
inline

Sets the stencil read mask.

The default value is 0xFF.

Definition at line 1429 of file qrhi.h.

◆ setStencilTest()

void QRhiGraphicsPipeline::setStencilTest ( bool enable)
inline

Enables or disables stencil tests based on enable.

By default this is disabled.

Definition at line 1420 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setStencilWriteMask()

void QRhiGraphicsPipeline::setStencilWriteMask ( quint32 mask)
inline

Sets the stencil write mask.

The default value is 0xFF.

Definition at line 1432 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setTargetBlends() [1/2]

template<typename InputIterator >
template< typename InputIterator > void QRhiGraphicsPipeline::setTargetBlends ( InputIterator first,
InputIterator last )
inline

Sets the list of render target blend settings from the iterators first and last.

Definition at line 1400 of file qrhi.h.

◆ setTargetBlends() [2/2]

void QRhiGraphicsPipeline::setTargetBlends ( std::initializer_list< TargetBlend > list)
inline

Sets the list of render target blend settings.

This is a list because when multiple render targets are used (i.e., a QRhiTextureRenderTarget with more than one QRhiColorAttachment), there needs to be a TargetBlend structure per render target (color attachment).

By default there is one default-constructed TargetBlend set.

See also
QRhi::MaxColorAttachments

Definition at line 1398 of file qrhi.h.

References list.

Referenced by createGraphicsPipeline(), and QSSGRhiContextPrivate::pipeline().

+ Here is the caller graph for this function:

◆ setTopology()

void QRhiGraphicsPipeline::setTopology ( Topology t)
inline

Sets the primitive topology t.

Definition at line 1390 of file qrhi.h.

Referenced by QSSGRhiContextPrivate::pipeline(), and QVideoWindowPrivate::setupGraphicsPipeline().

+ Here is the caller graph for this function:

◆ setVertexInputLayout()

void QRhiGraphicsPipeline::setVertexInputLayout ( const QRhiVertexInputLayout & layout)
inline

Specifies the vertex input layout.

Definition at line 1459 of file qrhi.h.

References layout.

Referenced by createGraphicsPipeline(), QSSGRhiContextPrivate::pipeline(), and QVideoWindowPrivate::setupGraphicsPipeline().

+ Here is the caller graph for this function:

◆ shaderResourceBindings()

QRhiShaderResourceBindings * QRhiGraphicsPipeline::shaderResourceBindings ( ) const
inline
Returns
the currently associated QRhiShaderResourceBindings object.

Definition at line 1461 of file qrhi.h.

Referenced by QRhiImplementation::sanityCheckGraphicsPipeline(), and QRhiMetal::setVertexInput().

+ Here is the caller graph for this function:

◆ shaderStageAt()

const QRhiShaderStage * QRhiGraphicsPipeline::shaderStageAt ( qsizetype index) const
inline
Returns
the shader stage at the specified index.

Definition at line 1455 of file qrhi.h.

◆ shaderStageCount()

qsizetype QRhiGraphicsPipeline::shaderStageCount ( ) const
inline
Returns
the number of shader stages in this pipeline.

Definition at line 1456 of file qrhi.h.

◆ slopeScaledDepthBias()

float QRhiGraphicsPipeline::slopeScaledDepthBias ( ) const
inline
Returns
the currently set slope scaled depth bias.

Definition at line 1443 of file qrhi.h.

◆ stencilBack()

QRhiGraphicsPipeline::StencilOpState QRhiGraphicsPipeline::stencilBack ( ) const
inline
Returns
the current stencil test state for back faces.

Definition at line 1425 of file qrhi.h.

◆ stencilFront()

QRhiGraphicsPipeline::StencilOpState QRhiGraphicsPipeline::stencilFront ( ) const
inline
Returns
the current stencil test state for front faces.

Definition at line 1422 of file qrhi.h.

◆ stencilReadMask()

quint32 QRhiGraphicsPipeline::stencilReadMask ( ) const
inline
Returns
the currrent stencil read mask.

Definition at line 1428 of file qrhi.h.

◆ stencilWriteMask()

quint32 QRhiGraphicsPipeline::stencilWriteMask ( ) const
inline
Returns
the current stencil write mask.

Definition at line 1431 of file qrhi.h.

◆ targetBlendAt()

const QRhiGraphicsPipeline::TargetBlend * QRhiGraphicsPipeline::targetBlendAt ( qsizetype index) const
inline
Returns
the render target blend setting at the specified index.

Definition at line 1407 of file qrhi.h.

◆ targetBlendCount()

qsizetype QRhiGraphicsPipeline::targetBlendCount ( ) const
inline
Returns
the number of render target blend settings.

Definition at line 1408 of file qrhi.h.

◆ topology()

QRhiGraphicsPipeline::Topology QRhiGraphicsPipeline::topology ( ) const
inline
Returns
the currently set primitive topology.

Definition at line 1389 of file qrhi.h.

◆ vertexInputLayout()

QRhiVertexInputLayout QRhiGraphicsPipeline::vertexInputLayout ( ) const
inline
Returns
the currently set vertex input layout specification.

Definition at line 1458 of file qrhi.h.

Member Data Documentation

◆ m_cullMode

CullMode QRhiGraphicsPipeline::m_cullMode = None
protected

◆ m_depthBias

int QRhiGraphicsPipeline::m_depthBias = 0
protected

◆ m_depthOp

CompareOp QRhiGraphicsPipeline::m_depthOp = Less
protected

◆ m_depthTest

bool QRhiGraphicsPipeline::m_depthTest = false
protected

◆ m_depthWrite

bool QRhiGraphicsPipeline::m_depthWrite = false
protected

◆ m_flags

Flags QRhiGraphicsPipeline::m_flags
protected

◆ m_frontFace

FrontFace QRhiGraphicsPipeline::m_frontFace = CCW
protected

◆ m_lineWidth

float QRhiGraphicsPipeline::m_lineWidth = 1.0f
protected

Definition at line 1494 of file qrhi.h.

Referenced by QVkGraphicsPipeline::create().

◆ m_multiViewCount

int QRhiGraphicsPipeline::m_multiViewCount = 0
protected

◆ m_patchControlPointCount

int QRhiGraphicsPipeline::m_patchControlPointCount = 3
protected

Definition at line 1497 of file qrhi.h.

Referenced by QD3D11GraphicsPipeline::create(), and QVkGraphicsPipeline::create().

◆ m_polygonMode

PolygonMode QRhiGraphicsPipeline::m_polygonMode = Fill
protected

◆ m_renderPassDesc

QRhiRenderPassDescriptor* QRhiGraphicsPipeline::m_renderPassDesc = nullptr
protected

◆ m_sampleCount

int QRhiGraphicsPipeline::m_sampleCount = 1
protected

◆ m_shaderResourceBindings

QRhiShaderResourceBindings* QRhiGraphicsPipeline::m_shaderResourceBindings = nullptr
protected

Definition at line 1502 of file qrhi.h.

Referenced by QVkGraphicsPipeline::create().

◆ m_shaderStages

◆ m_slopeScaledDepthBias

float QRhiGraphicsPipeline::m_slopeScaledDepthBias = 0.0f
protected

◆ m_stencilBack

StencilOpState QRhiGraphicsPipeline::m_stencilBack
protected

◆ m_stencilFront

StencilOpState QRhiGraphicsPipeline::m_stencilFront
protected

◆ m_stencilReadMask

quint32 QRhiGraphicsPipeline::m_stencilReadMask = 0xFF
protected

◆ m_stencilTest

bool QRhiGraphicsPipeline::m_stencilTest = false
protected

◆ m_stencilWriteMask

quint32 QRhiGraphicsPipeline::m_stencilWriteMask = 0xFF
protected

◆ m_targetBlends

◆ m_topology

◆ m_vertexInputLayout

QRhiVertexInputLayout QRhiGraphicsPipeline::m_vertexInputLayout
protected

Definition at line 1501 of file qrhi.h.

Referenced by QD3D11GraphicsPipeline::create(), and QVkGraphicsPipeline::create().


The documentation for this class was generated from the following files: