fix(flame_3d): Use float for numLights uniform to fix GLES crash#3810
Conversation
|
We should verify if this still works on iOS/macos I don't mind changing it to an float, but if I recall we had weird float issues on the other platforms 😭 |
|
I tried on macos - it works! |
|
@agnath18K thanks for your contribution and interest in flame_3d ! do you have a link or reference or github issue to explain "Impeller's GLES backend only supports float uniforms"? so we can add a small comment just for future reference then I can do the bundle re-gen and merge! |
hey @luanpotter , some references for the GLES float-only uniform limitation: |
225f03e to
fc4208c
Compare
|
Rebased and added a note in a comment |

Description
Fixes #3809
flame_3dcrashes on Android GLES becausespatial_material.fragdeclaresuint numLightsandlighting_info.dartsets it viashader.setUint(). Impeller's GLES backend only supportsfloatuniforms — theuintpath hits an unhandled shader type and crashes.Changed
uint→floatin the shader andsetUint→setFloatin Dart. The value is a light count (0–3) sofloatworks identically. Recompiled the shaderbundle.Checklist
docsand added dartdoc comments with///.examplesordocs.No test added — the crash only reproduces on a real GLES device/emulator, not in unit tests. The existing lighting logic is unchanged; only the uniform type is corrected.
Breaking Change?