-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redundant function input args slicing #47
Comments
Consider this function:
Transpiles to
The input variable should not be mutated according to https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)#Parameters I acknowledge that this is likely very rare and not good coding practice anyways. I agree the slicing feels like too much overhead than it's worth. Is there anyway to detect mutation and only slice the input in that case? |
We would have to introduce "horizontal knowledge" for nodes, like constant propagation etc. Right now we have only "vertical" knowledge: children, parent nodes. Alternatively, we could try to detect if a function modifies its arguments, that should not be very difficult - just iterate over all nested nodes, check if an argument is engaged in Mb we could also figure that out somehow from the |
Seems that the project may need refactoring soon, if we find a sponsor. Tech debt accumulates, the code oftentimes vague and unclear, like variables tracking, descriptor init cases etc, needs more purity. |
I'm ok with removing the argument slicing for now and maybe adding a note in the readme - we do not have any real world use case that is affected by this. |
@Pessimistress that's fine, let's keep it. We have many other redundancies. |
Transpiling
gives
which has redundant slicing: slower performance, longer output. Probably we should guard mutation only in case of
out
qualifiers.@Pessimistress what do you think?
The text was updated successfully, but these errors were encountered: