Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QSGBatchRenderer Namespace Reference

Classes

class  Allocator
class  AllocatorPage
struct  Batch
struct  BatchRootInfo
struct  Buffer
struct  ClipBatchRootInfo
struct  ClipState
struct  DrawSet
struct  Element
struct  ElementPreparedState
struct  GraphicsPipelineStateKey
struct  GraphicsState
struct  Node
struct  Pt
struct  Rect
class  Renderer
struct  RenderNodeElement
struct  RenderNodeState
struct  RenderPassState
class  RhiVisualizer
struct  ShaderKey
class  ShaderManager
struct  ShaderManagerShader
struct  StencilClipState
class  Updater
class  Visualizer

Enumerations

enum  BatchCompatibility { BatchBreaksOnCompare , BatchIsCompatible }

Functions

static int size_of_type (int typetype)
bool qsg_sort_element_increasing_order (Element *aa, Element *bb)
bool qsg_sort_element_decreasing_order (Element *aa, Element *bb)
bool qsg_sort_batch_increasing_order (Batch *aa, Batch *bb)
bool qsg_sort_batch_decreasing_order (Batch *aa, Batch *bb)
static bool isTranslate (const QMatrix4x4 &mm)
static bool isScale (const QMatrix4x4 &mm)
static bool is2DSafe (const QMatrix4x4 &mm)
template<class Int>
Int aligned (Int vv, Int byteAlign)
QRhiVertexInputAttribute::Format qsg_vertexInputFormat (const QSGGeometry::Attribute &aa)
static QRhiVertexInputLayout calculateVertexInputLayout (const QSGMaterialShader *ss, const QSGGeometry *geometry, bool batchable)
QRhiCommandBuffer::IndexFormat qsg_indexFormat (const QSGGeometry *geometry)
QRhiGraphicsPipeline::Topology qsg_topology (int geomDrawMode, QRhi *rhi)
void qsg_setMultiViewFlagsOnMaterial (QSGMaterial *material, int multiViewCount)
void qsg_dumpShadowRoots (BatchRootInfo *i, int indent)
void qsg_dumpShadowRoots (Node *nn)
int qsg_positionAttribute (QSGGeometry *gg)
static int qsg_countNodesInBatch (const Batch *batch)
static int qsg_countNodesInBatches (const QDataBuffer< Batch * > &batches)
static void qsg_wipeBuffer (Buffer *bufferbuffer)
static void qsg_wipeBatch (Batch *batch)
static void qsg_addOrphanedElements (QDataBuffer< Element * > &orphans, const QDataBuffer< Element * > &renderList)
static void qsg_addBackOrphanedElements (QDataBuffer< Element * > &orphans, QDataBuffer< Element * > &renderList)
static int qsg_fixIndexCount (int iCount, int drawMode)
static float calculateElementZOrder (const Element *e, qreal zRange)
QMatrix4x4 qsg_matrixForRoot (Node *node)
static bool needsBlendConstant (QRhiGraphicsPipeline::BlendFactor ff)
static QRhiSampler * newSampler (QRhi *rhi, const QSGSamplerDescription &desc)
static void rendererToMaterialGraphicsState (QSGMaterialShader::GraphicsPipelineState *dstdst, GraphicsState *srcsrc)
static void materialToRendererGraphicsState (GraphicsState *dstdst, QSGMaterialShader::GraphicsPipelineState *srcsrc)
bool operator== (const GraphicsState &aa, const GraphicsState &bb) noexcept
bool operator!= (const GraphicsState &aa, const GraphicsState &bb) noexcept
size_t qHash (const GraphicsState &ss, size_t seed) noexcept
bool operator== (const GraphicsPipelineStateKey &aa, const GraphicsPipelineStateKey &bb) noexcept
bool operator!= (const GraphicsPipelineStateKey &aa, const GraphicsPipelineStateKey &bb) noexcept
size_t qHash (const GraphicsPipelineStateKey &k, size_t seed) noexcept
bool operator== (const ShaderKey &aa, const ShaderKey &bb) noexcept
bool operator!= (const ShaderKey &aa, const ShaderKey &bb) noexcept
size_t qHash (const ShaderKey &k, size_t seed) noexcept
bool hasMaterialWithBlending (QSGGeometryNode *nn)
QDebug operator<< (QDebug d, const Pt &pp)
QDebug operator<< (QDebug d, const Rect &rr)
static void fillVertexIndex (RhiVisualizer::DrawCall *dc, QSGGeometry *gg, bool withData, bool forceUintIndex, QRhi *rhi)
static uint aligned (uint vv, uint byteAlign)
static bool ensureBuffer (QRhi *rhi, QRhiBuffer **bufbuf, QRhiBuffer::UsageFlags usageusage, quint32 newSize)

Variables

QSGMaterial::Flag QSGMaterial_FullMatrix = (QSGMaterial::Flag) (QSGMaterial::RequiresFullMatrix & ~QSGMaterial::RequiresFullMatrixExceptTranslate)
const float OPAQUE_LIMIT = 0.999f
const uint DYNAMIC_VERTEX_INDEX_BUFFER_THRESHOLD = 4
const int VERTEX_BUFFER_BINDING = 0
const int ZORDER_BUFFER_BINDING = VERTEX_BUFFER_BINDING + 1
const float VIEWPORT_MIN_DEPTH = 0.0f
const float VIEWPORT_MAX_DEPTH = 1.0f
const quint32 DEFAULT_BUFFER_POOL_SIZE_LIMIT = 2 * 1024 * 1024
const quint32 MIN_UNIFORM_BUFFER_SIZE = 4096
const int UNIFORM_BUFFER_SHRINK_FRAMES = 300
const QRhiShaderResourceBinding::StageFlags ubufVisibility

Enumeration Type Documentation

◆ BatchCompatibility

Enumerator
BatchBreaksOnCompare 
BatchIsCompatible 

Definition at line 369 of file qsgbatchrenderer_p.h.

Function Documentation

◆ aligned() [1/2]

template<class Int>
Int QSGBatchRenderer::aligned ( Int v,
Int byteAlign )
inline

Definition at line 96 of file qsgbatchrenderer.cpp.

◆ aligned() [2/2]

uint QSGBatchRenderer::aligned ( uint v,
uint byteAlign )
inlinestatic

Definition at line 251 of file qsgrhivisualizer.cpp.

◆ calculateElementZOrder()

float QSGBatchRenderer::calculateElementZOrder ( const Element * e,
qreal zRange )
inlinestatic

◆ calculateVertexInputLayout()

QRhiVertexInputLayout QSGBatchRenderer::calculateVertexInputLayout ( const QSGMaterialShader * s,
const QSGGeometry * geometry,
bool batchable )
static

Definition at line 129 of file qsgbatchrenderer.cpp.

References VERTEX_BUFFER_BINDING, and ZORDER_BUFFER_BINDING.

◆ ensureBuffer()

bool QSGBatchRenderer::ensureBuffer ( QRhi * rhi,
QRhiBuffer ** buf,
QRhiBuffer::UsageFlags usage,
quint32 newSize )
static

Definition at line 256 of file qsgrhivisualizer.cpp.

◆ fillVertexIndex()

void QSGBatchRenderer::fillVertexIndex ( RhiVisualizer::DrawCall * dc,
QSGGeometry * g,
bool withData,
bool forceUintIndex,
QRhi * rhi )
static

Definition at line 235 of file qsgrhivisualizer.cpp.

◆ hasMaterialWithBlending()

bool QSGBatchRenderer::hasMaterialWithBlending ( QSGGeometryNode * n)
inline

Definition at line 187 of file qsgbatchrenderer_p.h.

◆ is2DSafe()

bool QSGBatchRenderer::is2DSafe ( const QMatrix4x4 & m)
static

Definition at line 79 of file qsgbatchrenderer.cpp.

◆ isScale()

bool QSGBatchRenderer::isScale ( const QMatrix4x4 & m)
static

Definition at line 78 of file qsgbatchrenderer.cpp.

◆ isTranslate()

bool QSGBatchRenderer::isTranslate ( const QMatrix4x4 & m)
static

Definition at line 77 of file qsgbatchrenderer.cpp.

◆ materialToRendererGraphicsState()

void QSGBatchRenderer::materialToRendererGraphicsState ( GraphicsState * dst,
QSGMaterialShader::GraphicsPipelineState * src )
static

Definition at line 3034 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::GraphicsState::blending.

◆ needsBlendConstant()

bool QSGBatchRenderer::needsBlendConstant ( QRhiGraphicsPipeline::BlendFactor f)
inlinestatic

Definition at line 2741 of file qsgbatchrenderer.cpp.

◆ newSampler()

QRhiSampler * QSGBatchRenderer::newSampler ( QRhi * rhi,
const QSGSamplerDescription & desc )
static

Definition at line 2911 of file qsgbatchrenderer.cpp.

◆ operator!=() [1/3]

bool QSGBatchRenderer::operator!= ( const GraphicsPipelineStateKey & a,
const GraphicsPipelineStateKey & b )
noexcept

Definition at line 4452 of file qsgbatchrenderer.cpp.

References operator==().

Here is the call graph for this function:

◆ operator!=() [2/3]

bool QSGBatchRenderer::operator!= ( const GraphicsState & a,
const GraphicsState & b )
noexcept

Definition at line 4423 of file qsgbatchrenderer.cpp.

References operator==().

Here is the call graph for this function:

◆ operator!=() [3/3]

bool QSGBatchRenderer::operator!= ( const ShaderKey & a,
const ShaderKey & b )
noexcept

Definition at line 4472 of file qsgbatchrenderer.cpp.

References operator==().

Here is the call graph for this function:

◆ operator<<() [1/2]

QDebug QSGBatchRenderer::operator<< ( QDebug d,
const Pt & p )
inline

Definition at line 211 of file qsgbatchrenderer_p.h.

References QSGBatchRenderer::Pt::x, and QSGBatchRenderer::Pt::y.

◆ operator<<() [2/2]

QDebug QSGBatchRenderer::operator<< ( QDebug d,
const Rect & r )
inline

◆ operator==() [1/3]

bool QSGBatchRenderer::operator== ( const GraphicsPipelineStateKey & a,
const GraphicsPipelineStateKey & b )
noexcept

Definition at line 4444 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::GraphicsPipelineStateKey::sms.

Referenced by operator!=().

Here is the caller graph for this function:

◆ operator==() [2/3]

bool QSGBatchRenderer::operator== ( const GraphicsState & a,
const GraphicsState & b )
noexcept

◆ operator==() [3/3]

bool QSGBatchRenderer::operator== ( const ShaderKey & a,
const ShaderKey & b )
noexcept

Definition at line 4465 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::ShaderKey::multiViewCount.

Referenced by operator!=().

Here is the caller graph for this function:

◆ qHash() [1/3]

size_t QSGBatchRenderer::qHash ( const GraphicsPipelineStateKey & k,
size_t seed = 0 )
noexcept

Definition at line 4457 of file qsgbatchrenderer.cpp.

◆ qHash() [2/3]

◆ qHash() [3/3]

size_t QSGBatchRenderer::qHash ( const ShaderKey & k,
size_t seed = 0 )
noexcept

Definition at line 4477 of file qsgbatchrenderer.cpp.

◆ qsg_addBackOrphanedElements()

void QSGBatchRenderer::qsg_addBackOrphanedElements ( QDataBuffer< Element * > & orphans,
QDataBuffer< Element * > & renderList )
static

Definition at line 1651 of file qsgbatchrenderer.cpp.

◆ qsg_addOrphanedElements()

void QSGBatchRenderer::qsg_addOrphanedElements ( QDataBuffer< Element * > & orphans,
const QDataBuffer< Element * > & renderList )
static

Definition at line 1639 of file qsgbatchrenderer.cpp.

◆ qsg_countNodesInBatch()

int QSGBatchRenderer::qsg_countNodesInBatch ( const Batch * batch)
static

◆ qsg_countNodesInBatches()

int QSGBatchRenderer::qsg_countNodesInBatches ( const QDataBuffer< Batch * > & batches)
static

Definition at line 863 of file qsgbatchrenderer.cpp.

◆ qsg_dumpShadowRoots() [1/2]

void QSGBatchRenderer::qsg_dumpShadowRoots ( BatchRootInfo * i,
int indent )

Definition at line 324 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::BatchRootInfo::availableOrders, QSGBatchRenderer::BatchRootInfo::firstOrder, QSGBatchRenderer::BatchRootInfo::lastOrder, and QSGBatchRenderer::BatchRootInfo::parentRoot.

Referenced by qsg_dumpShadowRoots().

Here is the caller graph for this function:

◆ qsg_dumpShadowRoots() [2/2]

void QSGBatchRenderer::qsg_dumpShadowRoots ( Node * n)

Definition at line 345 of file qsgbatchrenderer.cpp.

References operator<<(), qsg_dumpShadowRoots(), qsg_dumpShadowRoots(), and QSGBatchRenderer::Node::rootInfo().

Referenced by qsg_dumpShadowRoots(), and QSGBatchRenderer::Updater::updateStates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ qsg_fixIndexCount()

int QSGBatchRenderer::qsg_fixIndexCount ( int iCount,
int drawMode )
inlinestatic

Definition at line 1998 of file qsgbatchrenderer.cpp.

◆ qsg_indexFormat()

QRhiCommandBuffer::IndexFormat QSGBatchRenderer::qsg_indexFormat ( const QSGGeometry * geometry)

Definition at line 169 of file qsgbatchrenderer.cpp.

◆ qsg_matrixForRoot()

QMatrix4x4 QSGBatchRenderer::qsg_matrixForRoot ( Node * node)

Definition at line 2140 of file qsgbatchrenderer.cpp.

◆ qsg_positionAttribute()

int QSGBatchRenderer::qsg_positionAttribute ( QSGGeometry * g)

Definition at line 635 of file qsgbatchrenderer.cpp.

◆ qsg_setMultiViewFlagsOnMaterial()

void QSGBatchRenderer::qsg_setMultiViewFlagsOnMaterial ( QSGMaterial * material,
int multiViewCount )

