I want to write a function in a compute shader that takes a StructuredBuffer or an RWStructuredBuffer as an argument. Something like this:
void SomeFunction(StructuredBuffer<CustomStruct> buffer) { // ... }
This seems to work, but I'm concerned that the buffer will actually be copied into the parameter each time the function is called. It seems counter-intuitive to me that it would work that way, I would think that the buffer would somehow be passed by reference. I searched for a bit and could not find a definite answer as to whether the entire buffer is copied or not. Does anyone here know how this works?