Skip to content

fix: Perlin noise dynamic cache on Safari #1362

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

Merged
merged 3 commits into from
Jun 16, 2025
Merged

Conversation

mhawryluk
Copy link
Contributor

closes #1356

@mhawryluk mhawryluk requested review from iwoplaza and reczkok June 12, 2025 10:17
Copy link

github-actions bot commented Jun 12, 2025

pkg.pr.new

packages

pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@1362
pnpm i https://pkg.pr.new/software-mansion/TypeGPU/typegpu@43cdf52e4d500e19f25a1aa78146955cf30a4b4c

benchmark
view benchmark

commit
view commit

Copy link
Contributor

@reczkok reczkok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotta love the alignment inconsistencies

Copy link
Collaborator

@iwoplaza iwoplaza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! 👏
Was this hard to debug on Safari? How did you manage to find the solution? 👀

@mhawryluk
Copy link
Contributor Author

Awesome! 👏 Was this hard to debug on Safari? How did you manage to find the solution? 👀

it wasn't particularly more difficult to debug on Safari. I was doing so on the macOS version, not iOS though. the only annoying thing was the very long reloading times after each change in code, which don't happen on Chrome.

to find the solution, I was replacing chunks of code with hard-coded values to make it render anything on the screen, starting with big chunks, like the entirety of the fragment function, gradually to smaller and smaller pieces. that way I was able to notice that accessing the size buffer binding at all would break the rendering (the value didn't even need to be actually used, just referenced). then it was @reczkok who suggested that it might be vec3 alignment's fault and so I tried the vec4 to see if that would fix the bug, which it did

@mhawryluk mhawryluk merged commit e7c6d68 into main Jun 16, 2025
6 checks passed
@mhawryluk mhawryluk deleted the fix/perlin-noise-safari branch June 16, 2025 09:45
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.

fix: Perlin noise example not working on Safari
3 participants