QtBase  v6.3.1
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QRhiGraphicsPipeline Class Referenceabstract

#include <qrhi_p.h>

Inheritance diagram for QRhiGraphicsPipeline:
Inheritance graph
[legend]
Collaboration diagram for QRhiGraphicsPipeline:
Collaboration graph
[legend]

Classes

class  StencilOpState
 
class  TargetBlend
 

Public Types

enum  Flag { UsesBlendConstants = 1 << 0 , UsesStencilRef = 1 << 1 , UsesScissor = 1 << 2 , CompileShadersWithDebugInfo = 1 << 3 }
 
enum  Topology {
  Triangles , TriangleStrip , TriangleFan , Lines ,
  LineStrip , Points
}
 
enum  CullMode { None , Front , Back }
 
enum  FrontFace { CCW , CW }
 
enum  ColorMaskComponent { R = 1 << 0 , G = 1 << 1 , B = 1 << 2 , A = 1 << 3 }
 
enum  BlendFactor {
  Zero , One , SrcColor , OneMinusSrcColor ,
  DstColor , OneMinusDstColor , SrcAlpha , OneMinusSrcAlpha ,
  DstAlpha , OneMinusDstAlpha , ConstantColor , OneMinusConstantColor ,
  ConstantAlpha , OneMinusConstantAlpha , SrcAlphaSaturate , Src1Color ,
  OneMinusSrc1Color , Src1Alpha , OneMinusSrc1Alpha
}
 
enum  BlendOp {
  Add , Subtract , ReverseSubtract , Min ,
  Max
}
 
enum  CompareOp {
  Never , Less , Equal , LessOrEqual ,
  Greater , NotEqual , GreaterOrEqual , Always
}
 
enum  StencilOp {
  StencilZero , Keep , Replace , IncrementAndClamp ,
  DecrementAndClamp , Invert , IncrementAndWrap , DecrementAndWrap
}
 
- Public Types inherited from QRhiResource
enum  Type {
  Buffer , Texture , Sampler , RenderBuffer ,
  RenderPassDescriptor , RenderTarget , TextureRenderTarget , ShaderResourceBindings ,
  GraphicsPipeline , SwapChain , ComputePipeline , CommandBuffer
}
 

Public Member Functions

QRhiResource::Type resourceType () const override
 
Flags flags () const
 
void setFlags (Flags f)
 
Topology topology () const
 
void setTopology (Topology t)
 
CullMode cullMode () const
 
void setCullMode (CullMode mode)
 
FrontFace frontFace () const
 
void setFrontFace (FrontFace f)
 
void setTargetBlends (std::initializer_list< TargetBlend > list)
 
template<typename InputIterator >
void setTargetBlends (InputIterator first, InputIterator last)
 
const TargetBlendcbeginTargetBlends () const
 
const TargetBlendcendTargetBlends () const
 
bool hasDepthTest () const
 
void setDepthTest (bool enable)
 
bool hasDepthWrite () const
 
void setDepthWrite (bool enable)
 
CompareOp depthOp () const
 
void setDepthOp (CompareOp op)
 
bool hasStencilTest () const
 
void setStencilTest (bool enable)
 
StencilOpState stencilFront () const
 
void setStencilFront (const StencilOpState &state)
 
StencilOpState stencilBack () const
 
void setStencilBack (const StencilOpState &state)
 
quint32 stencilReadMask () const
 
void setStencilReadMask (quint32 mask)
 
quint32 stencilWriteMask () const
 
void setStencilWriteMask (quint32 mask)
 
int sampleCount () const
 
void setSampleCount (int s)
 
float lineWidth () const
 
void setLineWidth (float width)
 
int depthBias () const
 
void setDepthBias (int bias)
 
float slopeScaledDepthBias () const
 
void setSlopeScaledDepthBias (float bias)
 
void setShaderStages (std::initializer_list< QRhiShaderStage > list)
 
template<typename InputIterator >
void setShaderStages (InputIterator first, InputIterator last)
 
const QRhiShaderStagecbeginShaderStages () const
 
const QRhiShaderStagecendShaderStages () const
 
QRhiVertexInputLayout vertexInputLayout () const
 
void setVertexInputLayout (const QRhiVertexInputLayout &layout)
 
QRhiShaderResourceBindingsshaderResourceBindings () const
 
void setShaderResourceBindings (QRhiShaderResourceBindings *srb)
 
QRhiRenderPassDescriptorrenderPassDescriptor () const
 
void setRenderPassDescriptor (QRhiRenderPassDescriptor *desc)
 
virtual bool create ()=0
 
- Public Member Functions inherited from QRhiResource
virtual ~QRhiResource ()
 
virtual void destroy ()=0
 
void deleteLater ()
 
QByteArray name () const
 
void setName (const QByteArray &name)
 
quint64 globalResourceId () const
 

Protected Member Functions

 QRhiGraphicsPipeline (QRhiImplementation *rhi)
 
- 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
 
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

Definition at line 1098 of file qrhi_p.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 1137 of file qrhi_p.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 1159 of file qrhi_p.h.

◆ ColorMaskComponent

Flag values for specifying the color write mask

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

Enumerator

Definition at line 1129 of file qrhi_p.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 1178 of file qrhi_p.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 1118 of file qrhi_p.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 1101 of file qrhi_p.h.

◆ FrontFace

Specifies the front face winding order

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

Enumerator
CCW 
CW 

Definition at line 1124 of file qrhi_p.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 1189 of file qrhi_p.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

Enumerator
Triangles 
TriangleStrip 
TriangleFan 
Lines 
LineStrip 
Points 

Definition at line 1109 of file qrhi_p.h.

Constructor & Destructor Documentation

◆ QRhiGraphicsPipeline()

QRhiGraphicsPipeline::QRhiGraphicsPipeline ( QRhiImplementation rhi)
protected

Definition at line 4099 of file qrhi.cpp.

Member Function Documentation

◆ cbeginShaderStages()

const QRhiShaderStage* QRhiGraphicsPipeline::cbeginShaderStages ( ) const
inline

Definition at line 1274 of file qrhi_p.h.

Here is the caller graph for this function:

◆ cbeginTargetBlends()

const TargetBlend* QRhiGraphicsPipeline::cbeginTargetBlends ( ) const
inline

Definition at line 1228 of file qrhi_p.h.

◆ cendShaderStages()

const QRhiShaderStage* QRhiGraphicsPipeline::cendShaderStages ( ) const
inline

Definition at line 1275 of file qrhi_p.h.

Here is the caller graph for this function:

◆ cendTargetBlends()

const TargetBlend* QRhiGraphicsPipeline::cendTargetBlends ( ) const
inline

Definition at line 1229 of file qrhi_p.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.

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

◆ cullMode()

CullMode QRhiGraphicsPipeline::cullMode ( ) const
inline

Definition at line 1215 of file qrhi_p.h.

◆ depthBias()

int QRhiGraphicsPipeline::depthBias ( ) const
inline

Definition at line 1261 of file qrhi_p.h.

◆ depthOp()

CompareOp QRhiGraphicsPipeline::depthOp ( ) const
inline

Definition at line 1237 of file qrhi_p.h.

◆ flags()

Flags QRhiGraphicsPipeline::flags ( ) const
inline

Definition at line 1209 of file qrhi_p.h.

◆ frontFace()

FrontFace QRhiGraphicsPipeline::frontFace ( ) const
inline

Definition at line 1218 of file qrhi_p.h.

◆ hasDepthTest()

bool QRhiGraphicsPipeline::hasDepthTest ( ) const
inline

Definition at line 1231 of file qrhi_p.h.

◆ hasDepthWrite()

bool QRhiGraphicsPipeline::hasDepthWrite ( ) const
inline

Definition at line 1234 of file qrhi_p.h.

◆ hasStencilTest()

bool QRhiGraphicsPipeline::hasStencilTest ( ) const
inline

Definition at line 1240 of file qrhi_p.h.

◆ lineWidth()

float QRhiGraphicsPipeline::lineWidth ( ) const
inline

Definition at line 1258 of file qrhi_p.h.

◆ renderPassDescriptor()

QRhiRenderPassDescriptor* QRhiGraphicsPipeline::renderPassDescriptor ( ) const
inline

Definition at line 1283 of file qrhi_p.h.

Here is the caller graph for this function:

◆ resourceType()

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

Implements QRhiResource.

Definition at line 4107 of file qrhi.cpp.

◆ sampleCount()

int QRhiGraphicsPipeline::sampleCount ( ) const
inline

Definition at line 1255 of file qrhi_p.h.

◆ setCullMode()

void QRhiGraphicsPipeline::setCullMode ( CullMode  mode)
inline

