Skip to content

fix: handle flipY: false correctly in copyExternalImageToTexture#337

Merged
wcandillon merged 2 commits intowcandillon:mainfrom
branikclimbs:fix/copy-external-image-flipy-optional-bool
Mar 25, 2026
Merged

fix: handle flipY: false correctly in copyExternalImageToTexture#337
wcandillon merged 2 commits intowcandillon:mainfrom
branikclimbs:fix/copy-external-image-flipy-optional-bool

Conversation

@branikclimbs
Copy link
Contributor

Fixes #336

Summary

  • Fix std::optional<bool> check in GPUQueue::copyExternalImageToTexture that treated flipY: false the same as flipY: true
  • if (source->flipY)if (source->flipY.value_or(false))

Context

Three.js r173 (mrdoob/three.js#30260) started passing flipY explicitly to copyExternalImageToTexture. This exposed the bug — GLTF textures pass flipY: false, which engaged the optional and triggered the flip path, producing visually corrupted textures.

@wcandillon wcandillon self-requested a review March 25, 2026 05:14
Copy link
Owner

@wcandillon wcandillon left a comment

Choose a reason for hiding this comment

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

Thanks a lot for catching this!

@wcandillon wcandillon merged commit bfbe325 into wcandillon:main Mar 25, 2026
6 of 7 checks passed
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.

copyExternalImageToTexture produces incorrect results when flipY is explicitly set to false

2 participants