summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-09-24 17:55:53 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-09-25 09:24:42 +0200
commit8059632fbdd656a4892918745244fd84a746ee93 (patch)
treed4909a9c9f0373ba5e697574fb3ef8fbf78a4ae0
parent60871b4fdf1ec977498ec4baa1d33c0972ac434f (diff)
rhi: Drop the zeroing out of resource binding structsv6.0.0-alpha1
This has a non-insignificant cost (since the size is at least 260 bytes) in renderers that construct a lot of these objects per frame. After changing the qHash implementation to be lighter we no longer rely on qHashBits, so zeroing it is not essential anymore. Remove it. Change-Id: If1fbd8dfd46fb3f0e9ea5a3c4794d24b8aeac1ba Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r--src/gui/rhi/qrhi.cpp8
-rw-r--r--src/gui/rhi/qrhi_p.h4
2 files changed, 2 insertions, 10 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
index 17a1ca91e2..d4ffc4d180 100644
--- a/src/gui/rhi/qrhi.cpp
+++ b/src/gui/rhi/qrhi.cpp
@@ -2859,14 +2859,6 @@ bool QRhiShaderResourceBindings::isLayoutCompatible(const QRhiShaderResourceBind
*/
/*!
- \internal
- */
-QRhiShaderResourceBinding::QRhiShaderResourceBinding()
-{
- memset(&d.u, 0, sizeof(d.u));
-}
-
-/*!
\return \c true if the layout is compatible with \a other. The layout does not
include the actual resource (such as, buffer or texture) and related
parameters (such as, offset or size).
diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h
index bdfaec9fdf..1d0b6ebfab 100644
--- a/src/gui/rhi/qrhi_p.h
+++ b/src/gui/rhi/qrhi_p.h
@@ -346,7 +346,7 @@ public:
};
Q_DECLARE_FLAGS(StageFlags, StageFlag)
- QRhiShaderResourceBinding();
+ QRhiShaderResourceBinding() = default;
bool isLayoutCompatible(const QRhiShaderResourceBinding &other) const;
@@ -415,7 +415,7 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QRhiShaderResourceBinding::StageFlags)
-Q_DECLARE_TYPEINFO(QRhiShaderResourceBinding, Q_MOVABLE_TYPE);
+Q_DECLARE_TYPEINFO(QRhiShaderResourceBinding, Q_PRIMITIVE_TYPE);
Q_GUI_EXPORT bool operator==(const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b) noexcept;
Q_GUI_EXPORT bool operator!=(const QRhiShaderResourceBinding &a, const QRhiShaderResourceBinding &b) noexcept;