Have you seen this sample code below?
https://developer.apple.com/documentation/metal/metal_sample_code_library/rendering_a_scene_with_deferred_lighting_in_c
Topic:
Graphics & Games
SubTopic:
Metal
Tags: