Merge pull request #587 from cdavis5e/shared-linear-textures
MVKBuffer: Force managed storage for linear textures on shared buffers.
This commit is contained in:
commit
cd57b2d816
@ -142,7 +142,16 @@ id<MTLTexture> MVKBufferView::getMTLTexture() {
|
||||
width: _textureSize.width
|
||||
height: _textureSize.height
|
||||
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;
|
||||
#endif
|
||||
mtlTexDesc.cpuCacheMode = _buffer->getMTLBuffer().cpuCacheMode;
|
||||
mtlTexDesc.usage = MTLTextureUsageShaderRead;
|
||||
if ( mvkIsAnyFlagEnabled(_buffer->getUsage(), VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user