use arc4random to seed non-csprng, fleshes out random subsystem

This commit is contained in:
2024-08-22 03:37:29 +10:00
parent 394e340f09
commit cb2ffe78a4
6 changed files with 83 additions and 15 deletions

View File

@ -358,7 +358,7 @@ public class Renderer {
let instancesBytes = numInstances * MemoryLayout<VertexShaderInstance>.stride
// (Re)create instance buffer if needed
if self._instances[self.currentFrame] == nil || numInstances > self._instances[self.currentFrame]!.length {
if self._instances[self.currentFrame] == nil || instancesBytes > self._instances[self.currentFrame]!.length {
guard let instanceBuffer = self.device.makeBuffer(
length: instancesBytes,
options: .storageModeManaged)