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
qssglayerrenderdata.cpp File Reference

(8ac5a6c77913764fe1fe70d3243f9d33576b0f41)

#include "qssglayerrenderdata_p.h"
#include <QtQuick3DRuntimeRender/private/qssgrenderer_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrenderlight_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrhicustommaterialsystem_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrhiquadrenderer_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrhiparticles_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrenderlayer_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrendereffect_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrendercamera_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrenderskeleton_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrenderjoint_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrendermorphtarget_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrenderparticles_p.h>
#include "../graphobjects/qssgrenderroot_p.h"
#include "../qssgrendercontextcore.h"
#include <QtQuick3DRuntimeRender/private/qssgrenderbuffermanager_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrendershadercache_p.h>
#include <QtQuick3DRuntimeRender/private/qssgperframeallocator_p.h>
#include <QtQuick3DRuntimeRender/private/qssgruntimerenderlogging_p.h>
#include <QtQuick3DRuntimeRender/private/qssglightmapper_p.h>
#include <QtQuick3DRuntimeRender/private/qssgdebugdrawsystem_p.h>
#include <QtQuick3DRuntimeRender/private/qssgshadermaterialadapter_p.h>
#include <QtQuick3DUtils/private/qssgutils_p.h>
#include <QtQuick3DUtils/private/qssgassert_p.h>
#include <QtQuick/private/qsgtexture_p.h>
#include <QtQuick/private/qsgrenderer_p.h>
#include <array>
#include "qssgrenderpass_p.h"
#include "rendererimpl/qssgrenderhelpers_p.h"
Include dependency graph for qssglayerrenderdata.cpp:

Go to the source code of this file.

Classes

struct  LayerNodeStatResult

Macros

#define POS4BONETRANS(x)
#define POS4BONENORM(x)
#define BONEDATASIZE4ID(x)
#define MAX_MORPH_TARGET   8
#define MAX_MORPH_TARGET_INDEX_SUPPORTS_NORMALS   3
#define MAX_MORPH_TARGET_INDEX_SUPPORTS_TANGENTS   1
#define CHECK_IMAGE_AND_PREPARE(img, imgtype, shadercomponent)

Functions

QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY (lcQuick3DRender, "qt.quick3d.render")
static bool checkParticleSupport (QRhi *rhi)
static LayerNodeStatResult statLayerNodes (const QSSGLayerRenderData::LayerNodes &layerNodes, quint32 layerMask)
static constexpr bool nearestToFurthestCompare (const QSSGRenderableObjectHandle &lhs, const QSSGRenderableObjectHandle &rhs) noexcept
static constexpr bool furthestToNearestCompare (const QSSGRenderableObjectHandle &lhs, const QSSGRenderableObjectHandle &rhs) noexcept
static void collectBoneTransforms (const QSSGLayerRenderData &renderData, QSSGRenderNode *node, QSSGRenderSkeleton *skeletonNode, const QVector< QMatrix4x4 > &poses)
static bool hasDirtyNonJointNodes (QSSGRenderNode *node, bool &hasChildJoints)
static float getCameraDistanceSq (const QSSGRenderableObject &obj, const QSSGRenderCameraData &camera) noexcept
static constexpr QSSGPrepContextId createPrepId (size_t index, quint32 frame)
static constexpr size_t getPrepContextIndex (QSSGPrepContextId id)
static constexpr bool verifyPrepContext (QSSGPrepContextId id, const QSSGRenderer &renderer)
static void createRenderablesHelper (QSSGLayerRenderData &layer, const QSSGRenderNode::ChildList &children, QSSGLayerRenderData::RenderableNodeEntries &renderables, QSSGRenderHelpers::CreateFlags createFlags)
static constexpr size_t pipelineStateIndex (QSSGRenderablesFilter filter)
template<typename T, typename... Args>
T * RENDER_FRAME_NEW (QSSGRenderContextInterface &ctx, Args &&... args)
template<typename T>
QSSGDataRef< T > RENDER_FRAME_NEW_BUFFER (QSSGRenderContextInterface &ctx, size_t count)
static bool hasCustomBlendMode (const QSSGRenderCustomMaterial &material)
static bool scopeLight (QSSGRenderNode *node, QSSGRenderNode *lightScope)
static int effectiveMaxLightCount (const QSSGShaderFeatures &features)
static int effectiveMaxDirectionalLightCount (const QSSGShaderFeatures &features)
static void updateDirtySkeletons (const QSSGLayerRenderData &renderData, const QSSGLayerRenderData::QSSGModelsView &renderableNodes)
template<typename T>
static void clearTable (std::vector< T > &entry)
static void sortInstances (QByteArray &sortedData, QList< QSSGRhiSortData > &sortData, const void *instances, int stride, int count, const QVector3D &cameraDirection)
static void cullLodInstances (QByteArray &lodData, const void *instances, int count, const QVector3D &cameraPosition, float minThreshold, float maxThreshold)

