summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@qt.io>2017-10-19 16:16:23 +0200
committerChristian Stromme <christian.stromme@qt.io>2017-11-14 11:56:59 +0000
commitacdf4433b7b8e022b3962cf05188d9da2513b31c (patch)
tree314f43a04fd47957ab5ee329fef3df7d50ccbdf5
parentbd869471eab2fdadc3286c1b9f273f4c6aa37e25 (diff)
Reserve vector size ahead of time in the AttachmentPack class
Change-Id: Iaed11a9bc23da076dff7006d7aa34f17c6c2aac8 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/render/backend/attachmentpack.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/render/backend/attachmentpack.cpp b/src/render/backend/attachmentpack.cpp
index 6dee7587b..9a08fdde4 100644
--- a/src/render/backend/attachmentpack.cpp
+++ b/src/render/backend/attachmentpack.cpp
@@ -67,11 +67,13 @@ AttachmentPack::AttachmentPack(const RenderTargetSelector *selector, const Rende
// If nothing is specified, use all the attachments as draw buffers
if (selectedAttachmentPoints.isEmpty()) {
+ m_drawBuffers.reserve(m_attachments.size());
for (const Attachment &attachment : qAsConst(m_attachments))
// only consider Color Attachments
if (attachment.m_point <= QRenderTargetOutput::Color15)
m_drawBuffers.push_back((int) attachment.m_point);
} else {
+ m_drawBuffers.reserve(selectedAttachmentPoints.size());
for (QRenderTargetOutput::AttachmentPoint drawBuffer : selectedAttachmentPoints)
if (drawBuffer <= QRenderTargetOutput::Color15)
m_drawBuffers.push_back((int) drawBuffer);