Style: clang-format: Disable AllowShortIfStatementsOnASingleLine

Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
This commit is contained in:
Rémi Verschelde 2020-05-10 12:56:01 +02:00
parent 03b13e0c69
commit e956e80c1f
130 changed files with 967 additions and 511 deletions

View file

@ -184,22 +184,38 @@ void main() {
int index = x + y * 4;
float limit = 0.0;
if (x < 8) {
if (index == 0) limit = 0.0625;
if (index == 1) limit = 0.5625;
if (index == 2) limit = 0.1875;
if (index == 3) limit = 0.6875;
if (index == 4) limit = 0.8125;
if (index == 5) limit = 0.3125;
if (index == 6) limit = 0.9375;
if (index == 7) limit = 0.4375;
if (index == 8) limit = 0.25;
if (index == 9) limit = 0.75;
if (index == 10) limit = 0.125;
if (index == 11) limit = 0.625;
if (index == 12) limit = 1.0;
if (index == 13) limit = 0.5;
if (index == 14) limit = 0.875;
if (index == 15) limit = 0.375;
if (index == 0)
limit = 0.0625;
if (index == 1)
limit = 0.5625;
if (index == 2)
limit = 0.1875;
if (index == 3)
limit = 0.6875;
if (index == 4)
limit = 0.8125;
if (index == 5)
limit = 0.3125;
if (index == 6)
limit = 0.9375;
if (index == 7)
limit = 0.4375;
if (index == 8)
limit = 0.25;
if (index == 9)
limit = 0.75;
if (index == 10)
limit = 0.125;
if (index == 11)
limit = 0.625;
if (index == 12)
limit = 1.0;
if (index == 13)
limit = 0.5;
if (index == 14)
limit = 0.875;
if (index == 15)
limit = 0.375;
}
if (frag_color.a < limit) {
discard;

View file

@ -420,7 +420,8 @@ float SchlickFresnel(float u) {
}
float GTR1(float NdotH, float a) {
if (a >= 1.0) return 1.0 / M_PI;
if (a >= 1.0)
return 1.0 / M_PI;
float a2 = a * a;
float t = 1.0 + (a2 - 1.0) * NdotH * NdotH;
return (a2 - 1.0) / (M_PI * log(a2) * t);