initial sprite batch implementation & testbed

This commit is contained in:
2024-09-13 18:59:14 +10:00
parent c0de651947
commit 79013c24c4
13 changed files with 732 additions and 29 deletions

View File

@ -0,0 +1,20 @@
import Metal
public struct RendererTexture2D: Hashable {
internal let _textureBuffer: MTLTexture
public let size: Size<Int>
internal init(metalTexture: MTLTexture, size: Size<Int>) {
self._textureBuffer = metalTexture
self.size = size
}
public static func == (lhs: Self, rhs: Self) -> Bool {
lhs._textureBuffer.gpuResourceID._impl == rhs._textureBuffer.gpuResourceID._impl && lhs.size == rhs.size
}
public func hash(into hasher: inout Hasher) {
hasher.combine(self._textureBuffer.hash)
}
}