Skip to content

Conversation

CedricGuillemet
Copy link
Contributor

@CedricGuillemet CedricGuillemet commented Jul 22, 2025

morphTargetCount is a uniform int;
but bgfx only support vec4 as uniform.
when doing the replacement, morphTargetCount.x is used and comparison between int i and morphTargetCount.x which is a float break shader compilation with GLSL.
casting morphTargetCount to int doesn't work: casting qualifier is removed becaused it's still an int before shader traversers.
Setting morphTargetCount a float in the engine and casting iterators to float seems to work better.
I've also done the change for WGSL to pass the tests.

Long term is to add (or change) traversers for float/int comparison.

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

Copy link
Member

@sebavan sebavan left a comment

Choose a reason for hiding this comment

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

Ahah

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented Jul 22, 2025

@CedricGuillemet CedricGuillemet marked this pull request as ready for review July 22, 2025 17:35
@sebavan sebavan merged commit c1e4347 into BabylonJS:master Jul 22, 2025
18 checks passed
georginahalpern pushed a commit to georginahalpern/Babylon.js that referenced this pull request Aug 20, 2025
morphTargetCount is a uniform int;
but bgfx only support vec4 as uniform.
when doing the replacement, morphTargetCount.x is used and comparison
between `int i` and `morphTargetCount.x` which is a float break shader
compilation with GLSL.
casting `morphTargetCount` to int doesn't work: casting qualifier is
removed becaused it's still an int before shader traversers.
Setting morphTargetCount a float in the engine and casting iterators to
float seems to work better.
I've also done the change for WGSL to pass the tests.

Long term is to add (or change) traversers for float/int comparison.
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.

3 participants