split core renderer stuff into metal subfolder

This commit is contained in:
2024-09-12 11:37:08 +10:00
parent 667201fe49
commit d7cb051fb7
9 changed files with 173 additions and 160 deletions

View File

@ -0,0 +1,18 @@
import Metal
public struct RendererMesh: Hashable {
internal let _vertBuf: MTLBuffer, _idxBuf: MTLBuffer
public let numIndices: Int
public static func == (lhs: Self, rhs: Self) -> Bool {
lhs._vertBuf.gpuAddress == rhs._vertBuf.gpuAddress && lhs._vertBuf.length == rhs._vertBuf.length &&
lhs._vertBuf.gpuAddress == rhs._vertBuf.gpuAddress && lhs._vertBuf.length == rhs._vertBuf.length &&
lhs.numIndices == rhs.numIndices
}
public func hash(into hasher: inout Hasher) {
hasher.combine(self._vertBuf.hash)
hasher.combine(self._idxBuf.hash)
hasher.combine(self.numIndices)
}
}