diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-12-04 09:19:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-12-04 09:20:26 +0300 |
commit | 9dfbd98339984e885c3b48142c97f3b516520e73 (patch) | |
tree | c70bf74f74d728fb3fb9918f1b402682b13f3eeb /source/blender/gpu | |
parent | 1b2f8b27540f6154dc968f216297ab9badccd271 (diff) |
Cleanup: whitespace
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 3 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 18 |
2 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 231f1d8f7b1..57df877bf18 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -181,7 +181,8 @@ void gpu_extensions_init(void) /* XXX : TODO : Remove this once this sampling mipmap problem is gone. * https://github.com/dfelinto/opengl-sandbox/blob/downsample/README.md */ else if (strstr(renderer, "AMD VEGA") && - strstr(vendor, "X.Org")) { + strstr(vendor, "X.Org")) + { GG.device = GPU_DEVICE_AMD_VEGA; GG.driver = GPU_DRIVER_OPENSOURCE; } diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 0a8ef9dffc5..e2883b53047 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -516,9 +516,9 @@ static float gaussian_profile(float r, float radius) const float v = radius * radius * (0.25f * 0.25f); const float Rm = sqrtf(v * GAUSS_TRUNCATE); - if(r >= Rm) + if (r >= Rm) { return 0.0f; - + } return expf(-r * r / (2.0f * v)) / (2.0f * M_PI * v); } @@ -535,20 +535,20 @@ static float cubic_profile(float r, float radius, float sharpness) { float Rm = radius * (1.0f + sharpness); - if(r >= Rm) + if (r >= Rm) { return 0.0f; - + } /* custom variation with extra sharpness, to match the previous code */ - const float y = 1.0f/(1.0f + sharpness); + const float y = 1.0f / (1.0f + sharpness); float Rmy, ry, ryinv; Rmy = powf(Rm, y); ry = powf(r, y); - ryinv = (r > 0.0f)? powf(r, y - 1.0f): 0.0f; + ryinv = (r > 0.0f) ? powf(r, y - 1.0f) : 0.0f; - const float Rmy5 = (Rmy*Rmy) * (Rmy*Rmy) * Rmy; + const float Rmy5 = (Rmy * Rmy) * (Rmy * Rmy) * Rmy; const float f = Rmy - ry; - const float num = f*(f*f)*(y*ryinv); + const float num = f * (f * f) * (y * ryinv); return (10.0f * num) / (Rmy5 * M_PI); } @@ -576,7 +576,7 @@ static float eval_integral(float x0, float x1, short falloff_type, float sharpne const float step = range / INTEGRAL_RESOLUTION; float integral = 0.0f; - for(int i = 0; i < INTEGRAL_RESOLUTION; ++i) { + for (int i = 0; i < INTEGRAL_RESOLUTION; ++i) { float x = x0 + range * ((float)i + 0.5f) / (float)INTEGRAL_RESOLUTION; float y = eval_profile(x, falloff_type, sharpness, param); integral += y * step; |