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

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

Enumerations

enum  BatchCompatibility { BatchBreaksOnCompare , BatchIsCompatible }

Functions

static int size_of_type (int type)
bool qsg_sort_element_increasing_order (Element *a, Element *b)
bool qsg_sort_element_decreasing_order (Element *a, Element *b)
bool qsg_sort_batch_increasing_order (Batch *a, Batch *b)
bool qsg_sort_batch_decreasing_order (Batch *a, Batch *b)
static bool isTranslate (const QMatrix4x4 &m)
static bool isScale (const QMatrix4x4 &m)
static bool is2DSafe (const QMatrix4x4 &m)
template<class Int>
Int aligned (Int v, Int byteAlign)
QRhiVertexInputAttribute::Format qsg_vertexInputFormat (const QSGGeometry::Attribute &a)
static QRhiVertexInputLayout calculateVertexInputLayout (const QSGMaterialShader *s, 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 *n)
int qsg_positionAttribute (QSGGeometry *g)
static int qsg_countNodesInBatch (const Batch *batch)
static int qsg_countNodesInBatches (const QDataBuffer< Batch * > &batches)
static void qsg_wipeBuffer (Buffer *buffer)
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 f)
static QRhiSamplernewSampler (QRhi *rhi, const QSGSamplerDescription &desc)
static void rendererToMaterialGraphicsState (QSGMaterialShader::GraphicsPipelineState *dst, GraphicsState *src)
static void materialToRendererGraphicsState (GraphicsState *dst, QSGMaterialShader::GraphicsPipelineState *src)
bool operator== (const GraphicsState &a, const GraphicsState &b) noexcept
bool operator!= (const GraphicsState &a, const GraphicsState &b) noexcept
size_t qHash (const GraphicsState &s, size_t seed) noexcept
bool operator== (const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) noexcept
bool operator!= (const GraphicsPipelineStateKey &a, const GraphicsPipelineStateKey &b) noexcept
size_t qHash (const GraphicsPipelineStateKey &k, size_t seed) noexcept
bool operator== (const ShaderKey &a, const ShaderKey &b) noexcept
bool operator!= (const ShaderKey &a, const ShaderKey &b) noexcept
size_t qHash (const ShaderKey &k, size_t seed) noexcept
bool hasMaterialWithBlending (QSGGeometryNode *n)
QDebug operator<< (QDebug d, const Pt &p)
QDebug operator<< (QDebug d, const Rect &r)
static void fillVertexIndex (RhiVisualizer::DrawCall *dc, QSGGeometry *g, bool withData, bool forceUintIndex, QRhi *rhi)
static uint aligned (uint v, uint byteAlign)
static bool ensureBuffer (QRhi *rhi, QRhiBuffer **buf, QRhiBuffer::UsageFlags usage, 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 QRhiShaderResourceBinding::StageFlags ubufVisibility

Enumeration Type Documentation

◆ BatchCompatibility

Enumerator
BatchBreaksOnCompare 
BatchIsCompatible 

Definition at line 356 of file qsgbatchrenderer_p.h.

Function Documentation

◆ aligned() [1/2]

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

Definition at line 90 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 123 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 181 of file qsgbatchrenderer_p.h.

◆ is2DSafe()

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

Definition at line 76 of file qsgbatchrenderer.cpp.

◆ isScale()

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

Definition at line 75 of file qsgbatchrenderer.cpp.

◆ isTranslate()

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

Definition at line 74 of file qsgbatchrenderer.cpp.

◆ materialToRendererGraphicsState()

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

Definition at line 2940 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::GraphicsState::blending.

◆ needsBlendConstant()

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

Definition at line 2687 of file qsgbatchrenderer.cpp.

◆ newSampler()

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

Definition at line 2817 of file qsgbatchrenderer.cpp.

◆ operator!=() [1/3]

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

Definition at line 4274 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 4245 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 4294 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 205 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 4266 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 4287 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 4279 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 4299 of file qsgbatchrenderer.cpp.

◆ qsg_addBackOrphanedElements()

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

Definition at line 1599 of file qsgbatchrenderer.cpp.

◆ qsg_addOrphanedElements()

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

Definition at line 1587 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 841 of file qsgbatchrenderer.cpp.

◆ qsg_dumpShadowRoots() [1/2]

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

Definition at line 317 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 338 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 1944 of file qsgbatchrenderer.cpp.

◆ qsg_indexFormat()

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

Definition at line 163 of file qsgbatchrenderer.cpp.

◆ qsg_matrixForRoot()

QMatrix4x4 QSGBatchRenderer::qsg_matrixForRoot ( Node * node)

Definition at line 2086 of file qsgbatchrenderer.cpp.

◆ qsg_positionAttribute()

int QSGBatchRenderer::qsg_positionAttribute ( QSGGeometry * g)

Definition at line 628 of file qsgbatchrenderer.cpp.

◆ qsg_setMultiViewFlagsOnMaterial()

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

Definition at line 217 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 68 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 67 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::Element::order.

◆ qsg_topology()

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

Definition at line 177 of file qsgbatchrenderer.cpp.

◆ qsg_vertexInputFormat()

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

Definition at line 95 of file qsgbatchrenderer.cpp.

◆ qsg_wipeBatch()

void QSGBatchRenderer::qsg_wipeBatch ( Batch * batch)
static

Definition at line 934 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::Batch::ubuf.

◆ qsg_wipeBuffer()

void QSGBatchRenderer::qsg_wipeBuffer ( Buffer * buffer)
static

◆ rendererToMaterialGraphicsState()

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

Definition at line 2906 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::GraphicsState::blending.

◆ size_of_type()

int QSGBatchRenderer::size_of_type ( int type)
inlinestatic

Definition at line 48 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 87 of file qsgbatchrenderer.cpp.

◆ DYNAMIC_VERTEX_INDEX_BUFFER_THRESHOLD

const uint QSGBatchRenderer::DYNAMIC_VERTEX_INDEX_BUFFER_THRESHOLD = 4

Definition at line 80 of file qsgbatchrenderer.cpp.

◆ OPAQUE_LIMIT

const float QSGBatchRenderer::OPAQUE_LIMIT = 0.999f

Definition at line 78 of file qsgbatchrenderer.cpp.

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

◆ QSGMaterial_FullMatrix

◆ ubufVisibility

const QRhiShaderResourceBinding::StageFlags QSGBatchRenderer::ubufVisibility

◆ VERTEX_BUFFER_BINDING

const int QSGBatchRenderer::VERTEX_BUFFER_BINDING = 0

Definition at line 81 of file qsgbatchrenderer.cpp.

Referenced by calculateVertexInputLayout().

◆ VIEWPORT_MAX_DEPTH

const float QSGBatchRenderer::VIEWPORT_MAX_DEPTH = 1.0f

Definition at line 85 of file qsgbatchrenderer.cpp.

Referenced by calculateElementZOrder().

◆ VIEWPORT_MIN_DEPTH

const float QSGBatchRenderer::VIEWPORT_MIN_DEPTH = 0.0f

Definition at line 84 of file qsgbatchrenderer.cpp.

Referenced by calculateElementZOrder().

◆ ZORDER_BUFFER_BINDING

const int QSGBatchRenderer::ZORDER_BUFFER_BINDING = VERTEX_BUFFER_BINDING + 1

Definition at line 82 of file qsgbatchrenderer.cpp.

Referenced by calculateVertexInputLayout().