Fix incorrect tile UVs when using atlas feature on AMD hardware #367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes an issue reported by @odecay on discord.
This is specific to AMD hardware and the issue and fix were reproduced by @odecay and @bzm3r. I am unable to reproduce on any of my non-AMD HW.
Here's a changeset on their fork that reproduces the issue:
main...odecay:bevy_ecs_tilemap:main
That example should show something like this:
But shows this instead:
It seems that there's some sort of floating point imprecision thing going on where
var columns
ends up as2
rather than the correct3
after being cast asu32
/ implicitlyfloor
ed. This messes up the rest of the UV calculations.It is possible to induce this same visual result on hardware that doesn't exhibit this bug by subtracting 1 from
var columns
.