diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-17 15:38:40 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-18 09:49:54 +0200 |
commit | 8fe16fef283d281454d575829c2411ec923a5c8b (patch) | |
tree | 4bebd4a80c8d78776f14cc16ab4d79f16caa9dda /src/gui/rhi/qrhivulkan.cpp | |
parent | 6f2c7469f86785e6ba81fe0280210ef7275099de (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/qrhivulkan.cpp')
-rw-r--r-- | src/gui/rhi/qrhivulkan.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index b172a8b16b..e4ad562805 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -4124,6 +4124,18 @@ int QRhiVulkan::resourceLimit(QRhi::ResourceLimit limit) const return QVK_FRAMES_IN_FLIGHT; case QRhi::MaxAsyncReadbackFrames: return QVK_FRAMES_IN_FLIGHT; + case QRhi::MaxThreadGroupsPerDimension: + return int(qMin(physDevProperties.limits.maxComputeWorkGroupCount[0], + qMin(physDevProperties.limits.maxComputeWorkGroupCount[1], + physDevProperties.limits.maxComputeWorkGroupCount[2]))); + case QRhi::MaxThreadsPerThreadGroup: + return int(physDevProperties.limits.maxComputeWorkGroupInvocations); + case QRhi::MaxThreadGroupX: + return int(physDevProperties.limits.maxComputeWorkGroupSize[0]); + case QRhi::MaxThreadGroupY: + return int(physDevProperties.limits.maxComputeWorkGroupSize[1]); + case QRhi::MaxThreadGroupZ: + return int(physDevProperties.limits.maxComputeWorkGroupSize[2]); default: Q_UNREACHABLE(); return 0; |