Fix: EEVEE materials with three closures render black on MacOS

somehow the compiler is struggling with `default:` in `switch`, even if
it's never reached.
This fixes the discrepancy in the `principled emission alpha` test.

Pull Request: https://projects.blender.org/blender/blender/pulls/124889
This commit is contained in:
Weizhen Huang
2024-07-17 17:23:22 +02:00
committed by Gitea
parent 275d90f2b0
commit 4000e1f2f2

View File

@@ -34,7 +34,6 @@ float g_closure_rand[CLOSURE_BIN_COUNT];
ClosureUndetermined g_closure_get(int i)
{
switch (i) {
default:
case 0:
return g_closure_bins[0];
#if CLOSURE_BIN_COUNT > 1
@@ -46,6 +45,9 @@ ClosureUndetermined g_closure_get(int i)
return g_closure_bins[2];
#endif
}
/* TODO: this should be unreachable, better to have an assert. */
ClosureUndetermined cl_empty;
return cl_empty;
}
ClosureUndetermined g_closure_get_resolved(int i, float weight_fac)