From 46a63afa84116f7b41fa0cc2fb7bf8bb4b5de946 Mon Sep 17 00:00:00 2001 From: Jan Sikorski Date: Tue, 12 May 2020 13:56:20 +0200 Subject: [PATCH] Fix logic in MVKBuffer::getMTLBufferOffset() --- MoltenVK/MoltenVK/GPUObjects/MVKBuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKBuffer.h b/MoltenVK/MoltenVK/GPUObjects/MVKBuffer.h index 3f88415f..a83cee88 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKBuffer.h +++ b/MoltenVK/MoltenVK/GPUObjects/MVKBuffer.h @@ -75,7 +75,7 @@ public: id getMTLBuffer(); /** Returns the offset at which the contents of this instance starts within the underlying Metal buffer. */ - inline NSUInteger getMTLBufferOffset() { return _deviceMemory && _deviceMemory->getMTLHeap() && !_isHostCoherentTexelBuffer ? 0 : _deviceMemoryOffset; } + inline NSUInteger getMTLBufferOffset() { return !_deviceMemory || _deviceMemory->getMTLHeap() || _isHostCoherentTexelBuffer ? 0 : _deviceMemoryOffset; } #pragma mark Construction