Cycles: Minor cleanup, whitespace around keyword and preprocessor indent

This commit is contained in:
Sergey Sharybin 2016-04-13 08:58:52 +02:00
parent c1a27a76cf
commit 84c68dcb3f
7 changed files with 48 additions and 48 deletions

@ -643,7 +643,7 @@ void BlenderSession::bake(BL::Object& b_object,
bake_pass_filter = BakeManager::shader_type_to_pass_filter(shader_type, bake_pass_filter); bake_pass_filter = BakeManager::shader_type_to_pass_filter(shader_type, bake_pass_filter);
/* force use_light_pass to be true if we bake more than just colors */ /* force use_light_pass to be true if we bake more than just colors */
if (bake_pass_filter & ~BAKE_FILTER_COLOR) { if(bake_pass_filter & ~BAKE_FILTER_COLOR) {
Pass::add(PASS_LIGHT, scene->film->passes); Pass::add(PASS_LIGHT, scene->film->passes);
} }

@ -250,7 +250,7 @@ ccl_device float bssrdf_burley_root_find(float xi)
* corner case. * corner case.
*/ */
float r; float r;
if (xi <= 0.9f) { if(xi <= 0.9f) {
r = expf(xi * xi * 2.4f) - 1.0f; r = expf(xi * xi * 2.4f) - 1.0f;
} }
else { else {

@ -50,9 +50,9 @@ ccl_device void svm_node_tex_voxel(KernelGlobals *kg,
#else #else
float4 r = make_float4(0.0f, 0.0f, 0.0f, 0.0f); float4 r = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
#endif #endif
if (stack_valid(density_out_offset)) if(stack_valid(density_out_offset))
stack_store_float(stack, density_out_offset, r.w); stack_store_float(stack, density_out_offset, r.w);
if (stack_valid(color_out_offset)) if(stack_valid(color_out_offset))
stack_store_float3(stack, color_out_offset, make_float3(r.x, r.y, r.z)); stack_store_float3(stack, color_out_offset, make_float3(r.x, r.y, r.z));
} }

@ -114,11 +114,11 @@ BoundBox LinearTrianglePatch::bound()
void BicubicPatch::eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v) void BicubicPatch::eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)
{ {
if (N) { if(N) {
float3 dPdu_, dPdv_; float3 dPdu_, dPdv_;
decasteljau_bicubic(P, &dPdu_, &dPdv_, hull, u, v); decasteljau_bicubic(P, &dPdu_, &dPdv_, hull, u, v);
if (dPdu && dPdv) { if(dPdu && dPdv) {
*dPdu = dPdu_; *dPdu = dPdu_;
*dPdv = dPdv_; *dPdv = dPdv_;
} }

@ -30,7 +30,7 @@ void task_run() {
TEST(util_task, basic) { TEST(util_task, basic) {
TaskScheduler::init(0); TaskScheduler::init(0);
TaskPool pool; TaskPool pool;
for (int i = 0; i < 100; ++i) { for(int i = 0; i < 100; ++i) {
pool.push(function_bind(task_run)); pool.push(function_bind(task_run));
} }
TaskPool::Summary summary; TaskPool::Summary summary;
@ -40,10 +40,10 @@ TEST(util_task, basic) {
} }
TEST(util_task, multiple_times) { TEST(util_task, multiple_times) {
for (int N = 0; N < 1000; ++N) { for(int N = 0; N < 1000; ++N) {
TaskScheduler::init(0); TaskScheduler::init(0);
TaskPool pool; TaskPool pool;
for (int i = 0; i < 100; ++i) { for(int i = 0; i < 100; ++i) {
pool.push(function_bind(task_run)); pool.push(function_bind(task_run));
} }
TaskPool::Summary summary; TaskPool::Summary summary;

@ -35,15 +35,15 @@
#if defined(i386) || defined(_M_IX86) #if defined(i386) || defined(_M_IX86)
#ifdef WITH_KERNEL_SSE2 # ifdef WITH_KERNEL_SSE2
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 # define WITH_CYCLES_OPTIMIZED_KERNEL_SSE2
#endif # endif
#ifdef WITH_KERNEL_SSE3 # ifdef WITH_KERNEL_SSE3
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3
#endif # endif
#endif #endif /* defined(i386) || defined(_M_IX86) */
/* x86-64 /* x86-64
* *
@ -52,26 +52,26 @@
#if defined(__x86_64__) || defined(_M_X64) #if defined(__x86_64__) || defined(_M_X64)
/* SSE2 is always available on x86-64 CPUs, so auto enable */ /* SSE2 is always available on x86-64 CPUs, so auto enable */
#define __KERNEL_SSE2__ # define __KERNEL_SSE2__
/* no SSE2 kernel on x86-64, part of regular kernel */ /* no SSE2 kernel on x86-64, part of regular kernel */
#ifdef WITH_KERNEL_SSE3 # ifdef WITH_KERNEL_SSE3
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3 # define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3
#endif # endif
#ifdef WITH_KERNEL_SSE41 # ifdef WITH_KERNEL_SSE41
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41 # define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41
#endif # endif
#ifdef WITH_KERNEL_AVX # ifdef WITH_KERNEL_AVX
#define WITH_CYCLES_OPTIMIZED_KERNEL_AVX # define WITH_CYCLES_OPTIMIZED_KERNEL_AVX
#endif # endif
#ifdef WITH_KERNEL_AVX2 # ifdef WITH_KERNEL_AVX2
#define WITH_CYCLES_OPTIMIZED_KERNEL_AVX2 # define WITH_CYCLES_OPTIMIZED_KERNEL_AVX2
#endif # endif
#endif #endif /* defined(__x86_64__) || defined(_M_X64) */
/* SSE Experiment /* SSE Experiment
* *
@ -79,19 +79,19 @@
* such as float3 and float4. Currently this gives an overall slowdown. */ * such as float3 and float4. Currently this gives an overall slowdown. */
#if 0 #if 0
#define __KERNEL_SSE__ # define __KERNEL_SSE__
#ifndef __KERNEL_SSE2__ # ifndef __KERNEL_SSE2__
#define __KERNEL_SSE2__ # define __KERNEL_SSE2__
#endif # endif
#ifndef __KERNEL_SSE3__ # ifndef __KERNEL_SSE3__
#define __KERNEL_SSE3__ # define __KERNEL_SSE3__
#endif # endif
#ifndef __KERNEL_SSSE3__ # ifndef __KERNEL_SSSE3__
#define __KERNEL_SSSE3__ # define __KERNEL_SSSE3__
#endif # endif
#ifndef __KERNEL_SSE4__ # ifndef __KERNEL_SSE4__
#define __KERNEL_SSE4__ # define __KERNEL_SSE4__
#endif # endif
#endif #endif
/* SSE Intrinsics includes /* SSE Intrinsics includes
@ -102,9 +102,9 @@
#ifndef FREE_WINDOWS64 #ifndef FREE_WINDOWS64
#ifdef _MSC_VER #ifdef _MSC_VER
#include <intrin.h> # include <intrin.h>
#elif (defined(__x86_64__) || defined(__i386__)) #elif (defined(__x86_64__) || defined(__i386__))
#include <x86intrin.h> # include <x86intrin.h>
#endif #endif
#else #else

@ -485,9 +485,9 @@ static string path_unc_to_short(const string& path)
if((len > 5) && (path[5] == ':')) { if((len > 5) && (path[5] == ':')) {
return path.substr(4, len - 4); return path.substr(4, len - 4);
} }
else if ((len > 7) && else if((len > 7) &&
(path.substr(4, 3) == "UNC") && (path.substr(4, 3) == "UNC") &&
((path[7] == DIR_SEP) || (path[7] == DIR_SEP_ALT))) ((path[7] == DIR_SEP) || (path[7] == DIR_SEP_ALT)))
{ {
return "\\\\" + path.substr(8, len - 8); return "\\\\" + path.substr(8, len - 8);
} }