summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2020-06-29 15:38:41 +0200
committerPaul Lemire <paul.lemire@kdab.com>2020-07-03 09:29:43 +0200
commit390c4f1040114dd92a76093f5417e2b6e794e795 (patch)
treeb0e0688875016bcf86ab7bfb440afe6353c77cd8 /src/render
parent458d67ee9ee998e870534ff0d97e85e63d6c1a28 (diff)
AttachmentPack: use std::vector
Change-Id: Iba6a5ca2a1b7f5bb1d93d1e406f23f31f6f1efd1 Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/render')
-rw-r--r--src/render/backend/attachmentpack.cpp6
-rw-r--r--src/render/backend/attachmentpack_p.h10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/render/backend/attachmentpack.cpp b/src/render/backend/attachmentpack.cpp
index 0cd5d8673..00b70a7aa 100644
--- a/src/render/backend/attachmentpack.cpp
+++ b/src/render/backend/attachmentpack.cpp
@@ -59,13 +59,13 @@ AttachmentPack::AttachmentPack(const RenderTarget *target,
for (Qt3DCore::QNodeId outputId : outputIds) {
const RenderTargetOutput *output = attachmentManager->lookupResource(outputId);
if (output)
- m_attachments.append(*output->attachment());
+ m_attachments.push_back(*output->attachment());
}
// Create actual DrawBuffers list that is used for glDrawBuffers
// If nothing is specified, use all the attachments as draw buffers
- if (drawBuffers.isEmpty()) {
+ if (drawBuffers.empty()) {
m_drawBuffers.reserve(m_attachments.size());
for (const Attachment &attachment : qAsConst(m_attachments))
// only consider Color Attachments
@@ -82,7 +82,7 @@ AttachmentPack::AttachmentPack(const RenderTarget *target,
// return index of given attachment within actual draw buffers list
int AttachmentPack::getDrawBufferIndex(QRenderTargetOutput::AttachmentPoint attachmentPoint) const
{
- for (int i = 0; i < m_drawBuffers.size(); i++)
+ for (size_t i = 0; i < m_drawBuffers.size(); i++)
if (m_drawBuffers.at(i) == (int)attachmentPoint)
return i;
return -1;
diff --git a/src/render/backend/attachmentpack_p.h b/src/render/backend/attachmentpack_p.h
index 7f3733a65..473f48489 100644
--- a/src/render/backend/attachmentpack_p.h
+++ b/src/render/backend/attachmentpack_p.h
@@ -87,17 +87,17 @@ public:
AttachmentPack();
AttachmentPack(const RenderTarget *target,
AttachmentManager *attachmentManager,
- const QVector<QRenderTargetOutput::AttachmentPoint> &drawBuffers = QVector<QRenderTargetOutput::AttachmentPoint>());
+ const QVector<QRenderTargetOutput::AttachmentPoint> &drawBuffers = {});
- QVector<Attachment> attachments() const { return m_attachments; }
- QVector<int> getGlDrawBuffers() const { return m_drawBuffers; }
+ const std::vector<Attachment> &attachments() const { return m_attachments; }
+ const std::vector<int> &getGlDrawBuffers() const { return m_drawBuffers; }
// return index of given attachment within actual draw buffers list
int getDrawBufferIndex(QRenderTargetOutput::AttachmentPoint attachmentPoint) const;
private:
- QVector<Attachment> m_attachments;
- QVector<int> m_drawBuffers;
+ std::vector<Attachment> m_attachments;
+ std::vector<int> m_drawBuffers;
};
Q_3DRENDERSHARED_PRIVATE_EXPORT bool operator ==(const Attachment &a, const Attachment &b);