mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
gpu/internal/metal: use optimal CPU cache mode for staging buffers
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user