mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-02 13:00:53 +00:00
use instance buffer storage mode most appropriate for the hardware
This commit is contained in:
parent
427116e6bc
commit
83c85126e7
@ -425,7 +425,7 @@ public class Renderer {
|
||||
if self._instances[self.currentFrame] == nil || instancesBytes > self._instances[self.currentFrame]!.length {
|
||||
guard let instanceBuffer = self.device.makeBuffer(
|
||||
length: instancesBytes,
|
||||
options: .storageModeManaged)
|
||||
options: self._defaultStorage)
|
||||
else {
|
||||
fatalError("Failed to (re)create instance buffer")
|
||||
}
|
||||
@ -447,7 +447,11 @@ public class Renderer {
|
||||
color: SIMD4(instance.color))
|
||||
}
|
||||
}
|
||||
instanceBuffer.didModifyRange(0..<instancesBytes)
|
||||
#if arch(x86_64)
|
||||
if self._defaultStorage == .storageModeManaged {
|
||||
instanceBuffer.didModifyRange(0..<instancesBytes)
|
||||
}
|
||||
#endif
|
||||
|
||||
self._encoder.setCullMode(.init(environment.cullFace))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user