Is it possible to send from SwiftUI some sort of inout parameter or a pointer parameter to a metal shading function?

as the title said, I want to sample the current pixel in the layer and if the color is the same as one in the parameter, I need to find a way to return that position back to SwiftUI.

Do you think that's possible?

in Shader.Argument I didn't find a way to directly convert to a pointer.

Paul Hudson has a very good video on youtube explaining the details:

https://www.youtube.com/watch?v=EgzWwgRpUuw

Is it possible to send from SwiftUI some sort of inout parameter or a pointer parameter to a metal shading function?
 
 
Q