diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-10-13 19:29:00 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-10-16 09:48:09 +0200 |
commit | 0461c535fcb26ea231ee8645e67ef2e8d4429e95 (patch) | |
tree | edfaba6cc782e0a3c281d28aa2956ae2a3ddedd4 /src/gui/rhi/qrhigles2_p_p.h | |
parent | 802d98d318d1dabf377d1030b81e99fe57f1b483 (diff) |
rhi: Further reduce copying in the command buffer
Change-Id: I2e2ff5f4b8aa91d0accb01108a5199b98c371455
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhigles2_p_p.h')
-rw-r--r-- | src/gui/rhi/qrhigles2_p_p.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gui/rhi/qrhigles2_p_p.h b/src/gui/rhi/qrhigles2_p_p.h index 6ce3786445..a231740c66 100644 --- a/src/gui/rhi/qrhigles2_p_p.h +++ b/src/gui/rhi/qrhigles2_p_p.h @@ -315,6 +315,9 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer ~QGles2CommandBuffer(); void destroy() override; + // keep at a reasonably low value otherwise sizeof Command explodes + static const int MAX_DYNAMIC_OFFSET_COUNT = 8; + struct Command { enum Cmd { BeginFrame, @@ -348,12 +351,9 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer }; Cmd cmd; - // keep at a reasonably low value otherwise sizeof Command explodes - static const int MAX_DYNAMIC_OFFSET_COUNT = 8; - // QRhi*/QGles2* references should be kept at minimum (so no // QRhiTexture/Buffer/etc. pointers). - union { + union Args { struct { float x, y, w, h; float d0, d1; @@ -526,7 +526,7 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer ComputePass }; - QVarLengthArray<Command, 1024> commands; + QRhiBackendCommandList<Command> commands; QVarLengthArray<QRhiPassResourceTracker, 8> passResTrackers; int currentPassResTrackerIndex; @@ -614,7 +614,7 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer return imageRetainPool.last().constBits(); } void resetCommands() { - commands.clear(); + commands.reset(); dataRetainPool.clear(); bufferDataRetainPool.clear(); imageRetainPool.clear(); @@ -642,8 +642,6 @@ struct QGles2CommandBuffer : public QRhiCommandBuffer } }; -Q_DECLARE_TYPEINFO(QGles2CommandBuffer::Command, Q_MOVABLE_TYPE); - inline bool operator==(const QGles2CommandBuffer::GraphicsPassState::StencilFace &a, const QGles2CommandBuffer::GraphicsPassState::StencilFace &b) { |