var textures: [MTLTexture?]
Sent it to the fragment shader with renderEncoder.setFragmentTextures(textures, range: 0…<textures.count).
Inside the fragment shader, I want to select as many textures as textures.count.
How do I do it? (However, textures.count is dynamic. [It may be 1 or 5]).
–
Texture creation options are:
let textureDesciptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: format, width: width, height: height, mipmapped: false)
let texture = Renderer.device.makeTexture(descriptor: textureDesciptor)
texture?.replace(region: MTLRegionMake2D(0, 0, width, height), mipmapLevel: 0, withBytes: data, bytesPerRow: width)
–
Thank you.