Guard [MTLDevice recommendedMaxWorkingSetSize] only on MacOS
Bug: none Change-Id: Id5d23151953dfc5401776180b42d921adc22833b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25161 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
parent
4a4c76b8b5
commit
1233b66c90
|
@ -68,6 +68,7 @@ namespace dawn_native { namespace metal {
|
|||
if (currentSize > maxBufferSize) {
|
||||
return DAWN_OUT_OF_MEMORY_ERROR("Buffer allocation is too large");
|
||||
}
|
||||
#if defined(DAWN_PLATFORM_MACOS)
|
||||
} else if (@available(macOS 10.12, *)) {
|
||||
// |maxBufferLength| isn't always available on older systems. If available, use
|
||||
// |recommendedMaxWorkingSetSize| instead. We can probably allocate more than this,
|
||||
|
@ -77,6 +78,7 @@ namespace dawn_native { namespace metal {
|
|||
if (currentSize > maxWorkingSetSize) {
|
||||
return DAWN_OUT_OF_MEMORY_ERROR("Buffer allocation is too large");
|
||||
}
|
||||
#endif
|
||||
} else if (currentSize > kMaxBufferSizeFallback) {
|
||||
return DAWN_OUT_OF_MEMORY_ERROR("Buffer allocation is too large");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue