[Impeller] fix device buffer nullptr on Intel macOS. (#160645)
Fixes https://github.com/flutter/flutter/issues/159278 macOS intel devices uses MTLResourceStorageModeManaged which is still host visible
This commit is contained in:
parent
cb40d94055
commit
5c7d9d01ba
@ -23,9 +23,17 @@ id<MTLBuffer> DeviceBufferMTL::GetMTLBuffer() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* DeviceBufferMTL::OnGetContents() const {
|
uint8_t* DeviceBufferMTL::OnGetContents() const {
|
||||||
|
#if !FML_OS_IOS
|
||||||
|
if (storage_mode_ != MTLStorageModeShared &&
|
||||||
|
storage_mode_ != MTLResourceStorageModeManaged) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (storage_mode_ != MTLStorageModeShared) {
|
if (storage_mode_ != MTLStorageModeShared) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
#endif // !FML_OS_IOS
|
||||||
|
|
||||||
return reinterpret_cast<uint8_t*>(buffer_.contents);
|
return reinterpret_cast<uint8_t*>(buffer_.contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user