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  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 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 355 of file qsgbatchrenderer_p.h.

Function Documentation

◆ aligned() [1/2]

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

Definition at line 89 of file qsgbatchrenderer.cpp.

◆ aligned() [2/2]

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

Definition at line 250 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 122 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 255 of file qsgrhivisualizer.cpp.

◆ fillVertexIndex()

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

Definition at line 234 of file qsgrhivisualizer.cpp.

◆ hasMaterialWithBlending()

bool QSGBatchRenderer::hasMaterialWithBlending ( QSGGeometryNode * n)
inline

Definition at line 180 of file qsgbatchrenderer_p.h.

◆ is2DSafe()

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

Definition at line 75 of file qsgbatchrenderer.cpp.

◆ isScale()

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

Definition at line 74 of file qsgbatchrenderer.cpp.

◆ isTranslate()

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

Definition at line 73 of file qsgbatchrenderer.cpp.

◆ materialToRendererGraphicsState()

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

Definition at line 2939 of file qsgbatchrenderer.cpp.

References QSGBatchRenderer::GraphicsState::blending.

◆ needsBlendConstant()

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

Definition at line 2686 of file qsgbatchrenderer.cpp.

◆ newSampler()

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

Definition at line 2816 of file qsgbatchrenderer.cpp.

◆ operator!=() [1/3]

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

Definition at line 4273 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 4244 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 4293 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 204 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 4265 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 4286 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 4278 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 4298 of file qsgbatchrenderer.cpp.

◆ qsg_addBackOrphanedElements()

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

Definition at line 1598 of file qsgbatchrenderer.cpp.

◆ qsg_addOrphanedElements()

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

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

◆ qsg_dumpShadowRoots() [1/2]

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

Definition at line 316 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 337 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 1943 of file qsgbatchrenderer.cpp.

◆ qsg_indexFormat()

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

Definition at line 162 of file qsgbatchrenderer.cpp.

◆ qsg_matrixForRoot()

QMatrix4x4 QSGBatchRenderer::qsg_matrixForRoot ( Node * node)

Definition at line 2085 of file qsgbatchrenderer.cpp.

◆ qsg_positionAttribute()

int QSGBatchRenderer::qsg_positionAttribute ( QSGGeometry * g)

Definition at line 627 of file qsgbatchrenderer.cpp.

◆ qsg_setMultiViewFlagsOnMaterial()

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

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

References QSGBatchRenderer::Element::order.

◆ qsg_topology()

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

Definition at line 176 of file qsgbatchrenderer.cpp.

◆ qsg_vertexInputFormat()

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

Definition at line 94 of file qsgbatchrenderer.cpp.

◆ qsg_wipeBatch()

void QSGBatchRenderer::qsg_wipeBatch ( Batch * batch)
static

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

References QSGBatchRenderer::GraphicsState::blending.

◆ size_of_type()

int QSGBatchRenderer::size_of_type ( int type)
inlinestatic

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

◆ DYNAMIC_VERTEX_INDEX_BUFFER_THRESHOLD

const uint QSGBatchRenderer::DYNAMIC_VERTEX_INDEX_BUFFER_THRESHOLD = 4

Definition at line 79 of file qsgbatchrenderer.cpp.

◆ OPAQUE_LIMIT

const float QSGBatchRenderer::OPAQUE_LIMIT = 0.999f

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

Referenced by calculateVertexInputLayout().

◆ VIEWPORT_MAX_DEPTH

const float QSGBatchRenderer::VIEWPORT_MAX_DEPTH = 1.0f

Definition at line 84 of file qsgbatchrenderer.cpp.

Referenced by calculateElementZOrder().

◆ VIEWPORT_MIN_DEPTH

const float QSGBatchRenderer::VIEWPORT_MIN_DEPTH = 0.0f

Definition at line 83 of file qsgbatchrenderer.cpp.

Referenced by calculateElementZOrder().

◆ ZORDER_BUFFER_BINDING

const int QSGBatchRenderer::ZORDER_BUFFER_BINDING = VERTEX_BUFFER_BINDING + 1

Definition at line 81 of file qsgbatchrenderer.cpp.

Referenced by calculateVertexInputLayout().