summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhi.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-09-17 15:38:40 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-09-18 09:49:54 +0200
commit8fe16fef283d281454d575829c2411ec923a5c8b (patch)
tree4bebd4a80c8d78776f14cc16ab4d79f16caa9dda /src/gui/rhi/qrhi.cpp
parent6f2c7469f86785e6ba81fe0280210ef7275099de (diff)
rhi: Expose compute threadgroup limits in ResourceLimits
As OpenGL ES and Vulkan ruin the day with the spec mandated minimum value for max threads per threadgroup being only 128, clients need a way to decide if their compute shader (local_size_*) is suitable for use at run time. Change-Id: I72b4fc97032406340623add82ea4d9544ebe9fdc Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi.cpp')
-rw-r--r--src/gui/rhi/qrhi.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
index 06c3903b0c..794e6a6891 100644
--- a/src/gui/rhi/qrhi.cpp
+++ b/src/gui/rhi/qrhi.cpp
@@ -675,6 +675,32 @@ Q_LOGGING_CATEGORY(QRHI_LOG_INFO, "qt.rhi.general")
frames (including the one that contains the readback) after which an
asynchronous texture or buffer readback is guaranteed to complete upon
\l{QRhi::beginFrame()}{starting a new frame}.
+
+ \value MaxThreadGroupsPerDimension The maximum number of compute
+ work/thread groups that can be dispatched. Effectively the maximum value
+ for the arguments of QRhiCommandBuffer::dispatch(). Typically 65535.
+
+ \value MaxThreadsPerThreadGroup The maximum number of invocations in a
+ single local work group, or in other terminology, the maximum number of
+ threads in a thread group. Effectively the maximum value for the product of
+ \c local_size_x, \c local_size_y, and \c local_size_z in the compute
+ shader. Typical values are 128, 256, 512, 1024, or 1536. Watch out that
+ both OpenGL ES and Vulkan specify only 128 as the minimum required limit
+ for implementations. While uncommon for Vulkan, some OpenGL ES 3.1
+ implementations for mobile/embedded devices only support the spec-mandated
+ minimum value.
+
+ \value MaxThreadGroupX The maximum size of a work/thread group in the X
+ dimension. Effectively the maximum value of \c local_size_x in the compute
+ shader. Typically 256 or 1024.
+
+ \value MaxThreadGroupY The maximum size of a work/thread group in the Y
+ dimension. Effectively the maximum value of \c local_size_y in the compute
+ shader. Typically 256 or 1024.
+
+ \value MaxThreadGroupZ The maximum size of a work/thread group in the Z
+ dimension. Effectively the maximum value of \c local_size_z in the compute
+ shader. Typically 64 or 256.
*/
/*!