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
internal/shader: kage considers variable unused when it's used for assigning value to array #2848
Comments
I'm not sure if it's the fix And I haven't tested it yet since I'm very new to open source projects, But I think the fix is changing one line in change this
to
(it was at line 916 when I checked) When checking left hand side, markLocalVariableUsed is set to false, but I think it should be always marked as used since values are used for indexing. I might be wrong but I hope this helps. |
Thanks! I'll take a look. |
You are correct, thank you! Usually, I don't backport the fix for shaders to the stable branch 2.6. However, if you want it, I'm fine to do it. |
I think it would be really cool if it's backproted to 2.6! Thanks! |
Cherry-picked. I'll add a tag v2.6.3 few days later. If you are in hurry, use the commit hash directly:
|
Ebitengine Version
v2.6.2
Operating System
Go Version (
go version
)go1.21.0
What steps will reproduce the problem?
When compling shader code, kage thinks that local variable is unused even though it's used for assigning value to array.
Here's the code for reproducing the error.
At line 23, even though i is being used for indexing array, Kage thinks it's unused. And outputs this error :
local variable i is not used
What is the expected result?
I think it should be compiled. ❤️
What happens instead?
It refused to compile. 😢
Anything else you feel useful to add?
No response
The text was updated successfully, but these errors were encountered: