Avoid Metal validation error on MTLBuffer.contents access from private storage.

This commit is contained in:
Bill Hollings 2018-06-04 20:04:33 -04:00
parent 0c854c508d
commit c2324a574f

View File

@ -149,7 +149,7 @@ bool MVKDeviceMemory::ensureMTLBuffer() {
} else {
_mtlBuffer = [getMTLDevice() newBufferWithLength: memLen options: _mtlResourceOptions]; // retained
}
_pMemory = _mtlBuffer.contents;
_pMemory = isMemoryHostAccessible() ? _mtlBuffer.contents : nullptr;
return true;
}