From a8be40bd64b9258334d6936b1775bc6631fd158d Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 9 Nov 2021 13:18:15 +0100 Subject: rhi: Expose the maximum uniform buffer range limit Pick-to: 6.2 Task-number: QTBUG-97715 Change-Id: I7f0a52c410b9b77f735fb3b7fd33141674bb0cda Reviewed-by: Qt CI Bot Reviewed-by: Andy Nichols --- src/gui/rhi/qrhi.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gui/rhi/qrhi.cpp') diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index efa3c1893d..952183f55e 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -776,6 +776,12 @@ Q_LOGGING_CATEGORY(QRHI_LOG_INFO, "qt.rhi.general") \value TextureArraySizeMax Maximum texture array size. Typically in range 256 - 2048. Attempting to \l{QRhi::newTextureArray()}{create a texture array} with more elements will likely fail. + + \value MaxUniformBufferRange The number of bytes that can be exposed from a + uniform buffer to the shaders at once. On OpenGL ES 2.0 and 3.0 + implementations this may be as low as 3584 bytes (224 four component, 32 + bits per component vectors). Elsewhere the value is typically 16384 (1024 + vec4s) or 65536 (4096 vec4s). */ /*! @@ -3228,6 +3234,9 @@ bool QRhiShaderResourceBinding::isLayoutCompatible(const QRhiShaderResourceBindi suitable for creating pipelines. Such a pipeline must then always be used together with another, layout compatible QRhiShaderResourceBindings with resources present passed to QRhiCommandBuffer::setShaderResources(). + + \note If the size of \a buf exceeds the limit reported for + QRhi::MaxUniformBufferRange, unexpected errors may occur. */ QRhiShaderResourceBinding QRhiShaderResourceBinding::uniformBuffer( int binding, StageFlags stage, QRhiBuffer *buf) @@ -3262,6 +3271,9 @@ QRhiShaderResourceBinding QRhiShaderResourceBinding::uniformBuffer( suitable for creating pipelines. Such a pipeline must then always be used together with another, layout compatible QRhiShaderResourceBindings with resources present passed to QRhiCommandBuffer::setShaderResources(). + + \note If \a size exceeds the limit reported for QRhi::MaxUniformBufferRange, + unexpected errors may occur. */ QRhiShaderResourceBinding QRhiShaderResourceBinding::uniformBuffer( int binding, StageFlags stage, QRhiBuffer *buf, int offset, int size) @@ -3296,6 +3308,9 @@ QRhiShaderResourceBinding QRhiShaderResourceBinding::uniformBuffer( suitable for creating pipelines. Such a pipeline must then always be used together with another, layout compatible QRhiShaderResourceBindings with resources present passed to QRhiCommandBuffer::setShaderResources(). + + \note If \a size exceeds the limit reported for QRhi::MaxUniformBufferRange, + unexpected errors may occur. */ QRhiShaderResourceBinding QRhiShaderResourceBinding::uniformBufferWithDynamicOffset( int binding, StageFlags stage, QRhiBuffer *buf, int size) -- cgit v1.2.3