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.6k stars 1.86k forks source link

Shader link error using MaterialBuilder at runtime #5810

Open rawnsley opened 2 years ago

rawnsley commented 2 years ago

Android app sample-material-builder fails at runtime with the following logcat error:

E/Filament: Link error in "Clear coat":
    "(null)"

The problem goes away if you swap from MaterialBuilder.Optimization.NONE to MaterialBuilder.Optimization.PERFORMANCE on this line.

I'm using the release branch.

romainguy commented 2 years ago

Seems like a driver specific bug. On what device does this happen?

rawnsley commented 2 years ago

Pocophone F1 and a Qualcom XR1 VR headset. I'll test on a few other devices in case I can find a pattern.

romainguy commented 2 years ago

Note btw that to use the PERFORMANCE mode you must not use filamat-lite

romainguy commented 2 years ago

@rawnsley Actually I think it might be an issue on our end, cf my previous comment.

@prideout We should prob degrade more gracefully when PERFORMANCE is used with filamat-lite.

bejado commented 1 year ago

I'm confused, @rawnsley is that link error generated when optimization is set to MaterialBuilder.Optimization.NONE or MaterialBuilder.Optimization.PERFORMANCE? I'm not sure this has anything to do with filamat-lite.

rawnsley commented 1 year ago

@bejado I’m AFK at the moment, but I think the problem happens for NONE, i.e. the unchanged sample code with the full version of the material builder rather than the lite one. My memory is that it fails on both, but I might be confused.

bejado commented 1 year ago

Yes, I'm able to reproduce with the unchanged sample code (MaterialBuilder.Optimization.NONE). If I switch to MaterialBuilder.Optimization.PERFORMANCE the error is gone.

Unfortunately I think this is a driver bug. Here are the specs I can repro with:

FEngine resolved backend: OpenGL
QUALCOMM build                   : 85da404, I46ff5fc46f
Build Date                       : 11/30/20
OpenGL ES Shader Compiler Version: EV031.31.04.01
Local Branch                     : promo490_3_Google
Remote Branch                    :
Remote Branch                    :
Reconstruct Branch               :
Build Config                     : S P 10.0.4 AArch64
Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so