gpu/internal/metal: use optimal CPU cache mode for staging buffers

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-08-22 17:46:28 +02:00
parent a4a2d517e7
commit 43a7030f6e
+1 -1
View File
@@ -906,7 +906,7 @@ func (b *Backend) stagingBuffer(size int) (C.CFTypeRef, int) {
C.CFRelease(b.stagingBuf)
}
cap := 2 * (b.stagingOff + size)
b.stagingBuf = C.newBuffer(b.dev, C.NSUInteger(cap), C.MTLResourceStorageModeShared)
b.stagingBuf = C.newBuffer(b.dev, C.NSUInteger(cap), C.MTLResourceStorageModeShared|C.MTLResourceCPUCacheModeWriteCombined)
if b.stagingBuf == 0 {
panic(fmt.Errorf("metal: failed to allocate %d bytes of staging buffer", cap))
}