Impact of passing a large array to a wgsl function

37 Views Asked by At

I'd like to pass a large array to a function inside the shader. While it is quite straightforward in practice, I couldn't find an explicit statement about whether or not the values are passed by value or reference.

I tried reading the docs, but couldn't quite grasp an answer to the above question; Mainly it mentions pointer in case the data passed to the function is to be updated from inside the function, and mentions that reference should never be in wgsl source code(?).

Is there a performance impact when passing large data to a kernel function?


Update: While digging around a bit more I realized that the data I need to reach is in a buffer, which is not something that is given to the function through its parameters, instead it is available globally; I think the question is still valid though.

0

There are 0 best solutions below