Definition at line 1216 of file qrhi_p.h.

◆ setDepthBias()

void QRhiGraphicsPipeline::setDepthBias ( int  bias)
inline

Definition at line 1262 of file qrhi_p.h.

◆ setDepthOp()

void QRhiGraphicsPipeline::setDepthOp ( CompareOp  op)
inline

Definition at line 1238 of file qrhi_p.h.

◆ setDepthTest()

void QRhiGraphicsPipeline::setDepthTest ( bool  enable)
inline

Enables or disables depth testing. Both depth test and the writing out of depth data are disabled by default.

See also
setDepthWrite()

Definition at line 1232 of file qrhi_p.h.

◆ setDepthWrite()

void QRhiGraphicsPipeline::setDepthWrite ( bool  enable)
inline

Controls the writing out of depth data into the depth buffer. 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 1235 of file qrhi_p.h.

◆ setFlags()

void QRhiGraphicsPipeline::setFlags ( Flags  f)
inline

Definition at line 1210 of file qrhi_p.h.

◆ setFrontFace()

void QRhiGraphicsPipeline::setFrontFace ( FrontFace  f)
inline

Definition at line 1219 of file qrhi_p.h.

◆ setLineWidth()

void QRhiGraphicsPipeline::setLineWidth ( float  width)
inline

Definition at line 1259 of file qrhi_p.h.

◆ setRenderPassDescriptor()

void QRhiGraphicsPipeline::setRenderPassDescriptor ( QRhiRenderPassDescriptor desc)
inline

Definition at line 1284 of file qrhi_p.h.

◆ setSampleCount()

void QRhiGraphicsPipeline::setSampleCount ( int  s)
inline

Definition at line 1256 of file qrhi_p.h.

◆ setShaderResourceBindings()

void QRhiGraphicsPipeline::setShaderResourceBindings ( QRhiShaderResourceBindings srb)
inline

Definition at line 1281 of file qrhi_p.h.

◆ setShaderStages() [1/2]

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

Definition at line 1269 of file qrhi_p.h.

◆ setShaderStages() [2/2]

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

Definition at line 1267 of file qrhi_p.h.

◆ setSlopeScaledDepthBias()

void QRhiGraphicsPipeline::setSlopeScaledDepthBias ( float  bias)
inline

Definition at line 1265 of file qrhi_p.h.

◆ setStencilBack()

void QRhiGraphicsPipeline::setStencilBack ( const StencilOpState state)
inline

Definition at line 1247 of file qrhi_p.h.

◆ setStencilFront()

void QRhiGraphicsPipeline::setStencilFront ( const StencilOpState state)
inline

Definition at line 1244 of file qrhi_p.h.

◆ setStencilReadMask()

void QRhiGraphicsPipeline::setStencilReadMask ( quint32  mask)
inline

Definition at line 1250 of file qrhi_p.h.

◆ setStencilTest()

void QRhiGraphicsPipeline::setStencilTest ( bool  enable)
inline

Definition at line 1241 of file qrhi_p.h.

◆ setStencilWriteMask()

void QRhiGraphicsPipeline::setStencilWriteMask ( quint32  mask)
inline

Definition at line 1253 of file qrhi_p.h.

◆ setTargetBlends() [1/2]

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

Definition at line 1223 of file qrhi_p.h.

◆ setTargetBlends() [2/2]

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

Definition at line 1221 of file qrhi_p.h.

◆ setTopology()

void QRhiGraphicsPipeline::setTopology ( Topology  t)
inline

Definition at line 1213 of file qrhi_p.h.

◆ setVertexInputLayout()

void QRhiGraphicsPipeline::setVertexInputLayout ( const QRhiVertexInputLayout layout)
inline

Definition at line 1278 of file qrhi_p.h.

◆ shaderResourceBindings()

QRhiShaderResourceBindings* QRhiGraphicsPipeline::shaderResourceBindings ( ) const
inline

Definition at line 1280 of file qrhi_p.h.

Here is the caller graph for this function:

◆ slopeScaledDepthBias()

float QRhiGraphicsPipeline::slopeScaledDepthBias ( ) const
inline

Definition at line 1264 of file qrhi_p.h.

◆ stencilBack()

StencilOpState QRhiGraphicsPipeline::stencilBack ( ) const
inline

Definition at line 1246 of file qrhi_p.h.

◆ stencilFront()

