mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 21:21:34 +00:00
15 lines
455 B
Swift
15 lines
455 B
Swift
|
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)
|
||
|
}
|
||
|
}
|