7#include <QtCore/qthreadpool.h>
10#include <QtQuick/private/qsgcontext_p.h>
11#include <QtQuick/private/qsgrenderer_p.h>
13#include "graphobjects/qssgrenderroot_p.h"
14#include "graphobjects/qssgrenderlayer_p.h"
15#include "graphobjects/qssgrenderitem2d_p.h"
18#include "resourcemanager/qssgrenderbuffermanager_p.h"
22static void reindexChildNodes(QSSGRenderNode &node,
const quint32 version, quint32 &dfsIdx, size_t &count)
24 Q_ASSERT(node.type != QSSGRenderNode::Type::Layer);
25 if (node.type != QSSGRenderNode::Type::Layer) {
29 if (node.h.version() != version)
30 node.h = QSSGRenderNodeHandle(0, version, dfsIdx);
31 for (QSSGRenderNode &chld : node.children)
32 reindexChildNodes(chld, version, ++dfsIdx, ++count);
36static void reindexLayerChildNodes(QSSGRenderLayer &layer,
const quint32 version, quint32 &dfsIdx, size_t &count)
38 Q_ASSERT(layer.type == QSSGRenderNode::Type::Layer);
39 if (layer.type == QSSGRenderNode::Type::Layer) {
40 layer.h = QSSGRenderNodeHandle(0, version, 0);
41 for (QSSGRenderNode &chld : layer.children)
42 reindexChildNodes(chld, version, ++dfsIdx, ++count);
46static void reindex(QSSGRenderRoot *rootNode,
const quint32 version, quint32 &dfsIdx, size_t &count)
49 Q_ASSERT(rootNode->type == QSSGRenderNode::Type::Root);
50 Q_ASSERT(dfsIdx == 0);
51 rootNode->h = QSSGRenderNodeHandle(0, version, 0);
52 for (QSSGRenderNode &chld : rootNode->children)
53 reindexLayerChildNodes(
static_cast<QSSGRenderLayer &>(chld), version, dfsIdx, count);
57enum class Insert { Back, Indexed };
61 Q_ASSERT_X(node.type != QSSGRenderNode::Type::Layer, Q_FUNC_INFO,
"Unexpected Layer node in child list!");
62 if constexpr (insert == Insert::Indexed)
63 outList[idx++] = &node;
65 outList.push_back(&node);
66 for (QSSGRenderNode &chld : node.children)
67 collectChildNodesFirst<insert>(chld, outList, idx);
73 if (node.getGlobalState(QSSGRenderNode::GlobalState::Active)) {
74 if constexpr (insert == Insert::Indexed)
75 outList[idx++] = &node;
77 outList.push_back(&node);
78 for (QSSGRenderNode &chld : node.children)
79 collectChildNodesSecond<insert>(chld, outList, idx);
87 Q_ASSERT(layer->type == QSSGRenderNode::Type::Layer);
89 for (QSSGRenderNode &chld : layer->children) {
90 if constexpr (discard == Discard::Inactive)
91 collectChildNodesSecond<insert>(chld, outList, idx);
93 collectChildNodesFirst<insert>(chld, outList, idx);
97 if constexpr (insert == Insert::Back)
103 const quint32 version,
104 QSSGGlobalRenderNodeData::GlobalTransformStore &globalTransforms,
105 QSSGGlobalRenderNodeData::GlobalOpacityStore &globalOpacities)
107 using DirtyFlag = QSSGRenderNode::DirtyFlag;
108 using FlagT = QSSGRenderNode::FlagT;
109 constexpr DirtyFlag TransformAndOpacityDirty = DirtyFlag(FlagT(DirtyFlag::TransformDirty) | FlagT(DirtyFlag::OpacityDirty));
111 if (Q_UNLIKELY(!node || (node->h.version() != version)))
115 bool retval = forcedRebuild || node->isDirty(TransformAndOpacityDirty);
121 const bool alwaysDirty = node->isDirty(DirtyFlag::StickyDirty);
123 if (retval || alwaysDirty) {
124 const auto idx = node->h.index();
126 auto &globalTransform = globalTransforms[idx];
127 auto &globalOpacity = globalOpacities[idx];
128 globalOpacity = node->localOpacity;
129 globalTransform = node->localTransform;
131 if (QSSGRenderNode *parent = node->parent) {
132 const auto pidx = parent->h.index();
133 const auto pOpacity = globalOpacities[pidx];
134 globalOpacity *= pOpacity;
136 if (parent->type != QSSGRenderGraphObject::Type::Layer) {
137 const auto pTransform = globalTransforms[pidx];
138 globalTransform = pTransform * node->localTransform;
142 node->clearDirty(TransformAndOpacityDirty);
152 using LocalState = QSSGRenderNode::LocalState;
153 using GlobalState = QSSGRenderNode::GlobalState;
154 using DirtyFlag = QSSGRenderNode::DirtyFlag;
155 using FlagT = QSSGRenderNode::FlagT;
157 constexpr DirtyFlag ClearDirtyMask = DirtyFlag(FlagT(DirtyFlag::ActiveDirty) | FlagT(DirtyFlag::PickableDirty) | FlagT(DirtyFlag::ImportDirty));
159 if (Q_UNLIKELY(!node || (node->h.version() != version)))
162 const bool activeDirty = node->isDirty(DirtyFlag::ActiveDirty);
163 const bool pickableDirty = node->isDirty(DirtyFlag::PickableDirty);
164 const bool importedDirty = node->isDirty(DirtyFlag::ImportDirty);
166 const bool updateState = activeDirty || pickableDirty || importedDirty;
169 const QSSGRenderNode *parent = node->parent;
170 const bool hasParent = (parent !=
nullptr);
171 const bool globallyActive = node->getLocalState(LocalState::Active) && (!hasParent || parent->getGlobalState(GlobalState::Active));
172 node->flags = globallyActive ? (node->flags | FlagT(GlobalState::Active)) : (node->flags & ~FlagT(GlobalState::Active));
173 const bool globallyPickable = node->getLocalState(LocalState::Pickable) || (hasParent && parent->getGlobalState(GlobalState::Pickable));
174 node->flags = globallyPickable ? (node->flags | FlagT(GlobalState::Pickable)) : (node->flags & ~FlagT(GlobalState::Pickable));
175 const bool globallyImported = node->getLocalState(LocalState::Imported) || (hasParent && parent->getGlobalState(GlobalState::Imported));
176 node->flags = globallyImported ? (node->flags | FlagT(GlobalState::Imported)) : (node->flags & ~FlagT(GlobalState::Imported));
179 node->clearDirty(ClearDirtyMask);
186 const quint32 version,
187 QSSGGlobalRenderNodeData::GlobalTransformStore &globalTransforms,
188 QSSGGlobalRenderNodeData::InstanceTransformStore &instanceTransforms)
190 if (Q_UNLIKELY(!node || (node->h.version() != version)))
193 constexpr bool retval =
true;
198 const auto idx = node->h.index();
199 QSSGRenderNode *parent = node->parent;
200 if (parent && parent->type != QSSGRenderGraphObject::Type::Layer && node->getLocalState(QSSGRenderNode::LocalState::Active)) {
201 const auto pidx = parent->h.index();
202 const auto &pGlobalTransform = globalTransforms[pidx];
203 QSSGRenderNode *instanceRoot = node->instanceRoot;
204 if (instanceRoot == node) {
205 instanceTransforms[idx] = { node->localTransform, pGlobalTransform };
206 }
else if (instanceRoot) {
207 auto &[nodeInstanceLocalTransform, nodeInstanceGlobalTransform] = instanceTransforms[idx];
208 auto &[instanceRootLocalTransform, instanceRootGlobalTransform] = instanceTransforms[instanceRoot->h.index()];
209 nodeInstanceGlobalTransform = instanceRootGlobalTransform;
212 nodeInstanceLocalTransform = node->localTransform;
215 if (p == instanceRoot) {
216 nodeInstanceLocalTransform = instanceRootLocalTransform * nodeInstanceLocalTransform;
219 nodeInstanceLocalTransform = p->localTransform * nodeInstanceLocalTransform;
225 QMatrix4x4 globalInstanceTransform = globalTransforms[pidx];
226 QMatrix4x4 localInstanceTransform = node->localTransform;
227 auto &localInstanceMatrix = *
reinterpret_cast<
float (*)[4][4]>(localInstanceTransform.data());
228 QVector3D localPos{localInstanceMatrix[3][0], localInstanceMatrix[3][1], localInstanceMatrix[3][2]};
229 localInstanceMatrix[3][0] = 0;
230 localInstanceMatrix[3][1] = 0;
231 localInstanceMatrix[3][2] = 0;
232 globalInstanceTransform = pGlobalTransform;
233 globalInstanceTransform.translate(localPos);
234 instanceTransforms[idx] = { localInstanceTransform, globalInstanceTransform };
237 instanceTransforms[idx] = { node->localTransform, {} };
243QSSGGlobalRenderNodeData::QSSGGlobalRenderNodeData(QSSGRenderRoot *root)
245 : m_threadPool(
new QThreadPool)
252QSSGGlobalRenderNodeData::~QSSGGlobalRenderNodeData()
257void QSSGGlobalRenderNodeData::reindex()
267 if (m_version == m_rootNode->startVersion())
268 m_version = m_rootNode->startVersion() + 1;
272 ::reindex(m_rootNode, m_version, dfsIdx, m_nodeCount);
280 globalTransforms.resize(m_size, QMatrix4x4{ Qt::Uninitialized });
281 globalOpacities.resize(m_size, 1.0f);
282 instanceTransforms.resize(m_size, { QMatrix4x4{ Qt::Uninitialized }, QMatrix4x4{ Qt::Uninitialized } });
284 collectNodes(m_rootNode);
291void QSSGGlobalRenderNodeData::invalidate()
293 m_rootNode =
nullptr;
296QMatrix4x4 QSSGGlobalRenderNodeData::getGlobalTransform(QSSGRenderNodeHandle h, QMatrix4x4 defaultValue)
const
299 const bool hasId = h.hasId();
300 const bool validVersion = hasId && (h.version() == m_version);
301 const auto index = h.index();
305 if (!validVersion || !(globalTransforms.size() > index))
308 return globalTransforms[index];
311QMatrix4x4 QSSGGlobalRenderNodeData::getGlobalTransform(QSSGRenderNodeHandle h)
const
313 return getGlobalTransform(h, QMatrix4x4{ Qt::Uninitialized });
316QMatrix4x4 QSSGGlobalRenderNodeData::getGlobalTransform(
const QSSGRenderNode &node)
const
318 return getGlobalTransform(node.h, node.localTransform);
321float QSSGGlobalRenderNodeData::getGlobalOpacity(QSSGRenderNodeHandle h,
float defaultValue)
const
323 const bool hasId = h.hasId();
324 const bool validVersion = hasId && (h.version() == m_version);
325 const auto index = h.index();
327 if (!validVersion || !(globalOpacities.size() > index))
330 return globalOpacities[index];
333float QSSGGlobalRenderNodeData::getGlobalOpacity(
const QSSGRenderNode &node)
const
335 return getGlobalOpacity(node.h, node.localOpacity);
339const std::unique_ptr<QThreadPool> &QSSGGlobalRenderNodeData::threadPool()
const {
return m_threadPool; }
342QSSGGlobalRenderNodeData::LayerNodeView QSSGGlobalRenderNodeData::getLayerNodeView(QSSGRenderLayerHandle h)
const
344 const bool hasId = h.hasId();
345 const bool validVersion = hasId && (h.version() == m_version);
346 const auto index = h.index();
348 if (!validVersion || !(layerNodes.size() > index))
351 auto §ion = layerNodes[index];
353 return { nodes.data() + section.offset, qsizetype(section.size) };
356QSSGGlobalRenderNodeData::LayerNodeView QSSGGlobalRenderNodeData::getLayerNodeView(
const QSSGRenderLayer &layer)
const
358 return getLayerNodeView(layer.lh);
361void QSSGGlobalRenderNodeData::collectNodes(QSSGRenderRoot *rootNode)
366 Q_ASSERT(rootNode !=
nullptr);
369 nodes.resize(m_nodeCount,
nullptr);
373 quint32 layerIdx = 0;
374 for (QSSGRenderNode &chld : rootNode->children) {
375 Q_ASSERT(chld.type == QSSGRenderNode::Type::Layer);
376 QSSGRenderLayer *layer =
static_cast<QSSGRenderLayer *>(&chld);
377 const size_t offset = idx;
378 collectLayerChildNodes<Discard::None, Insert::Indexed>(layer, nodes, idx);
379 layer->lh = QSSGRenderLayerHandle(layer->h.context(), m_version, layerIdx++);
380 layerNodes.emplace_back(LayerNodeSection{offset , idx - offset});
386void QSSGGlobalRenderNodeData::updateGlobalState()
389 for (QSSGRenderNode *node : nodes)
390 QSSGRenderDataHelpers::updateGlobalNodeState(node, m_version);
393 for (QSSGRenderNode *node : nodes)
394 calcGlobalNodeDataIndexedImpl<QSSGRenderDataHelpers::Strategy::Initial>(node, m_version, globalTransforms, globalOpacities);
397 for (QSSGRenderNode *node : nodes)
398 QSSGRenderDataHelpers::calcInstanceTransforms(node, m_version, globalTransforms, instanceTransforms);
401QSSGGlobalRenderNodeData::InstanceTransforms QSSGGlobalRenderNodeData::getInstanceTransforms(
const QSSGRenderNode &node)
const
403 return getInstanceTransforms(node.h);
406QSSGGlobalRenderNodeData::InstanceTransforms QSSGGlobalRenderNodeData::getInstanceTransforms(QSSGRenderNodeHandle h)
const
408 const bool hasId = h.hasId();
409 const bool validVersion = hasId && (h.version() == m_version);
410 const auto index = h.index();
412 if (!validVersion || !(instanceTransforms.size() > index))
415 return instanceTransforms[index];
419 : m_gnd(globalNodeData)
420 , m_version(globalNodeData->version())
427 const bool hasId = h.hasId();
428 const bool validVersion = hasId && (h.version() == m_version);
429 const auto index = h.index();
430 if (!validVersion || !(normalMatrices.size() > index))
433 return normalMatrices[index];
438 return getNormalMatrix(model.mh, QMatrix3x3{ Qt::Uninitialized });
443 const bool hasId = h.hasId();
444 const bool validVersion = hasId && (h.version() == m_version);
445 const auto index = h.index();
447 if (!validVersion || !(meshes.size() > index))
450 return meshes[index];
455 return getMesh(model.mh);
460 const bool hasId = h.hasId();
461 const bool validVersion = hasId && (h.version() == m_version);
462 const auto index = h.index();
464 if (!validVersion || !(materials.size() > index))
467 return materials[index];
472 return getMaterials(model.mh);
475QSSGRenderModelData::ModelViewProjections
QSSGRenderModelData::getModelViewProjection(
const QSSGRenderModel &model)
const
477 return getModelViewProjection(model.mh);
482 const bool hasId = h.hasId();
483 const bool validVersion = hasId && (h.version() == m_version);
484 const auto index = h.index();
486 if (!validVersion || !(modelViewProjections.size() > index))
489 return modelViewProjections[index];
494 const auto &bufferManager = renderer->contextInterface()->bufferManager();
496 const bool globalPickingEnabled = QSSGRendererPrivate::isGlobalPickingEnabled(*renderer);
498 for (
auto *model : models) {
507 if (
auto *theMesh = bufferManager->loadMesh(*model)) {
508 meshes[model->mh.index()] = theMesh;
512 const float modelGlobalOpacity = m_gnd->getGlobalOpacity(*model);
513 const bool canModelBePickable = (modelGlobalOpacity > QSSGRendererPrivate::minimumRenderOpacity)
514 && (globalPickingEnabled
515 || model->getGlobalState(QSSGRenderModel::GlobalState::Pickable));
516 if (canModelBePickable) {
519 const QSSGMesh::Mesh mesh = bufferManager->loadLightmapMesh(*model);
522 theMesh->bvh = bufferManager->loadMeshBVH(mesh);
523 else if (model->geometry)
524 theMesh->bvh = bufferManager->loadMeshBVH(model->geometry);
525 else if (!model->meshPath.isNull())
526 theMesh->bvh = bufferManager->loadMeshBVH(model->meshPath);
529 const auto &roots = theMesh->bvh->roots();
530 for (qsizetype i = 0, end = qsizetype(roots.size()); i < end; ++i)
531 theMesh->subsets[i].bvhRoot = roots[i];
536 const size_t index = model->mh.index();
537 if (QSSG_GUARD(meshes.size() > index))
538 meshes[model->mh.index()] =
nullptr;
546 bufferManager->commitBufferResourceUpdates();
551 for (
auto *model : models) {
552 const size_t index = model->mh.index();
553 if (QSSG_GUARD(materials.size() > index))
554 materials[index] = model->materials;
560 const auto modelCount = size_t(models.size());
561 const bool versionChanged = m_version != m_gnd->version();
562 const bool storageSizeChanged = (normalMatrices.size() < modelCount);
567 const bool reIndexNeeded = versionChanged || storageSizeChanged ||
true;
569 const QMatrix3x3 defaultNormalMatrix;
570 const QMatrix4x4 defaultModelViewProjection;
573 modelViewProjections.resize(modelCount, { defaultModelViewProjection, defaultModelViewProjection });
574 normalMatrices.resize(modelCount, defaultNormalMatrix);
575 meshes.resize(modelCount,
nullptr);
576 materials.resize(modelCount, {});
580 m_version = m_gnd->version();
582 for (quint32 i = 0; i < modelCount; ++i) {
583 QSSGRenderModel *model = models[i];
584 model->mh = QSSGRenderModelHandle(model->h.context(), model->h.version(), i);
589 const auto doNormalMatrices = [&]() {
590 for (
const QSSGRenderModel *model : std::as_const(models)) {
591 auto &normalMatrix = normalMatrices[model->mh.index()];
592 const QMatrix4x4 globalTransform = m_gnd->getGlobalTransform(*model);
593 QSSGRenderNode::calculateNormalMatrix(globalTransform, normalMatrix);
598 const auto doMVPs = [&]() {
599 for (
const QSSGRenderModel *model : std::as_const(models)) {
601 const QMatrix4x4 globalTransform = m_gnd->getGlobalTransform(*model);
602 auto &mvp = modelViewProjections[model->mh.index()];
603 for (
const QSSGRenderCameraData &cameraData : renderCameraData)
604 QSSGRenderNode::calculateMVP(globalTransform, cameraData.viewProjection, mvp[mvpCount++]);
609 const auto &threadPool = m_gnd->threadPool();
610#define qssgTryThreadedStart(func)
611 if (!threadPool->tryStart(func)) {
612 qWarning("Unable to start thread for %s!", #func);
615#define qssgTryWaitForDone()
616 threadPool->waitForDone();
618#define qssgTryThreadedStart(func)
620#define qssgTryWaitForDone()
629 prepareMaterials(models);
630 prepareMeshData(models, renderer);
636bool QSSGRenderDataHelpers::updateGlobalNodeDataIndexed(QSSGRenderNode *node,
const quint32 version, QSSGGlobalRenderNodeData::GlobalTransformStore &globalTransforms, QSSGGlobalRenderNodeData::GlobalOpacityStore &globalOpacities)
638 return calcGlobalNodeDataIndexedImpl<
Strategy::Update>(node, version, globalTransforms, globalOpacities);
641bool QSSGRenderDataHelpers::calcGlobalVariablesIndexed(QSSGRenderNode *node,
const quint32 version, QSSGGlobalRenderNodeData::GlobalTransformStore &globalTransforms, QSSGGlobalRenderNodeData::GlobalOpacityStore &globalOpacities)
643 return calcGlobalNodeDataIndexedImpl<
Strategy::Initial>(node, version, globalTransforms, globalOpacities);
648 const auto foundIt = item2DRenderers.find(&item);
649 return (foundIt != item2DRenderers.cend()) ? foundIt->second : Item2DRenderer{};
654 const bool hasId = h.hasId();
655 const bool validVersion = hasId && (h.version() == m_version);
656 const auto index = h.index();
658 if (!validVersion || !(modelViewProjections.size() > index))
661 return modelViewProjections[index];
666 return getModelViewProjection(item.ih);
671 m_gnd = globalNodeData;
672 m_version = globalNodeData->version();
682 const auto itemCount = size_t(items.size());
687 const bool versionChanged = m_version != m_gnd->version();
688 const bool storageSizeChanged = (modelViewProjections.size() < itemCount);
692 const bool reIndexNeeded = versionChanged || storageSizeChanged ||
true;
694 const QMatrix4x4 defaultModelViewProjection;
696 const auto &rhiCtx = renderer->contextInterface()->rhiContext();
699 modelViewProjections.resize(itemCount, { defaultModelViewProjection, defaultModelViewProjection });
703 m_version = m_gnd->version();
705 for (quint32 i = 0; i < itemCount; ++i) {
706 QSSGRenderItem2D *item = items[i];
707 item->ih = QSSGRenderItem2DHandle(item->h.context(), item->h.version(), i);
712 const auto &clipSpaceCorrMatrix = rhiCtx->rhi()->clipSpaceCorrMatrix();
715 const auto doMVPs = [&]() {
716 for (
const QSSGRenderItem2D *item : std::as_const(items)) {
718 const QMatrix4x4 globalTransform = m_gnd->getGlobalTransform(*item);
719 auto &mvps = modelViewProjections[item->ih.index()];
720 for (
const QSSGRenderCameraData &cameraData : renderCameraData) {
721 const QMatrix4x4 &mvp = cameraData.viewProjection * globalTransform;
722 mvps[mvpCount++] = clipSpaceCorrMatrix * mvp * flipMatrix;
731 QSGRenderContext *sgRc = QSSGRendererPrivate::getSgRenderContext(*renderer);
732 const bool contextChanged = (item2DRenderContext && item2DRenderContext != sgRc);
733 item2DRenderContext = sgRc;
735 if (contextChanged || !rpd)
736 rpd.reset(rhiCtx->mainRenderPassDescriptor()->newCompatibleRenderPassDescriptor());
738 for (
const QSSGRenderItem2D *theItem2D : std::as_const(items)) {
739 auto item2DRenderer = getItem2DRenderer(*theItem2D);
740 if (contextChanged) {
741 delete item2DRenderer;
744 item2DRenderer.clear();
747 if (!item2DRenderer) {
748 item2DRenderer = sgRc->createRenderer(QSGRendererInterface::RenderMode3D);
749 QObject::connect(item2DRenderer, SIGNAL(sceneGraphChanged()), theItem2D->m_frontEndObject, SLOT(update()));
752 if (item2DRenderer->rootNode() != theItem2D->m_rootNode) {
753 item2DRenderer->setRootNode(theItem2D->m_rootNode);
754 theItem2D->m_rootNode->markDirty(QSGNode::DirtyForceUpdate);
755 item2DRenderer->nodeChanged(theItem2D->m_rootNode, QSGNode::DirtyForceUpdate);
758 item2DRenderers[theItem2D] = item2DRenderer;
764 const auto foundIt = item2DRenderers.find(&item);
765 if (foundIt != item2DRenderers.cend()) {
766 delete foundIt->second;
767 item2DRenderers.erase(foundIt);
776 for (
auto &it : item2DRenderers)
779 item2DRenderers.clear();
780 item2DRenderContext =
nullptr;
781 modelViewProjections.clear();
friend class QSSGRenderer
void releaseRenderData(const QSSGRenderItem2D &item)
void updateItem2DData(QSSGItem2DsView &items, QSSGRenderer *renderer, const QSSGRenderCameraDataList &renderCameraData)
Item2DRenderer getItem2DRenderer(const QSSGRenderItem2D &item) const
ModelViewProjections getModelViewProjection(QSSGRenderItem2DHandle h) const
ModelViewProjections getModelViewProjection(const QSSGRenderItem2D &item) const
void updateModelData(QSSGModelsView &models, QSSGRenderer *renderer, const QSSGRenderCameraDataList &renderCameraData)
QMatrix3x3 getNormalMatrix(QSSGRenderModelHandle h, QMatrix3x3 defaultValue) const
QSSGRenderMesh * getMesh(QSSGRenderModelHandle h) const
MaterialList getMaterials(QSSGRenderModelHandle h) const
ModelViewProjections getModelViewProjection(QSSGRenderModelHandle h) const
#define qssgTryWaitForDone()
static bool calcGlobalNodeDataIndexedImpl(QSSGRenderNode *node, const quint32 version, QSSGGlobalRenderNodeData::GlobalTransformStore &globalTransforms, QSSGGlobalRenderNodeData::GlobalOpacityStore &globalOpacities)
static void collectLayerChildNodes(QSSGRenderLayer *layer, QSSGGlobalRenderNodeData::NodeStore &outList, size_t &idx)
static void collectChildNodesFirst(QSSGRenderNode &node, QSSGGlobalRenderNodeData::NodeStore &outList, size_t &idx)
#define qssgTryThreadedStart(func)
static void collectChildNodesSecond(QSSGRenderNode &node, QSSGGlobalRenderNodeData::NodeStore &outList, size_t &idx)