Definition at line 223 of file qsgbatchrenderer.cpp.

Referenced by QSGBatchRenderer::ShaderManager::prepareMaterial(), and QSGBatchRenderer::ShaderManager::prepareMaterialNoRewrite().

Here is the caller graph for this function:

◆ qsg_sort_batch_decreasing_order()

bool QSGBatchRenderer::qsg_sort_batch_decreasing_order ( Batch * a,
Batch * b )

◆ qsg_sort_batch_increasing_order()

bool QSGBatchRenderer::qsg_sort_batch_increasing_order ( Batch * a,
Batch * b )

◆ qsg_sort_element_decreasing_order()

bool QSGBatchRenderer::qsg_sort_element_decreasing_order ( Element * a,
Element * b )

Definition at line 71 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::Element::order.

◆ qsg_sort_element_increasing_order()

bool QSGBatchRenderer::qsg_sort_element_increasing_order ( Element * a,
Element * b )

Definition at line 70 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::Element::order.

◆ qsg_topology()

QRhiGraphicsPipeline::Topology QSGBatchRenderer::qsg_topology ( int geomDrawMode,
QRhi * rhi )

Definition at line 183 of file qsgbatchrenderer.cpp.

◆ qsg_vertexInputFormat()

QRhiVertexInputAttribute::Format QSGBatchRenderer::qsg_vertexInputFormat ( const QSGGeometry::Attribute & a)

Definition at line 101 of file qsgbatchrenderer.cpp.

◆ qsg_wipeBatch()

void QSGBatchRenderer::qsg_wipeBatch ( Batch * batch)
static

Definition at line 956 of file qsgbatchrenderer.cpp.

◆ qsg_wipeBuffer()

void QSGBatchRenderer::qsg_wipeBuffer ( Buffer * buffer)
static

◆ rendererToMaterialGraphicsState()

void QSGBatchRenderer::rendererToMaterialGraphicsState ( QSGMaterialShader::GraphicsPipelineState * dst,
GraphicsState * src )
static

Definition at line 3000 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::GraphicsState::blending.

◆ size_of_type()

int QSGBatchRenderer::size_of_type ( int type)
inlinestatic

Definition at line 51 of file qsgbatchrenderer.cpp.

Variable Documentation

◆ DEFAULT_BUFFER_POOL_SIZE_LIMIT

const quint32 QSGBatchRenderer::DEFAULT_BUFFER_POOL_SIZE_LIMIT = 2 * 1024 * 1024

Definition at line 90 of file qsgbatchrenderer.cpp.

◆ DYNAMIC_VERTEX_INDEX_BUFFER_THRESHOLD

const uint QSGBatchRenderer::DYNAMIC_VERTEX_INDEX_BUFFER_THRESHOLD = 4

Definition at line 83 of file qsgbatchrenderer.cpp.

◆ MIN_UNIFORM_BUFFER_SIZE

const quint32 QSGBatchRenderer::MIN_UNIFORM_BUFFER_SIZE = 4096

Definition at line 92 of file qsgbatchrenderer.cpp.

◆ OPAQUE_LIMIT

const float QSGBatchRenderer::OPAQUE_LIMIT = 0.999f

Definition at line 81 of file qsgbatchrenderer.cpp.

Referenced by QSGBatchRenderer::Updater::visitOpacityNode().

◆ QSGMaterial_FullMatrix

◆ ubufVisibility

const QRhiShaderResourceBinding::StageFlags QSGBatchRenderer::ubufVisibility

◆ UNIFORM_BUFFER_SHRINK_FRAMES

const int QSGBatchRenderer::UNIFORM_BUFFER_SHRINK_FRAMES = 300

Definition at line 93 of file qsgbatchrenderer.cpp.

◆ VERTEX_BUFFER_BINDING

const int QSGBatchRenderer::VERTEX_BUFFER_BINDING = 0

Definition at line 84 of file qsgbatchrenderer.cpp.

Referenced by calculateVertexInputLayout().

◆ VIEWPORT_MAX_DEPTH

const float QSGBatchRenderer::VIEWPORT_MAX_DEPTH = 1.0f

Definition at line 88 of file qsgbatchrenderer.cpp.

Referenced by calculateElementZOrder().

◆ VIEWPORT_MIN_DEPTH

const float QSGBatchRenderer::VIEWPORT_MIN_DEPTH = 0.0f

Definition at line 87 of file qsgbatchrenderer.cpp.

Referenced by calculateElementZOrder().

◆ ZORDER_BUFFER_BINDING

const int QSGBatchRenderer::ZORDER_BUFFER_BINDING = VERTEX_BUFFER_BINDING + 1

Definition at line 85 of file qsgbatchrenderer.cpp.

Referenced by calculateVertexInputLayout().