diff options
author | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-10-11 16:01:22 +0300 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2023-10-11 16:01:22 +0300 |
commit | e1b1a0d2970fd384bd52c734a72536d8452ad070 (patch) | |
tree | 494b70bc1a1e115d7ecce39e698d9621af717971 | |
parent | c1f8fa2578d99e07f5e581f26bd532695b9534f9 (diff) | |
parent | b59fdcefdbce6a1870e49b0da14d30b51293dea6 (diff) |
Merge remote-tracking branch 'origin/tqtc/lts-5.15.12' into tqtc/lts-5.15-opensourcev5.15.12-lts-lgpl
Change-Id: If1ce1579db02b74dde74731fcf6163614961841f
19 files changed, 218 insertions, 30 deletions
diff --git a/.qmake.conf b/.qmake.conf index 9e85f1311..8ece08892 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -6,4 +6,4 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH DEFINES += QT_NO_JAVA_STYLE_ITERATORS -MODULE_VERSION = 5.15.11 +MODULE_VERSION = 5.15.12 diff --git a/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp b/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp index 7f07ffd8c..878e4674d 100644 --- a/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp +++ b/src/plugins/geometryloaders/gltf/gltfgeometryloader.cpp @@ -340,15 +340,6 @@ void GLTFGeometryLoader::processJSONBufferViewV2(const QJsonObject &json) } const auto bufferData = m_gltf2.m_bufferDatas[bufferIndex]; - int target = json.value(KEY_TARGET).toInt(); - switch (target) { - case GL_ARRAY_BUFFER: - case GL_ELEMENT_ARRAY_BUFFER: - break; - default: - return; - } - quint64 offset = 0; const auto byteOffset = json.value(KEY_BYTE_OFFSET); if (!byteOffset.isUndefined()) { diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp index 97a256b9c..2a0f449fb 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3.cpp @@ -263,6 +263,17 @@ void GraphicsHelperES3::drawArraysInstanced(GLenum primitiveType, GLint first, G instances); } +void GraphicsHelperES3::drawArraysInstancedBaseInstance(GLenum primitiveType, GLint first, GLsizei count, GLsizei instances, GLsizei baseInstance) +{ + if (baseInstance != 0) + qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 3"; + + m_extraFuncs->glDrawArraysInstanced(primitiveType, + first, + count, + instances); +} + void GraphicsHelperES3::readBuffer(GLenum mode) { m_extraFuncs->glReadBuffer(mode); diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2.cpp index 65108800b..5f5bc8578 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_2.cpp @@ -140,7 +140,7 @@ void GraphicsHelperES3_2::setVerticesPerPatch(GLint verticesPerPatch) void GraphicsHelperES3_2::drawElementsInstancedBaseVertexBaseInstance(GLenum primitiveType, GLsizei primitiveCount, GLint indexType, void *indices, GLsizei instances, GLint baseVertex, GLint baseInstance) { if (baseInstance != 0) - qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 2"; + qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 3.2"; m_extraFuncs->glDrawElementsInstancedBaseVertex(primitiveType, primitiveCount, diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h index 5c34a8abb..9ac9ea159 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelperes3_p.h @@ -76,6 +76,7 @@ public: void buildUniformBuffer(const QVariant &v, const ShaderUniform &description, QByteArray &buffer) override; void drawBuffers(GLsizei n, const int *bufs) override; void drawArraysInstanced(GLenum primitiveType, GLint first, GLsizei count, GLsizei instances) override; + void drawArraysInstancedBaseInstance(GLenum primitiveType, GLint first, GLsizei count, GLsizei instances, GLsizei baseInstance) override; void drawElementsInstancedBaseVertexBaseInstance(GLenum primitiveType, GLsizei primitiveCount, GLint indexType, void *indices, GLsizei instances, GLint baseVertex = 0, GLint baseInstance = 0) override; void readBuffer(GLenum mode) override; void drawBuffer(GLenum mode) override; diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp index 8e843bca7..d220fb16d 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_2.cpp @@ -105,7 +105,7 @@ void GraphicsHelperGL3_2::drawElementsInstancedBaseVertexBaseInstance(GLenum pri GLint baseInstance) { if (baseInstance != 0) - qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 2"; + qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL 3.2"; // glDrawElements OpenGL 3.1 or greater m_funcs->glDrawElementsInstancedBaseVertex(primitiveType, diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp index 3a8c8bde8..065cb1c0b 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl3_3.cpp @@ -104,7 +104,7 @@ void GraphicsHelperGL3_3::drawElementsInstancedBaseVertexBaseInstance(GLenum pri GLint baseInstance) { if (baseInstance != 0) - qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL 3"; + qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL 3.3"; // glDrawElements OpenGL 3.1 or greater m_funcs->glDrawElementsInstancedBaseVertex(primitiveType, diff --git a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp index a472da774..7130bb0be 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/graphicshelpergl4.cpp @@ -188,16 +188,13 @@ void GraphicsHelperGL4::drawElementsInstancedBaseVertexBaseInstance(GLenum primi GLint baseVertex, GLint baseInstance) { - if (baseInstance != 0) - qWarning() << "glDrawElementsInstancedBaseVertexBaseInstance is not supported with OpenGL ES 2"; - - // glDrawElements OpenGL 3.1 or greater - m_funcs->glDrawElementsInstancedBaseVertex(primitiveType, + m_funcs->glDrawElementsInstancedBaseVertexBaseInstance(primitiveType, primitiveCount, indexType, indices, instances, - baseVertex); + baseVertex, + baseInstance); } void GraphicsHelperGL4::drawArraysInstanced(GLenum primitiveType, diff --git a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp index ef32594e1..7ba67fed9 100644 --- a/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp +++ b/src/plugins/renderers/opengl/graphicshelpers/submissioncontext.cpp @@ -481,6 +481,10 @@ bool SubmissionContext::beginDrawing(QSurface *surface) } m_boundArrayBuffer = nullptr; + + // Record the default FBO value as there's no guarantee it remains constant over time + m_defaultFBO = m_gl->defaultFramebufferObject(); + return true; } @@ -1226,6 +1230,10 @@ bool SubmissionContext::setParameters(ShaderParameterPack ¶meterPack, GLShad } } + // Set the pinned images of the previous material + // to pinable so that we should easily find an available image unit + m_imageContext.deactivateImages(); + // Fill Image Uniform Value with proper image units // so that they can be applied as regular uniforms in a second step for (int i = 0; i < parameterPack.images().size(); ++i) { diff --git a/src/plugins/renderers/opengl/renderer/shaderparameterpack.cpp b/src/plugins/renderers/opengl/renderer/shaderparameterpack.cpp index 43b0b90c1..bf7d5fce6 100644 --- a/src/plugins/renderers/opengl/renderer/shaderparameterpack.cpp +++ b/src/plugins/renderers/opengl/renderer/shaderparameterpack.cpp @@ -100,12 +100,28 @@ void ShaderParameterPack::setImage(const int glslNameId, int uniformArrayIndex, // Contains Uniform Block Index and QNodeId of the ShaderData (UBO) void ShaderParameterPack::setUniformBuffer(BlockToUBO blockToUBO) { - m_uniformBuffers.push_back(std::move(blockToUBO)); + const auto uEnd = m_uniformBuffers.end(); + auto it = std::find_if(m_uniformBuffers.begin(), uEnd, [&] (const BlockToUBO &block) { + return blockToUBO.m_blockIndex == block.m_blockIndex; + }); + + if (it == uEnd) + m_uniformBuffers.push_back(std::move(blockToUBO)); + else + *it = std::move(blockToUBO); } void ShaderParameterPack::setShaderStorageBuffer(BlockToSSBO blockToSSBO) { - m_shaderStorageBuffers.push_back(std::move(blockToSSBO)); + const auto uEnd = m_shaderStorageBuffers.end(); + auto it = std::find_if(m_shaderStorageBuffers.begin(), uEnd, [&] (const BlockToSSBO &block) { + return blockToSSBO.m_blockIndex == block.m_blockIndex; + }); + + if (it == uEnd) + m_shaderStorageBuffers.push_back(std::move(blockToSSBO)); + else + *it = std::move(blockToSSBO); } void ShaderParameterPack::setSubmissionUniformIndex(const int uniformIdx) diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp index 8cf2ffd87..57e6b0e6e 100644 --- a/src/quick3d/imports/scene3d/scene3ditem.cpp +++ b/src/quick3d/imports/scene3d/scene3ditem.cpp @@ -200,6 +200,9 @@ private: expression that depends on property updates driven by the Qt 3D simulation loop (FrameAction) will never reavaluates. */ + +qint8 Scene3DItem::ms_framesNeededToFlushPipeline = 3; + Scene3DItem::Scene3DItem(QQuickItem *parent) : QQuickItem(parent) , m_entity(nullptr) @@ -230,6 +233,11 @@ Scene3DItem::Scene3DItem(QQuickItem *parent) // we still won't get ignored by the QtQuick SG when in Underlay mode setWidth(1); setHeight(1); + + const QByteArray framesToFlushCountEnvVar = qgetenv("QT3D_SCENE3D_FRAMES_FLUSH_COUNT"); + if (!framesToFlushCountEnvVar.isEmpty()) { + ms_framesNeededToFlushPipeline = framesToFlushCountEnvVar.toInt(); + } } Scene3DItem::~Scene3DItem() diff --git a/src/quick3d/imports/scene3d/scene3ditem_p.h b/src/quick3d/imports/scene3d/scene3ditem_p.h index 3a6ca5007..41e82e9f1 100644 --- a/src/quick3d/imports/scene3d/scene3ditem_p.h +++ b/src/quick3d/imports/scene3d/scene3ditem_p.h @@ -171,7 +171,7 @@ private: QMetaObject::Connection m_windowConnection; qint8 m_framesToRender; - static const qint8 ms_framesNeededToFlushPipeline = 2; + static qint8 ms_framesNeededToFlushPipeline; }; } // Qt3DRender diff --git a/src/quick3d/imports/scene3d/scene3drenderer.cpp b/src/quick3d/imports/scene3d/scene3drenderer.cpp index 51589de6c..275068b60 100644 --- a/src/quick3d/imports/scene3d/scene3drenderer.cpp +++ b/src/quick3d/imports/scene3d/scene3drenderer.cpp @@ -148,6 +148,7 @@ Scene3DRenderer::Scene3DRenderer() , m_shouldRender(false) , m_dirtyViews(false) , m_skipFrame(false) + , m_skippedLastFrame(false) , m_allowRendering(0) , m_compositingMode(Scene3DItem::FBO) { @@ -235,9 +236,16 @@ void Scene3DRenderer::beforeSynchronize() m_skipFrame = false; ContextSaver saver; static_cast<QRenderAspectPrivate*>(QRenderAspectPrivate::get(m_renderAspect))->renderSynchronous(false); + + // Ensure the QtQuick GL state is reset to prevent previous Qt3D calls from leaving some objects bound in the state + if (!m_skippedLastFrame) + m_window->resetOpenGLState(); + + m_skippedLastFrame = true; return; } + m_skippedLastFrame = false; m_shouldRender = true; // Check size / multisampling diff --git a/src/quick3d/imports/scene3d/scene3drenderer_p.h b/src/quick3d/imports/scene3d/scene3drenderer_p.h index 22ce478e1..7c749b513 100644 --- a/src/quick3d/imports/scene3d/scene3drenderer_p.h +++ b/src/quick3d/imports/scene3d/scene3drenderer_p.h @@ -123,6 +123,7 @@ private: bool m_shouldRender; bool m_dirtyViews; bool m_skipFrame; + bool m_skippedLastFrame; QSemaphore m_allowRendering; Scene3DItem::CompositingMode m_compositingMode; QVector<Scene3DView *> m_views; diff --git a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp index 938747a95..44c75a4df 100644 --- a/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp +++ b/src/quick3d/quick3d/items/quick3dnodeinstantiator.cpp @@ -73,6 +73,7 @@ public: #endif void _q_createdItem(int, QObject *); void _q_modelUpdated(const QQmlChangeSet &, bool); + QObject *modelObject(int index, bool async); bool m_componentComplete:1; bool m_effectiveReset:1; @@ -81,6 +82,7 @@ public: #if QT_CONFIG(qml_delegate_model) bool m_ownModel:1; #endif + int m_requestedIndex; QVariant m_model; QQmlInstanceModel *m_instanceModel; QQmlComponent *m_delegate; @@ -99,6 +101,7 @@ Quick3DNodeInstantiatorPrivate::Quick3DNodeInstantiatorPrivate() #if QT_CONFIG(qml_delegate_model) , m_ownModel(false) #endif + , m_requestedIndex(-1) , m_model(QVariant(1)) , m_instanceModel(0) , m_delegate(0) @@ -129,6 +132,14 @@ void Quick3DNodeInstantiatorPrivate::clear() emit q->objectChanged(); } +QObject *Quick3DNodeInstantiatorPrivate::modelObject(int index, bool async) +{ + m_requestedIndex = index; + QObject *o = m_instanceModel->object(index, async ? QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested); + m_requestedIndex = -1; + return o; +} + void Quick3DNodeInstantiatorPrivate::regenerate() { Q_Q(Quick3DNodeInstantiator); @@ -146,8 +157,7 @@ void Quick3DNodeInstantiatorPrivate::regenerate() } for (int i = 0; i < m_instanceModel->count(); i++) { - QObject *object = m_instanceModel->object(i, m_async ? - QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested); + QObject *object = modelObject(i, m_async); // If the item was already created we won't get a createdItem if (object) _q_createdItem(i, object); @@ -161,8 +171,19 @@ void Quick3DNodeInstantiatorPrivate::_q_createdItem(int idx, QObject *item) Q_Q(Quick3DNodeInstantiator); if (m_objects.contains(item)) //Case when it was created synchronously in regenerate return; + if (m_requestedIndex != idx) // Asynchronous creation, reference the object | + (void)m_instanceModel->object(idx); static_cast<QNode *>(item)->setParent(q->parentNode()); - m_objects.insert(idx, item); + if (m_objects.size() < idx + 1) { + int modelCount = m_instanceModel->count(); + if (m_objects.capacity() < modelCount) + m_objects.reserve(modelCount); + m_objects.resize(idx + 1); + } + if (QObject *o = m_objects.at(idx)) + m_instanceModel->release(o); + m_objects.replace(idx, item); + if (m_objects.count() == 1) emit q->objectChanged(); emit q->objectAdded(idx, item); @@ -213,11 +234,14 @@ void Quick3DNodeInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &change QVector<QPointer<QObject> > movedObjects = moved.value(insert.moveId); m_objects = m_objects.mid(0, index) + movedObjects + m_objects.mid(index); } else for (int i = 0; i < insert.count; ++i) { - int modelIndex = index + i; - QObject *obj = m_instanceModel->object(modelIndex, m_async ? - QQmlIncubator::Asynchronous : QQmlIncubator::AsynchronousIfNested); - if (obj) - _q_createdItem(modelIndex, obj); + if (insert.index <= m_objects.count()) + m_objects.insert(insert.index, insert.count, nullptr); + for (int i = 0; i < insert.count; ++i) { + int modelIndex = index + i; + QObject *obj = modelObject(modelIndex, m_async); + if (obj) + _q_createdItem(modelIndex, obj); + } } difference += insert.count; } diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/data/createMultipleAsync.qml b/tests/auto/quick3d/quick3dnodeinstantiator/data/createMultipleAsync.qml new file mode 100644 index 000000000..be6c46582 --- /dev/null +++ b/tests/auto/quick3d/quick3dnodeinstantiator/data/createMultipleAsync.qml @@ -0,0 +1,13 @@ +import QtQml 2.1 +import Qt3D.Core 2.0 + +Entity { + NodeInstantiator { + model: 10 + asynchronous: true + delegate: Entity { + property bool success: true + property int idx: index + } + } +} diff --git a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp index 501b3d9bf..1e7d6c593 100644 --- a/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp +++ b/tests/auto/quick3d/quick3dnodeinstantiator/tst_quick3dnodeinstantiator.cpp @@ -39,6 +39,7 @@ #include <QtQml/qqmlengine.h> #include <QtQml/qqmlcomponent.h> #include <QtQml/qqmlcontext.h> +#include <QtQml/qqmlincubator.h> using namespace Qt3DCore::Quick; @@ -55,6 +56,8 @@ private slots: void activeProperty(); void intModelChange(); void createAndRemove(); + void asynchronous_data(); + void asynchronous(); }; void tst_quick3dnodeinstantiator::createNone() @@ -251,6 +254,48 @@ void tst_quick3dnodeinstantiator::createAndRemove() QCOMPARE(object->property("datum").toString(), names[i]); } } + +void tst_quick3dnodeinstantiator::asynchronous_data() +{ + QTest::addColumn<bool>("asyncIncubator"); + QTest::addColumn<QString>("fileName"); + + QTest::newRow("Asynchronous Instantiator") << false << "createMultipleAsync.qml"; + QTest::newRow("Nested-asynchronous Instantiator") << true << "createMultiple.qml"; +} + +void tst_quick3dnodeinstantiator::asynchronous() +{ + QFETCH(bool, asyncIncubator); + QFETCH(QString, fileName); + + QQmlEngine engine; + QQmlIncubationController incubationController; + engine.setIncubationController(&incubationController); + QQmlComponent component(&engine, testFileUrl(fileName)); + QQmlIncubator incubator(asyncIncubator ? QQmlIncubator::Asynchronous : QQmlIncubator::Synchronous); + component.create(incubator); + while (!incubator.isReady()) + incubationController.incubateFor(10); + QObject *rootObject = incubator.object(); + QVERIFY(rootObject != nullptr); + while (incubationController.incubatingObjectCount() > 0) + incubationController.incubateFor(10); + Quick3DNodeInstantiator *instantiator = rootObject->findChild<Quick3DNodeInstantiator *>(); + QVERIFY(instantiator != nullptr); + QCOMPARE(instantiator->isActive(), true); + QCOMPARE(instantiator->count(), 10); + + for (int i=0; i<10; i++) { + QObject *object = instantiator->objectAt(i); + QVERIFY(object); + QCOMPARE(object->parent(), rootObject); + QCOMPARE(object->property("success").toBool(), true); + QCOMPARE(object->property("idx").toInt(), i); + } +} + + QTEST_MAIN(tst_quick3dnodeinstantiator) #include "tst_quick3dnodeinstantiator.moc" diff --git a/tests/auto/render/opengl/renderviews/tst_renderviews.cpp b/tests/auto/render/opengl/renderviews/tst_renderviews.cpp index aec13071a..196ee85d4 100644 --- a/tests/auto/render/opengl/renderviews/tst_renderviews.cpp +++ b/tests/auto/render/opengl/renderviews/tst_renderviews.cpp @@ -307,6 +307,68 @@ private Q_SLOTS: << (QVector<ShaderParameterPack>() << pack1 << minifiedPack1 << minifiedPack1 << pack1 << minifiedPack1 << minifiedPack1); } + void checkShaderParameterPackStoresSingleUBOPerBlockIndex() + { + // GIVEN + ShaderParameterPack pack; + auto nodeId1 = Qt3DCore::QNodeId::createId(); + auto nodeId2 = Qt3DCore::QNodeId::createId(); + + BlockToUBO ubo1 { 1, nodeId1, false, {}}; + BlockToUBO ubo2 { 1, nodeId2, false, {}}; + + // WHEN + pack.setUniformBuffer(ubo1); + pack.setUniformBuffer(ubo2); + + // THEN + QCOMPARE(pack.uniformBuffers().size(), 1); + QCOMPARE(pack.uniformBuffers().front().m_blockIndex, 1); + QCOMPARE(pack.uniformBuffers().front().m_bufferID, nodeId2); + + // WHEN + BlockToUBO ubo3 { 2, nodeId2, false, {}}; + pack.setUniformBuffer(ubo3); + + // THEN + QCOMPARE(pack.uniformBuffers().size(), 2); + QCOMPARE(pack.uniformBuffers().front().m_blockIndex, 1); + QCOMPARE(pack.uniformBuffers().front().m_bufferID, nodeId2); + QCOMPARE(pack.uniformBuffers().back().m_blockIndex, 2); + QCOMPARE(pack.uniformBuffers().back().m_bufferID, nodeId2); + } + + void checkShaderParameterPackStoresSingleSSBOPerBlockIndex() + { + // GIVEN + ShaderParameterPack pack; + auto nodeId1 = Qt3DCore::QNodeId::createId(); + auto nodeId2 = Qt3DCore::QNodeId::createId(); + + BlockToSSBO ssbo1 { 1, 0, nodeId1}; + BlockToSSBO ssbo2 { 1, 0, nodeId2}; + + // WHEN + pack.setShaderStorageBuffer(ssbo1); + pack.setShaderStorageBuffer(ssbo2); + + // THEN + QCOMPARE(pack.shaderStorageBuffers().size(), 1); + QCOMPARE(pack.shaderStorageBuffers().front().m_blockIndex, 1); + QCOMPARE(pack.shaderStorageBuffers().front().m_bufferID, nodeId2); + + // WHEN + BlockToSSBO ssbo3 { 2, 1, nodeId2}; + pack.setShaderStorageBuffer(ssbo3); + + // THEN + QCOMPARE(pack.shaderStorageBuffers().size(), 2); + QCOMPARE(pack.shaderStorageBuffers().front().m_blockIndex, 1); + QCOMPARE(pack.shaderStorageBuffers().front().m_bufferID, nodeId2); + QCOMPARE(pack.shaderStorageBuffers().back().m_blockIndex, 2); + QCOMPARE(pack.shaderStorageBuffers().back().m_bufferID, nodeId2); + } + void checkRenderViewUniformMinification() { QFETCH(QVector<QShaderProgram*>, shaders); diff --git a/tests/auto/render/raycasting/BLACKLIST b/tests/auto/render/raycasting/BLACKLIST new file mode 100644 index 000000000..8d957b4ca --- /dev/null +++ b/tests/auto/render/raycasting/BLACKLIST @@ -0,0 +1,3 @@ +# See qtbase/src/testlib/qtestblacklist.cpp for format +[shouldReturnAllResults] +ci ubuntu-20.04 # QTBUG-108918 |