mirror of
				https://github.com/GayPizzaSpecifications/voxelotl-engine.git
				synced 2025-11-04 10:59:39 +00:00 
			
		
		
		
	use instance buffer storage mode most appropriate for the hardware
This commit is contained in:
		@ -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))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user