summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhimetal.mm
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/qrhimetal.mm
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/qrhimetal.mm')
-rw-r--r--src/gui/rhi/qrhimetal.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm
index fbb2003fb2..2736377c78 100644
--- a/src/gui/rhi/qrhimetal.mm
+++ b/src/gui/rhi/qrhimetal.mm
@@ -587,6 +587,20 @@ int QRhiMetal::resourceLimit(QRhi::ResourceLimit limit) const
return QMTL_FRAMES_IN_FLIGHT;
case QRhi::MaxAsyncReadbackFrames:
return QMTL_FRAMES_IN_FLIGHT;
+ case QRhi::MaxThreadGroupsPerDimension:
+ return 65535;
+ case QRhi::MaxThreadsPerThreadGroup:
+ Q_FALLTHROUGH();
+ case QRhi::MaxThreadGroupX:
+ Q_FALLTHROUGH();
+ case QRhi::MaxThreadGroupY:
+ Q_FALLTHROUGH();
+ case QRhi::MaxThreadGroupZ:
+#if defined(Q_OS_MACOS)
+ return 1024;
+#else
+ return 512;
+#endif
default:
Q_UNREACHABLE();
return 0;