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,14 @@
import Metal
internal struct Shader: Hashable {
let vertexProgram: (any MTLFunction)?, fragmentProgram: (any MTLFunction)?
static func == (lhs: Shader, rhs: Shader) -> Bool {
lhs.vertexProgram?.hash == rhs.vertexProgram?.hash && lhs.fragmentProgram?.hash == rhs.fragmentProgram?.hash
}
public func hash(into hasher: inout Hasher) {
hasher.combine(self.vertexProgram?.hash ?? 0)
hasher.combine(self.fragmentProgram?.hash ?? 0)
}
}