Description
This is already done in QRhiCommandBuffer (because recording draw calls has higher frequency than e.g. pipeline (re)creation), perhaps expand to the whole api (to reduce allocations).
As found out during QTBUG-78792, there are further potential pitfalls with the following approach:
QVector<Something> somethings() const; void setSomethings(const QVector<Something> &);
Especially in QRhiShaderResourceBinding, where one may create a QRhiShaderResourceBinding set just to look up an srb in a cache (e.g. a QHash). This is very heavy as it stands since one has to create a QVector of d-pointered class. This is extremely wasteful when there is a cache hit since we did all those allocs for nothing basically.
Note that this does not cover the freely copyable "description" structs like QRhiVertexInputLayout. Those should be looked at separately, if moving away from QVector is sensible and if it would bring any visible improvements in practice.
Attachments
Issue Links
- is required for
-
QTBUG-78587 Identify and possibly fix performance issues with qmlbench on the QRhi based rendering path in Qt Quick
- Closed
- relates to
-
QTBUG-78792 Varied performance in scenes with > 1000 unbatched geometry nodes
- Closed
- mentioned in
-
Page Loading...