StencilOpState QRhiGraphicsPipeline::stencilFront ( ) const
inline

Definition at line 1243 of file qrhi_p.h.

◆ stencilReadMask()

quint32 QRhiGraphicsPipeline::stencilReadMask ( ) const
inline

Definition at line 1249 of file qrhi_p.h.

◆ stencilWriteMask()

quint32 QRhiGraphicsPipeline::stencilWriteMask ( ) const
inline

Definition at line 1252 of file qrhi_p.h.

◆ topology()

Topology QRhiGraphicsPipeline::topology ( ) const
inline

Definition at line 1212 of file qrhi_p.h.

◆ vertexInputLayout()

QRhiVertexInputLayout QRhiGraphicsPipeline::vertexInputLayout ( ) const
inline

Definition at line 1277 of file qrhi_p.h.

Member Data Documentation

◆ m_cullMode

CullMode QRhiGraphicsPipeline::m_cullMode = None
protected

Definition at line 1292 of file qrhi_p.h.

◆ m_depthBias

int QRhiGraphicsPipeline::m_depthBias = 0
protected

Definition at line 1305 of file qrhi_p.h.

◆ m_depthOp

CompareOp QRhiGraphicsPipeline::m_depthOp = Less
protected

Definition at line 1297 of file qrhi_p.h.

◆ m_depthTest

bool QRhiGraphicsPipeline::m_depthTest = false
protected

Definition at line 1295 of file qrhi_p.h.

◆ m_depthWrite

bool QRhiGraphicsPipeline::m_depthWrite = false
protected

Definition at line 1296 of file qrhi_p.h.

◆ m_flags

Flags QRhiGraphicsPipeline::m_flags
protected

Definition at line 1290 of file qrhi_p.h.

◆ m_frontFace

FrontFace QRhiGraphicsPipeline::m_frontFace = CCW
protected

Definition at line 1293 of file qrhi_p.h.

◆ m_lineWidth

float QRhiGraphicsPipeline::m_lineWidth = 1.0f
protected

Definition at line 1304 of file qrhi_p.h.

◆ m_renderPassDesc

QRhiRenderPassDescriptor* QRhiGraphicsPipeline::m_renderPassDesc = nullptr
protected

Definition at line 1310 of file qrhi_p.h.

◆ m_sampleCount

int QRhiGraphicsPipeline::m_sampleCount = 1
protected

Definition at line 1303 of file qrhi_p.h.

◆ m_shaderResourceBindings

QRhiShaderResourceBindings* QRhiGraphicsPipeline::m_shaderResourceBindings = nullptr
protected

Definition at line 1309 of file qrhi_p.h.

◆ m_shaderStages

QVarLengthArray<QRhiShaderStage, 4> QRhiGraphicsPipeline::m_shaderStages
protected

Definition at line 1307 of file qrhi_p.h.

◆ m_slopeScaledDepthBias

float QRhiGraphicsPipeline::m_slopeScaledDepthBias = 0.0f
protected

Definition at line 1306 of file qrhi_p.h.

◆ m_stencilBack

StencilOpState QRhiGraphicsPipeline::m_stencilBack
protected

Definition at line 1300 of file qrhi_p.h.

◆ m_stencilFront

StencilOpState QRhiGraphicsPipeline::m_stencilFront
protected

Definition at line 1299 of file qrhi_p.h.

◆ m_stencilReadMask

quint32 QRhiGraphicsPipeline::m_stencilReadMask = 0xFF
protected

Definition at line 1301 of file qrhi_p.h.

◆ m_stencilTest

bool QRhiGraphicsPipeline::m_stencilTest = false
protected

Definition at line 1298 of file qrhi_p.h.

◆ m_stencilWriteMask

quint32 QRhiGraphicsPipeline::m_stencilWriteMask = 0xFF
protected

Definition at line 1302 of file qrhi_p.h.

◆ m_targetBlends

QVarLengthArray<TargetBlend, 8> QRhiGraphicsPipeline::m_targetBlends
protected

Definition at line 1294 of file qrhi_p.h.

◆ m_topology

Topology QRhiGraphicsPipeline::m_topology = Triangles
protected

Definition at line 1291 of file qrhi_p.h.

◆ m_vertexInputLayout

QRhiVertexInputLayout QRhiGraphicsPipeline::m_vertexInputLayout
protected

Definition at line 1308 of file qrhi_p.h.


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