Closed MaikKlein closed 6 years ago
OpFunctionParameter
has to be a pointer type, otherwise it can't be used with OpAccessChain
which essentially makes it quite useless. :(
The workaround is to store all function parameters that are not of type pointer inside function local variables.
glslang always creates a new variable for a param, and then directly passes that variable.
This is because variables are always mutable, and changes inside a function would affect the value of the params.
I assume if one param was marked as
inout
glslang just stores the value of the param in the variable that was marked inoutIn rlsl I don't pass variables directly, I only pass the load.
If something is marked
&mut
, I'll just pass the variable directly instead of passing the loaded value.