-
Notifications
You must be signed in to change notification settings - Fork 66
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
[BUG] Depth issue with mlx_delete_image() #52
Comments
@W2Wizard I've thought about the issue a bit more, and I am almost certain that the problem is floating point shenanigans. If you look at This local I think there are floating point issues here because of how we saw on my computer that when I set Marius came up with the suggestion to just throw out |
Yes this matrix seems to be the bane of existence since I started this. Your given solution with @Mariusmivw does seem to solve the issue in the code you have given as a reproduction. |
Describe the bug
There is an issue with depth, see the code below.
To Reproduce
Expected behavior
The second square to be drawn, see the comment in the code.
Additional context
If you replace the
const float depth = mlxctx->zdepth;
withconst float depth = 1000000;
inside ofmlx_update_matrix()
you'll see that everything works as expected, though hardcoding it to such a low value is obviously problematic when you create more than a million instances during the lifetime of the program. Ideally you also wouldn't set it to a huge ass constant since it'd still be technically reachable if you ran the program long enough, though how you resolve this issue is up to you.The text was updated successfully, but these errors were encountered: