|
23 | 23 | _SetFlag(HgiDeviceCapabilitiesBitsConcurrentDispatch, true); |
24 | 24 | } |
25 | 25 |
|
26 | | - bool const hasIntelGPU = [device isLowPower]; |
27 | | - |
| 26 | + bool hasIntelGPU = false; |
| 27 | +#if defined(ARCH_OS_OSX) |
| 28 | + hasIntelGPU = [device isLowPower]; |
| 29 | +#endif |
28 | 30 | defaultStorageMode = MTLResourceStorageModeShared; |
29 | 31 | bool unifiedMemory = false; |
30 | 32 | bool barycentrics = false; |
31 | 33 | bool hasAppleSilicon = false; |
32 | 34 | bool icbSupported = false; |
| 35 | + bool hasIos = false; |
33 | 36 | if (@available(macOS 100.100, ios 12.0, *)) { |
34 | 37 | unifiedMemory = true; |
35 | 38 | } else if (@available(macOS 10.15, ios 13.0, *)) { |
|
45 | 48 | || [device areBarycentricCoordsSupported]) |
46 | 49 | && !hasIntelGPU; |
47 | 50 |
|
| 51 | +#if defined(ARCH_OS_OSX) |
48 | 52 | hasAppleSilicon = [device hasUnifiedMemory] && ![device isLowPower]; |
49 | | - |
| 53 | +#endif |
50 | 54 | } |
51 | | - |
| 55 | + |
| 56 | + |
| 57 | +#if defined(ARCH_OS_IOS) |
| 58 | + hasIos = true; |
| 59 | +#endif |
| 60 | + |
52 | 61 | if (hasAppleSilicon) { |
53 | 62 | // Indirect command buffers supported only on |
54 | 63 | // Apple Silicon GPUs with macOS 12.3 or later. |
|
97 | 106 | if (hasIntelGPU) { |
98 | 107 | _SetFlag(HgiDeviceCapabilitiesBitsPrimitiveIdEmulation, true); |
99 | 108 | } |
100 | | - |
| 109 | + if (hasIos && !barycentrics) { |
| 110 | + _SetFlag(HgiDeviceCapabilitiesBitsPrimitiveIdEmulation, true); |
| 111 | + } |
| 112 | +#if defined(ARCH_OS_OSX) |
101 | 113 | if (!unifiedMemory) { |
102 | 114 | defaultStorageMode = MTLResourceStorageModeManaged; |
103 | 115 | } |
| 116 | +#endif |
104 | 117 |
|
105 | 118 | _maxUniformBlockSize = 64 * 1024; |
106 | 119 | _maxShaderStorageBlockSize = 1 * 1024 * 1024 * 1024; |
|
0 commit comments