Variables

static const QVector2D s_ProgressiveAAVertexOffsets [QSSGLayerRenderData::MAX_AA_LEVELS]
static constexpr quint16 PREP_CTX_INDEX_MASK = 0xffff
static const int REDUCED_MAX_LIGHT_COUNT_THRESHOLD_BYTES = 5200

Macro Definition Documentation

◆ BONEDATASIZE4ID

#define BONEDATASIZE4ID ( x)
Value:
GLint GLint GLint GLint GLint x
#define POS4BONETRANS(x)

Definition at line 46 of file qssglayerrenderdata.cpp.

◆ CHECK_IMAGE_AND_PREPARE

#define CHECK_IMAGE_AND_PREPARE ( img,
imgtype,
shadercomponent )
Value:
if ((img)) \
prepareImageForRender(*(img), imgtype, firstImage, nextImage, renderableFlags, \
theGeneratedKey, shadercomponent, &inMaterial)
GLint void * img
Definition qopenglext.h:233

◆ MAX_MORPH_TARGET

#define MAX_MORPH_TARGET   8

Definition at line 231 of file qssglayerrenderdata.cpp.

◆ MAX_MORPH_TARGET_INDEX_SUPPORTS_NORMALS

#define MAX_MORPH_TARGET_INDEX_SUPPORTS_NORMALS   3

Definition at line 232 of file qssglayerrenderdata.cpp.

◆ MAX_MORPH_TARGET_INDEX_SUPPORTS_TANGENTS

#define MAX_MORPH_TARGET_INDEX_SUPPORTS_TANGENTS   1

Definition at line 233 of file qssglayerrenderdata.cpp.

◆ POS4BONENORM

#define POS4BONENORM ( x)
Value:
(sizeof(float) * 16 * ((x) * 2 + 1))

Definition at line 45 of file qssglayerrenderdata.cpp.

◆ POS4BONETRANS

#define POS4BONETRANS ( x)
Value:
(sizeof(float) * 16 * (x) * 2)

Definition at line 44 of file qssglayerrenderdata.cpp.

Function Documentation

◆ checkParticleSupport()

bool checkParticleSupport ( QRhi * rhi)
static

Definition at line 48 of file qssglayerrenderdata.cpp.

◆ clearTable()

template<typename T>
void clearTable ( std::vector< T > & entry)
static

Definition at line 2794 of file qssglayerrenderdata.cpp.

◆ collectBoneTransforms()

void collectBoneTransforms ( const QSSGLayerRenderData & renderData,
QSSGRenderNode * node,
QSSGRenderSkeleton * skeletonNode,
const QVector< QMatrix4x4 > & poses )
static

Definition at line 183 of file qssglayerrenderdata.cpp.

◆ createPrepId()

constexpr QSSGPrepContextId createPrepId ( size_t index,
quint32 frame )
staticconstexpr

Definition at line 479 of file qssglayerrenderdata.cpp.

◆ createRenderablesHelper()

void createRenderablesHelper ( QSSGLayerRenderData & layer,
const QSSGRenderNode::ChildList & children,
QSSGLayerRenderData::RenderableNodeEntries & renderables,
QSSGRenderHelpers::CreateFlags createFlags )
static

Definition at line 520 of file qssglayerrenderdata.cpp.

◆ cullLodInstances()

void cullLodInstances ( QByteArray & lodData,
const void * instances,
int count,
const QVector3D & cameraPosition,
float minThreshold,
float maxThreshold )
static

Definition at line 2924 of file qssglayerrenderdata.cpp.

◆ effectiveMaxDirectionalLightCount()

int effectiveMaxDirectionalLightCount ( const QSSGShaderFeatures & features)
inlinestatic

Definition at line 2088 of file qssglayerrenderdata.cpp.

◆ effectiveMaxLightCount()

int effectiveMaxLightCount ( const QSSGShaderFeatures & features)
inlinestatic

Definition at line 2080 of file qssglayerrenderdata.cpp.

◆ furthestToNearestCompare()

constexpr bool furthestToNearestCompare ( const QSSGRenderableObjectHandle & lhs,
const QSSGRenderableObjectHandle & rhs )
inlinestaticnodiscardconstexprnoexcept

◆ getCameraDistanceSq()

