google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.36k stars 1.84k forks source link

Material / MaterialInstance getName is unset in release mode #7793

Open hannojg opened 2 months ago

hannojg commented 2 months ago

⚠️ Issues not using this template will be systematically closed.

Describe the bug

Using material.getName() or materialInstance.getName() always gives an empty value on filament release build, while on debug it returns the name. I assume it's this line probably being completely optimised away in release mode:

https://github.com/google/filament/blob/99eac62b4e0f58b3beaf1d49effe76b6dfdecaae/filament/src/details/Material.cpp#L200

To Reproduce Steps to reproduce the behavior:

  1. Call getName() in debug and release and compare the output

Expected behavior

It should also return the name in release mode. We need the material name to select the right one from a complex model where guessing the index isn't really feasible.

Screenshots n/a

Logs n/a

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context n/a