diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-09-01 12:26:39 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-09-03 17:14:59 +0200 |
commit | 6cdf95a970f499f7d724e79638856a71942dd30d (patch) | |
tree | 96a946b51d5494a1db02324a4082812981122fbe /src/gui/rhi/qrhi_p.h | |
parent | aac1858920864ac0939fd7b17b49fb76a83f0f70 (diff) |
rhi: Include resource count in srb layout compatibility checks
Relevant for Vulkan, given that descriptorCount is part of
VkDescriptorSetLayoutBinding, meaning two srbs with arrays of
SampledTextures should only be reported as compatible if the
array size matches.
Also reduces the prealloc size for the VLAs. For Qt Quick even a
lower number would be sufficient, but we still keep the number
something fairly high in order to play nice with Quick3D.
Pick-to: 6.2
Change-Id: Id92b7c09b051ebe54b1fa2bf4ba78950fe60ba27
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi_p.h')
-rw-r--r-- | src/gui/rhi/qrhi_p.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h index c2a09b7edf..1f05b7da8a 100644 --- a/src/gui/rhi/qrhi_p.h +++ b/src/gui/rhi/qrhi_p.h @@ -1040,10 +1040,12 @@ public: virtual bool create() = 0; protected: + static const int BINDING_PREALLOC = 12; + static const int LAYOUT_DESC_FIELD_COUNT = 4; QRhiShaderResourceBindings(QRhiImplementation *rhi); - QVarLengthArray<QRhiShaderResourceBinding, 16> m_bindings; + QVarLengthArray<QRhiShaderResourceBinding, BINDING_PREALLOC> m_bindings; uint m_layoutDescHash = 0; - QVarLengthArray<uint, 16 * 3> m_layoutDesc; + QVarLengthArray<uint, BINDING_PREALLOC * LAYOUT_DESC_FIELD_COUNT> m_layoutDesc; friend class QRhiImplementation; #ifndef QT_NO_DEBUG_STREAM friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QRhiShaderResourceBindings &); |