float getCameraDistanceSq ( const QSSGRenderableObject & obj,
const QSSGRenderCameraData & camera )
inlinestaticnodiscardnoexcept

Definition at line 288 of file qssglayerrenderdata.cpp.

◆ getPrepContextIndex()

constexpr size_t getPrepContextIndex ( QSSGPrepContextId id)
staticconstexpr

Definition at line 480 of file qssglayerrenderdata.cpp.

◆ hasCustomBlendMode()

bool hasCustomBlendMode ( const QSSGRenderCustomMaterial & material)
static

Definition at line 1479 of file qssglayerrenderdata.cpp.

◆ hasDirtyNonJointNodes()

bool hasDirtyNonJointNodes ( QSSGRenderNode * node,
bool & hasChildJoints )
static

Definition at line 206 of file qssglayerrenderdata.cpp.

◆ nearestToFurthestCompare()

constexpr bool nearestToFurthestCompare ( const QSSGRenderableObjectHandle & lhs,
const QSSGRenderableObjectHandle & rhs )
inlinestaticnodiscardconstexprnoexcept

◆ pipelineStateIndex()

constexpr size_t pipelineStateIndex ( QSSGRenderablesFilter filter)
staticconstexpr

Definition at line 806 of file qssglayerrenderdata.cpp.

◆ Q_STATIC_LOGGING_CATEGORY()

QT_BEGIN_NAMESPACE Q_STATIC_LOGGING_CATEGORY ( lcQuick3DRender ,
"qt.quick3d.render"  )

◆ RENDER_FRAME_NEW()

template<typename T, typename... Args>
T * RENDER_FRAME_NEW ( QSSGRenderContextInterface & ctx,
Args &&... args )
inlinenodiscard

Usage: T *ptr = RENDER_FRAME_NEW<T>(context, arg0, arg1, ...); is equivalent to: T *ptr = new T(arg0, arg1, ...); so RENDER_FRAME_NEW() takes the RCI + T's arguments

Definition at line 910 of file qssglayerrenderdata.cpp.

◆ RENDER_FRAME_NEW_BUFFER()

template<typename T>
QSSGDataRef< T > RENDER_FRAME_NEW_BUFFER ( QSSGRenderContextInterface & ctx,
size_t count )
inlinenodiscard

Definition at line 917 of file qssglayerrenderdata.cpp.

◆ scopeLight()

bool scopeLight ( QSSGRenderNode * node,
QSSGRenderNode * lightScope )
static

Definition at line 2067 of file qssglayerrenderdata.cpp.

◆ sortInstances()

void sortInstances ( QByteArray & sortedData,
QList< QSSGRhiSortData > & sortData,
const void * instances,
int stride,
int count,
const QVector3D & cameraDirection )
static

Definition at line 2895 of file qssglayerrenderdata.cpp.

◆ statLayerNodes()

LayerNodeStatResult statLayerNodes ( const QSSGLayerRenderData::LayerNodes & layerNodes,
quint32 layerMask )
static

Definition at line 103 of file qssglayerrenderdata.cpp.

◆ updateDirtySkeletons()

void updateDirtySkeletons ( const QSSGLayerRenderData & renderData,
const QSSGLayerRenderData::QSSGModelsView & renderableNodes )
static

Definition at line 2096 of file qssglayerrenderdata.cpp.

◆ verifyPrepContext()

constexpr bool verifyPrepContext ( QSSGPrepContextId id,
const QSSGRenderer & renderer )
staticconstexpr

Definition at line 481 of file qssglayerrenderdata.cpp.

Variable Documentation

◆ PREP_CTX_INDEX_MASK

constexpr quint16 PREP_CTX_INDEX_MASK = 0xffff
staticconstexpr

Definition at line 478 of file qssglayerrenderdata.cpp.

◆ REDUCED_MAX_LIGHT_COUNT_THRESHOLD_BYTES

const int REDUCED_MAX_LIGHT_COUNT_THRESHOLD_BYTES = 5200
static

Definition at line 2078 of file qssglayerrenderdata.cpp.

◆ s_ProgressiveAAVertexOffsets

const QVector2D s_ProgressiveAAVertexOffsets
static
Initial value:
= {
QVector2D(-0.170840f, -0.553840f),
QVector2D(0.162960f, -0.319340f),
QVector2D(0.360260f, -0.245840f),
QVector2D(-0.561340f, -0.149540f),
QVector2D(0.249460f, 0.453460f),
QVector2D(-0.336340f, 0.378260f),
QVector2D(0.340000f, 0.166260f),
QVector2D(0.235760f, 0.527760f),
}
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31

Definition at line 131 of file qssglayerrenderdata.cpp.