diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-22 19:03:19 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-23 16:59:06 +0200 |
commit | 230be3c4d1e53d7024064b926010131c6a83762f (patch) | |
tree | 05410d952d2795a56ce45a53ecd35f39d8e23004 /src/gui/rhi/qrhi_p_p.h | |
parent | 5fcd9a3ebf83bc0700f32819d620c320b3844fd9 (diff) |
rhi: Report an "optimal capacity" from res.update batches
Change-Id: If47eddf3fe7d365c80b0a15712ef155a6898d904
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi_p_p.h')
-rw-r--r-- | src/gui/rhi/qrhi_p_p.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhi_p_p.h b/src/gui/rhi/qrhi_p_p.h index ef27be6d7d..7fadcfcc1e 100644 --- a/src/gui/rhi/qrhi_p_p.h +++ b/src/gui/rhi/qrhi_p_p.h @@ -383,8 +383,10 @@ public: } }; - QVarLengthArray<BufferOp, 1024> bufferOps; - QVarLengthArray<TextureOp, 256> textureOps; + static const int BUFFER_OPS_STATIC_ALLOC = 1024; + QVarLengthArray<BufferOp, BUFFER_OPS_STATIC_ALLOC> bufferOps; + static const int TEXTURE_OPS_STATIC_ALLOC = 256; + QVarLengthArray<TextureOp, TEXTURE_OPS_STATIC_ALLOC> textureOps; QRhiResourceUpdateBatch *q = nullptr; QRhiImplementation *rhi = nullptr; @@ -392,6 +394,7 @@ public: void free(); void merge(QRhiResourceUpdateBatchPrivate *other); + bool hasOptimalCapacity() const; static QRhiResourceUpdateBatchPrivate *get(QRhiResourceUpdateBatch *b) { return b->d; } }; |