Commit 75accb90 authored by Laszlo Agocs's avatar Laszlo Agocs
Browse files

mtl: report a proper max texture size

try to deal with the nonsense feature set api
parent 5bf111aa
......@@ -240,6 +240,29 @@ bool QRhiMetal::create(QRhi::Flags flags)
d->cmdQueue = [d->dev newCommandQueue];
#if defined(Q_OS_MACOS)
caps.maxTextureSize = 16384;
#elif defined(Q_OS_TVOS)
if ([d->dev supportsFeatureSet: MTLFeatureSet(30003)]) // MTLFeatureSet_tvOS_GPUFamily2_v1
caps.maxTextureSize = 16384;
else
caps.maxTextureSize = 8192;
#elif defined(Q_OS_IOS)
// welcome to feature set hell
if ([d->dev supportsFeatureSet: MTLFeatureSet(16)] // MTLFeatureSet_iOS_GPUFamily5_v1
|| [d->dev supportsFeatureSet: MTLFeatureSet(11)] // MTLFeatureSet_iOS_GPUFamily4_v1
|| [d->dev supportsFeatureSet: MTLFeatureSet(4)]) // MTLFeatureSet_iOS_GPUFamily3_v1
{
caps.maxTextureSize = 16384;
} else if ([d->dev supportsFeatureSet: MTLFeatureSet(3)] // MTLFeatureSet_iOS_GPUFamily2_v2
|| [d->dev supportsFeatureSet: MTLFeatureSet(2)]) // MTLFeatureSet_iOS_GPUFamily1_v2
{
caps.maxTextureSize = 8192;
} else {
caps.maxTextureSize = 4096;
}
#endif
nativeHandlesStruct.dev = d->dev;
nativeHandlesStruct.cmdQueue = d->cmdQueue;
......@@ -348,7 +371,7 @@ int QRhiMetal::resourceSizeLimit(QRhi::ResourceSizeLimit limit) const
case QRhi::TextureSizeMin:
return 1;
case QRhi::TextureSizeMax:
return 16384; // ###
return caps.maxTextureSize;
default:
Q_UNREACHABLE();
return 0;
......
......@@ -344,6 +344,10 @@ public:
QSet<QMetalSwapChain *> swapchains;
QRhiMetalNativeHandles nativeHandlesStruct;
struct {
int maxTextureSize = 4096;
} caps;
QRhiMetalData *d = nullptr;
};
......
prof report api (fed by a cbor stream)
gl: debug: object names
gl: debug: markers (begin, end, msg)
mtl: max texture size
prof: report readback temp buf
multiwindow_threaded should demo pulling out the device and importing to another rhi
merge offscreen examples into one
......@@ -54,6 +53,7 @@ dxc for d3d as an alternative to fxc?
hlsl -> dxc -> spirv -> spirv-cross hmmm...
+++ done
mtl: max texture size
vk: obj name and debug markers
vk, gl: tex and other prof
max texture size stuff
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment