summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhigles2_p_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-09-29 17:38:26 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-09-30 10:39:59 +0200
commit2f879062a5ce9e78c1e257924bcdc5ac95cba465 (patch)
tree34222dd886c8608d4ea7190763a67827f598e321 /src/gui/rhi/qrhigles2_p_p.h
parent0836db2330c0542d91fe61935e97d3369db93156 (diff)
rhi: Manage buffer data without QBA
Use a simple and straightforward container that only does what we need here. Change-Id: I1a81b53a58bc91d533e3d7df5471a1362046825d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhigles2_p_p.h')
-rw-r--r--src/gui/rhi/qrhigles2_p_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhigles2_p_p.h b/src/gui/rhi/qrhigles2_p_p.h
index 5940633151..65fb820a36 100644
--- a/src/gui/rhi/qrhigles2_p_p.h
+++ b/src/gui/rhi/qrhigles2_p_p.h
@@ -578,6 +578,7 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer
} computePassState;
QVarLengthArray<QByteArray, 4> dataRetainPool;
+ QVarLengthArray<QRhiBufferData, 4> bufferDataRetainPool;
QVarLengthArray<QImage, 4> imageRetainPool;
// relies heavily on implicit sharing (no copies of the actual data will be made)
@@ -585,6 +586,10 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer
dataRetainPool.append(data);
return dataRetainPool.last().constData();
}
+ const uchar *retainBufferData(const QRhiBufferData &data) {
+ bufferDataRetainPool.append(data);
+ return reinterpret_cast<const uchar *>(bufferDataRetainPool.last().constData());
+ }
const void *retainImage(const QImage &image) {
imageRetainPool.append(image);
return imageRetainPool.last().constBits();
@@ -592,6 +597,7 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer
void resetCommands() {
commands.clear();
dataRetainPool.clear();
+ bufferDataRetainPool.clear();
imageRetainPool.clear();
passResTrackers.clear();