diff options
Diffstat (limited to 'src/gui/rhi')
-rw-r--r-- | src/gui/rhi/qrhimetal.mm | 8 | ||||
-rw-r--r-- | src/gui/rhi/qrhimetal_p_p.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm index 6bdcfd70c8..d37a130d15 100644 --- a/src/gui/rhi/qrhimetal.mm +++ b/src/gui/rhi/qrhimetal.mm @@ -440,6 +440,12 @@ bool QRhiMetal::create(QRhi::Flags flags) } #endif + caps.supportedSampleCounts = { 1 }; + for (int sampleCount : { 2, 4, 8 }) { + if ([d->dev supportsTextureSampleCount: sampleCount]) + caps.supportedSampleCounts.append(sampleCount); + } + nativeHandlesStruct.dev = (MTLDevice *) d->dev; nativeHandlesStruct.cmdQueue = (MTLCommandQueue *) d->cmdQueue; @@ -469,7 +475,7 @@ void QRhiMetal::destroy() QVector<int> QRhiMetal::supportedSampleCounts() const { - return { 1, 2, 4, 8 }; + return caps.supportedSampleCounts; } int QRhiMetal::effectiveSampleCount(int sampleCount) const diff --git a/src/gui/rhi/qrhimetal_p_p.h b/src/gui/rhi/qrhimetal_p_p.h index 72a4d82888..579a2063ae 100644 --- a/src/gui/rhi/qrhimetal_p_p.h +++ b/src/gui/rhi/qrhimetal_p_p.h @@ -482,6 +482,7 @@ public: struct { int maxTextureSize = 4096; bool baseVertexAndInstance = true; + QVector<int> supportedSampleCounts; } caps; QRhiMetalData *d = nullptr; |