MVKBuffer: Force managed storage for linear textures on shared buffers.
Shared storage on textures is disallowed on macOS. Fixes #573.
This commit is contained in:
parent
1b60679104
commit
787086351f
@ -142,7 +142,16 @@ id<MTLTexture> MVKBufferView::getMTLTexture() {
|
|||||||
width: _textureSize.width
|
width: _textureSize.width
|
||||||
height: _textureSize.height
|
height: _textureSize.height
|
||||||
mipmapped: NO];
|
mipmapped: NO];
|
||||||
|
#if MVK_MACOS
|
||||||
|
// Textures on Mac cannot use shared storage, so force managed.
|
||||||
|
if (_buffer->getMTLBuffer().storageMode == MTLStorageModeShared) {
|
||||||
|
mtlTexDesc.storageMode = MTLStorageModeManaged;
|
||||||
|
} else {
|
||||||
|
mtlTexDesc.storageMode = _buffer->getMTLBuffer().storageMode;
|
||||||
|
}
|
||||||
|
#else
|
||||||
mtlTexDesc.storageMode = _buffer->getMTLBuffer().storageMode;
|
mtlTexDesc.storageMode = _buffer->getMTLBuffer().storageMode;
|
||||||
|
#endif
|
||||||
mtlTexDesc.cpuCacheMode = _buffer->getMTLBuffer().cpuCacheMode;
|
mtlTexDesc.cpuCacheMode = _buffer->getMTLBuffer().cpuCacheMode;
|
||||||
mtlTexDesc.usage = MTLTextureUsageShaderRead;
|
mtlTexDesc.usage = MTLTextureUsageShaderRead;
|
||||||
if ( mvkIsAnyFlagEnabled(_buffer->getUsage(), VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) ) {
|
if ( mvkIsAnyFlagEnabled(_buffer->getUsage(), VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user