Skip to content
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

Fix a bug in buffer_buffer_shader_timings.ln #942

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

dfellis
Copy link
Member

@dfellis dfellis commented Oct 25, 2024

I realized the mistake after I tried to run the earlier version on MacOS and it crashed the machine (!!!) and then realized what I did wrong when I actually printed the buffer once it was in RAM and saw the garbage that was produced, particularly with the first few, which didn't change the buffer at all.

I was accidentally setting the yMax to 0, which Vulkan and DirectX decide this means "don't run the shader at all" but Metal decides "run the shader on ALL of the GPU memory address space (afaict) until it messes with something it shouldn't and blows up the machine.

This fixes the bug here explicitly, but I need to decide what to do if you call gFor with invalid arguments ("correct" the 0 to 1? panic! the program? make gFor fallible and return an error type?)

@dfellis dfellis self-assigned this Oct 25, 2024
@dfellis dfellis merged commit 2ae2662 into main Oct 25, 2024
13 checks passed
@dfellis dfellis deleted the fix-buffer-shader-timings-bug branch October 25, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant