summaryrefslogtreecommitdiffstats
path: root/tests/manual/rhi/triquadcube
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-10-02 10:58:44 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-10-03 09:37:48 +0200
commitf1c7814a55903dad5a5e77683bdcca5fc3805394 (patch)
tree3de4f3da1506349d7ed06cc4d6593bfd499383ba /tests/manual/rhi/triquadcube
parent1a8f4a3c8fa30265e7f184373c738dbc3574663a (diff)
rhi: Remove QVectors from the data description structs as well
As usual, keep some QVector overloads around to allow Qt Quick to compile. Color attachments and vertex input bindings get an at(index) type of accessor, unlike any other of similar lists. This is because there the index is significant, and sequential iteration is not the only type of operation that is performed. Sometimes a lookup based on an index will be needed as well. Task-number: QTBUG-78883 Change-Id: I3882941f09e94ee2f179e0e9b8161551f0d5dae7 Reviewed-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/manual/rhi/triquadcube')
-rw-r--r--tests/manual/rhi/triquadcube/texturedcuberenderer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp b/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
index 3f15881e2d..8c5845d4fc 100644
--- a/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
+++ b/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
@@ -181,16 +181,18 @@ void TexturedCubeRenderer::queueResourceUpdates(QRhiResourceUpdateBatch *resourc
if (!m_image.isNull()) {
if (MIPMAP) {
- QRhiTextureUploadDescription desc;
+ QVarLengthArray<QRhiTextureUploadEntry, 16> descEntries;
if (!AUTOGENMIPMAP) {
// the ghetto mipmap generator...
for (int i = 0, ie = m_r->mipLevelsForSize(m_image.size()); i != ie; ++i) {
QImage image = m_image.scaled(m_r->sizeForMipLevel(i, m_image.size()));
- desc.append({ 0, i, image });
+ descEntries.append({ 0, i, image });
}
} else {
- desc.append({ 0, 0, m_image });
+ descEntries.append({ 0, 0, m_image });
}
+ QRhiTextureUploadDescription desc;
+ desc.setEntries(descEntries.cbegin(), descEntries.cend());
resourceUpdates->uploadTexture(m_tex, desc);
if (AUTOGENMIPMAP)
resourceUpdates->generateMips(m_tex);