Style cleanup: indentation, braces
authorCampbell Barton <ideasman42@gmail.com>
Sun, 4 May 2014 16:19:08 +0000 (02:19 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 4 May 2014 16:19:08 +0000 (02:19 +1000)
45 files changed:
intern/cycles/app/cycles_standalone.cpp
intern/cycles/app/cycles_xml.h
intern/cycles/blender/CCL_api.h
intern/cycles/blender/blender_mesh.cpp
intern/cycles/blender/blender_python.cpp
intern/cycles/device/device_cuda.cpp
intern/cycles/device/device_network.cpp
intern/cycles/device/device_network.h
intern/cycles/device/device_opencl.cpp
intern/cycles/kernel/closure/bsdf_hair.h
intern/cycles/kernel/closure/bsdf_microfacet.h
intern/cycles/kernel/closure/bsdf_phong_ramp.h
intern/cycles/kernel/closure/bsdf_util.h
intern/cycles/kernel/closure/bsdf_westin.h
intern/cycles/kernel/geom/geom_bvh_shadow.h
intern/cycles/kernel/geom/geom_object.h
intern/cycles/kernel/kernel_avx.cpp
intern/cycles/kernel/kernel_displace.h
intern/cycles/kernel/kernel_emission.h
intern/cycles/kernel/kernel_passes.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_shader.h
intern/cycles/kernel/kernel_shadow.h
intern/cycles/kernel/kernel_sse2.cpp
intern/cycles/kernel/kernel_sse3.cpp
intern/cycles/kernel/kernel_sse41.cpp
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/osl/osl_services.h
intern/cycles/kernel/osl/osl_shader.cpp
intern/cycles/kernel/svm/svm_geometry.h
intern/cycles/kernel/svm/svm_image.h
intern/cycles/kernel/svm/svm_sepcomb_hsv.h
intern/cycles/kernel/svm/svm_vector_transform.h
intern/cycles/kernel/svm/svm_wireframe.h
intern/cycles/render/curves.cpp
intern/cycles/render/mesh.cpp
intern/cycles/render/nodes.cpp
intern/cycles/render/svm.cpp
intern/cycles/util/util_color.h
intern/cycles/util/util_hash.h
intern/cycles/util/util_opencl.h
intern/cycles/util/util_simd.h
intern/cycles/util/util_system.cpp
intern/cycles/util/util_transform.h
intern/cycles/util/util_types.h

index 9871273381ea4bd4ba6f2964708884fb1dbf551e..7ea1ca2d8fbd1062e3724dee1e5558f96b293e14 100644 (file)
@@ -214,7 +214,7 @@ static void motion(int x, int y, int button)
 
                /* Rotate */
                else if(button == 2) {
-                       float4 r1= make_float4((float)x * 0.1f, 0.0f, 1.0f, 0.0f);
+                       float4 r1 = make_float4((float)x * 0.1f, 0.0f, 1.0f, 0.0f);
                        matrix = matrix * transform_rotate(DEG2RADF(r1.x), make_float3(r1.y, r1.z, r1.w));
 
                        float4 r2 = make_float4(y * 0.1f, 1.0f, 0.0f, 0.0f);
index 2d225f3a013cd1f1597d5d979703121a6c2723b7..96bc79c35d8ee3cfd8155994bab6959ebedbde2f 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License
  */
 
-#ifndef __CYCLES_XML__
-#define __CYCLES_XML__
+#ifndef __CYCLES_XML_H__
+#define __CYCLES_XML_H__
 
 CCL_NAMESPACE_BEGIN
 
@@ -29,5 +29,4 @@ void xml_read_file(Scene *scene, const char *filepath);
 
 CCL_NAMESPACE_END
 
-#endif /* __CYCLES_XML__ */
-
+#endif /* __CYCLES_XML_H__ */
index 6532315cf394a88d72baeb55e2878e2db2eda6c2..2772b9ac8a7c0b29478a5f1c2ba26f3619803d59 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License
  */
 
-#ifndef CCL_API_H
-#define CCL_API_H
+#ifndef __CCL_API_H__
+#define __CCL_API_H__
 
 #ifdef __cplusplus
 extern "C" {
@@ -40,5 +40,4 @@ void *CCL_python_module_init(void);
 }
 #endif
 
-#endif /* CCL_API_H */
-
+#endif /* __CCL_API_H__ */
index 29aecee09c242c7d894d425f9f1bf7f742cf837a..fb343a74bd56a2a8c56da02f36a2aa38c603c010 100644 (file)
@@ -322,7 +322,8 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<
                /* create triangles */
                if(n == 4) {
                        if(is_zero(cross(mesh->verts[vi[1]] - mesh->verts[vi[0]], mesh->verts[vi[2]] - mesh->verts[vi[0]])) ||
-                               is_zero(cross(mesh->verts[vi[2]] - mesh->verts[vi[0]], mesh->verts[vi[3]] - mesh->verts[vi[0]]))) {
+                          is_zero(cross(mesh->verts[vi[2]] - mesh->verts[vi[0]], mesh->verts[vi[3]] - mesh->verts[vi[0]])))
+                       {
                                mesh->set_triangle(ti++, vi[0], vi[1], vi[3], shader, smooth);
                                mesh->set_triangle(ti++, vi[2], vi[3], vi[1], shader, smooth);
                        }
index 658fccaf12e43dc4d7aa0d96ab957503dc645340..872f891cc2ac7755d8fca817bca5318ed1ab1c0e 100644 (file)
@@ -317,7 +317,8 @@ static PyObject *osl_update_node_func(PyObject *self, PyObject *args)
                }
                else if(param->type.vecsemantics == TypeDesc::POINT ||
                        param->type.vecsemantics == TypeDesc::VECTOR ||
-                       param->type.vecsemantics == TypeDesc::NORMAL) {
+                       param->type.vecsemantics == TypeDesc::NORMAL)
+               {
                        socket_type = "NodeSocketVector";
                        data_type = BL::NodeSocket::type_VECTOR;
 
index 29b348d86accaf6c960ed87a58c2be92718b9970..c667b8863d69597f911c3bffdca4e14f7f2e2a88 100644 (file)
@@ -508,7 +508,7 @@ public:
                                if(interpolation == INTERPOLATION_CLOSEST) {
                                        cuda_assert(cuTexRefSetFilterMode(texref, CU_TR_FILTER_MODE_POINT));
                                }
-                               else if (interpolation == INTERPOLATION_LINEAR){
+                               else if (interpolation == INTERPOLATION_LINEAR) {
                                        cuda_assert(cuTexRefSetFilterMode(texref, CU_TR_FILTER_MODE_LINEAR));
                                }
                                else {/* CUBIC and SMART are unsupported for CUDA */
index 8f00324c3e17eab19275acd3cd0d24948ce44627..af051076009c76facdfc7a4d8afa59ee5d6c9a08 100644 (file)
@@ -326,7 +326,7 @@ class DeviceServer {
 public:
        thread_mutex rpc_lock;
 
-       void network_error(const string &message){
+       void network_error(const string &message) {
                error_func.network_error(message);
        }
 
@@ -366,7 +366,7 @@ protected:
        {
                /* create a new DataVector and insert it into mem_data */
                pair<DataMap::iterator,bool> data_ins = mem_data.insert(
-                               DataMap::value_type(client_pointer, DataVector()));
+                       DataMap::value_type(client_pointer, DataVector()));
 
                /* make sure it was a unique insertion */
                assert(data_ins.second);
index 8596b61b17988dedb82e2e9db1ef1fb04d620134..893841d1da7ad2fcffc3976f1cbc468abae6c398 100644 (file)
@@ -209,7 +209,7 @@ public:
                boost::system::error_code error;
                size_t len = boost::asio::read(socket, boost::asio::buffer(header), error);
 
-               if(error.value()){
+               if(error.value()) {
                        error_func->network_error(error.message());
                }
 
@@ -276,7 +276,7 @@ public:
                boost::system::error_code error;
                size_t len = boost::asio::read(socket, boost::asio::buffer(buffer, size), error);
 
-               if(error.value()){
+               if(error.value()) {
                        error_func->network_error(error.message());
                }
 
@@ -391,7 +391,7 @@ private:
 
                                        /* add address if it's not already in the list */
                                        bool found = std::find(servers.begin(), servers.end(),
-                                                       address) != servers.end();
+                                                              address) != servers.end();
 
                                        if(!found)
                                                servers.push_back(address);
index 2e759d1a36f5fe3c8adabbc2d6b875ab496cdbb9..694ec9db03643e429b55ba165998822083274786 100644 (file)
@@ -461,7 +461,7 @@ public:
                vector<cl_platform_id> platforms(num_platforms, NULL);
 
                ciErr = clGetPlatformIDs(num_platforms, &platforms[0], NULL);
-               if(opencl_error(ciErr)){
+               if(opencl_error(ciErr)) {
                        fprintf(stderr, "clGetPlatformIDs failed \n");
                        return;
                }
@@ -489,7 +489,7 @@ public:
                        /* get devices */
                        vector<cl_device_id> device_ids(num_devices, NULL);
 
-                       if(opencl_error(clGetDeviceIDs(cpPlatform, opencl_device_type(), num_devices, &device_ids[0], NULL))){
+                       if(opencl_error(clGetDeviceIDs(cpPlatform, opencl_device_type(), num_devices, &device_ids[0], NULL))) {
                                fprintf(stderr, "clGetDeviceIDs failed \n");
                                return;
                        }
@@ -528,7 +528,7 @@ public:
                                cxContext = clCreateContext(context_props, 1, &cdDevice,
                                        context_notify_callback, cdDevice, &ciErr);
 
-                               if(opencl_error(ciErr)){
+                               if(opencl_error(ciErr)) {
                                        opencl_error("OpenCL: clCreateContext failed");
                                        return;
                                }
index 26e1198ffcf982ab5072793ea0829f80f41eedef..19cdb7732558162b477d602243d11bbd88372810 100644 (file)
@@ -84,7 +84,7 @@ ccl_device float3 bsdf_hair_reflection_eval_reflect(const ShaderClosure *sc, con
        float theta_i = M_PI_2_F - safe_acosf(omega_in_z);
        float cosphi_i = dot(omega_in_y, locy);
 
-       if(M_PI_2_F - fabsf(theta_i) < 0.001f || cosphi_i < 0.0f){
+       if(M_PI_2_F - fabsf(theta_i) < 0.001f || cosphi_i < 0.0f) {
                *pdf = 0.0f;
                return make_float3(*pdf, *pdf, *pdf);
        }
@@ -140,7 +140,7 @@ ccl_device float3 bsdf_hair_transmission_eval_transmit(const ShaderClosure *sc,
        float theta_i = M_PI_2_F - safe_acosf(omega_in_z);
        float phi_i = safe_acosf(dot(omega_in_y, locy));
 
-       if(M_PI_2_F - fabsf(theta_i) < 0.001f){
+       if(M_PI_2_F - fabsf(theta_i) < 0.001f) {
                *pdf = 0.0f;
                return make_float3(*pdf, *pdf, *pdf);
        }
@@ -251,8 +251,8 @@ ccl_device int bsdf_hair_transmission_sample(const ShaderClosure *sc, float3 Ng,
        float phi_pdf = roughness2 / (c_TT * (p * p + roughness2 * roughness2));
 
        *omega_in =(cosf(phi) * costheta_i) * locy -
-                          (sinf(phi) * costheta_i) * locx +
-                          (            sintheta_i) * Tg;
+                  (sinf(phi) * costheta_i) * locx +
+                  (            sintheta_i) * Tg;
 
        //differentials - TODO: find a better approximation for the transmission bounce
 #ifdef __RAY_DIFFERENTIALS__
@@ -261,7 +261,7 @@ ccl_device int bsdf_hair_transmission_sample(const ShaderClosure *sc, float3 Ng,
 #endif
 
        *pdf = fabsf(phi_pdf * theta_pdf);
-       if(M_PI_2_F - fabsf(theta_i) < 0.001f){
+       if(M_PI_2_F - fabsf(theta_i) < 0.001f) {
                *pdf = 0.0f;
        }
 
index dfa8886c113117afa82c7c0c8b7a1ca171eaca34..1ec35e444fe42bf88ca153b13158cb8e71ee8d44 100644 (file)
@@ -154,8 +154,8 @@ ccl_device int bsdf_microfacet_ggx_sample(const ShaderClosure *sc, float3 Ng, fl
                float sinThetaM  = cosThetaM * safe_sqrtf(tanThetaM2);
                float phiM = M_2PI_F * randv;
                float3 m = (cosf(phiM) * sinThetaM) * X +
-                                (sinf(phiM) * sinThetaM) * Y +
-                                                          cosThetaM  * Z;
+                          (sinf(phiM) * sinThetaM) * Y +
+                          (             cosThetaM) * Z;
                if(!m_refractive) {
                        float cosMO = dot(m, I);
                        if(cosMO > 0) {
@@ -383,8 +383,8 @@ ccl_device int bsdf_microfacet_beckmann_sample(const ShaderClosure *sc, float3 N
                float sinThetaM = cosThetaM * tanThetaM;
                float phiM = M_2PI_F * randv;
                float3 m = (cosf(phiM) * sinThetaM) * X +
-                                (sinf(phiM) * sinThetaM) * Y +
-                                                          cosThetaM  * Z;
+                          (sinf(phiM) * sinThetaM) * Y +
+                          (             cosThetaM) * Z;
 
                if(!m_refractive) {
                        float cosMO = dot(m, I);
index 219c5aea1598ec35865498edd27db7d9a60e1bed..2b4e1c68640b070b157625e7ab9fa3a1bee1d038 100644 (file)
@@ -109,8 +109,8 @@ ccl_device int bsdf_phong_ramp_sample(const ShaderClosure *sc, const float3 colo
                float sinTheta2 = 1 - cosTheta * cosTheta;
                float sinTheta = sinTheta2 > 0 ? sqrtf(sinTheta2) : 0;
                *omega_in = (cosf(phi) * sinTheta) * T +
-                                  (sinf(phi) * sinTheta) * B +
-                                  (            cosTheta) * R;
+                           (sinf(phi) * sinTheta) * B +
+                           (            cosTheta) * R;
                if (dot(Ng, *omega_in) > 0.0f)
                {
                        // common terms for pdf and eval
index f6dceb3ca82f63b30c0cb69716aefbe2959b7154..b3dcb9dcc388330a26fd1c6fecb38de4efa8dc72 100644 (file)
 
 CCL_NAMESPACE_BEGIN
 
-ccl_device float fresnel_dielectric(float eta, const float3 N,
-               const float3 I, float3 *R, float3 *T,
+ccl_device float fresnel_dielectric(
+        float eta, const float3 N,
+        const float3 I, float3 *R, float3 *T,
 #ifdef __RAY_DIFFERENTIALS__
-               const float3 dIdx, const float3 dIdy,
-               float3 *dRdx, float3 *dRdy,
-               float3 *dTdx, float3 *dTdy, 
+        const float3 dIdx, const float3 dIdy,
+        float3 *dRdx, float3 *dRdy,
+        float3 *dTdx, float3 *dTdy,
 #endif
-               bool *is_inside)
+        bool *is_inside)
 {
        float cos = dot(N, I), neta;
        float3 Nn;
index ca4c05e91fea851169315b64757f4e5a0a4f0b77..9dc1c00bb3d9a4496161252ec5b2b83cf9fbf447 100644 (file)
@@ -96,10 +96,9 @@ ccl_device int bsdf_westin_backscatter_sample(const ShaderClosure *sc, float3 Ng
                float sinTheta2 = 1 - cosTheta * cosTheta;
                float sinTheta = sinTheta2 > 0 ? sqrtf(sinTheta2) : 0;
                *omega_in = (cosf(phi) * sinTheta) * T +
-                                  (sinf(phi) * sinTheta) * B +
-                                  (cosTheta) * I;
-               if(dot(Ng, *omega_in) > 0)
-               {
+                           (sinf(phi) * sinTheta) * B +
+                           (cosTheta) * I;
+               if(dot(Ng, *omega_in) > 0) {
                        // common terms for pdf and eval
                        float cosNI = dot(N, *omega_in);
                        // make sure the direction we chose is still in the right hemisphere
index be9def02080aae615b66a65b2a409c49a740555a..42ecd4bc54bf7cfdaebe6a3dc9b75c8a7fce8fd0 100644 (file)
@@ -253,12 +253,13 @@ ccl_device bool BVH_FUNCTION_NAME
                                                        int shader = 0;
 
 #ifdef __HAIR__
-                                                       if(kernel_tex_fetch(__prim_type, isect_array->prim) & PRIMITIVE_ALL_TRIANGLE) {
+                                                       if(kernel_tex_fetch(__prim_type, isect_array->prim) & PRIMITIVE_ALL_TRIANGLE)
 #endif
+                                                       {
                                                                float4 Ns = kernel_tex_fetch(__tri_normal, prim);
                                                                shader = __float_as_int(Ns.w);
-#ifdef __HAIR__
                                                        }
+#ifdef __HAIR__
                                                        else {
                                                                float4 str = kernel_tex_fetch(__curves, prim);
                                                                shader = __float_as_int(str.z);
index 5b0127f8a3b927f82016ddf922ebd21595eda5ff..91edd5863acc33bab68330c96d28c7335afb9967 100644 (file)
@@ -366,8 +366,8 @@ ccl_device_inline float3 bvh_clamp_direction(float3 dir)
        /* clamp absolute values by exp2f(-80.0f) to avoid division by zero when calculating inverse direction */
        float ooeps = 8.271806E-25f;
        return make_float3((fabsf(dir.x) > ooeps)? dir.x: copysignf(ooeps, dir.x),
-                                          (fabsf(dir.y) > ooeps)? dir.y: copysignf(ooeps, dir.y),
-                                          (fabsf(dir.z) > ooeps)? dir.z: copysignf(ooeps, dir.z));
+                          (fabsf(dir.y) > ooeps)? dir.y: copysignf(ooeps, dir.y),
+                          (fabsf(dir.z) > ooeps)? dir.z: copysignf(ooeps, dir.z));
 }
 
 ccl_device_inline float3 bvh_inverse_direction(float3 dir)
index d2a7142c5514fd8a234573052c6f09f3546b3281..354214c406ec54489a392c022f6ceb77a6499cfa 100644 (file)
@@ -77,6 +77,6 @@ CCL_NAMESPACE_END
 
 /* needed for some linkers in combination with scons making empty compilation unit in a library */
 void __dummy_function_cycles_avx(void);
-void __dummy_function_cycles_avx(void){}
+void __dummy_function_cycles_avx(void) {}
 
 #endif
index a2709e711d2d356e5c248bf742c3a6f365eb4150..6e14c8679a83fc7a10f5bdae56dc2ba699132322 100644 (file)
@@ -119,7 +119,7 @@ ccl_device void kernel_bake_evaluate(KernelGlobals *kg, ccl_global uint4 *input,
        /* TODO, disable the closures we won't need */
        shader_setup_from_sample(kg, &sd, P, Ng, I, shader, object, prim, u, v, t, time, bounce, transparent_bounce);
 
-       if(is_light_pass(type)){
+       if(is_light_pass(type)) {
                RNG rng = cmj_hash(i, 0);
                compute_light_pass(kg, &sd, &L, rng, (type == SHADER_EVAL_AO));
        }
index 44899e0bf97dc8d82a568d86293fb33db46e80ce..deffa7f2ba27dbcdfc30fdeb4a8c342b4f0c22ae 100644 (file)
@@ -166,10 +166,11 @@ ccl_device_noinline float3 indirect_primitive_emission(KernelGlobals *kg, Shader
        float3 L = shader_emissive_eval(kg, sd);
 
 #ifdef __HAIR__
-       if(!(path_flag & PATH_RAY_MIS_SKIP) && (sd->flag & SD_USE_MIS) && (sd->type & PRIMITIVE_ALL_TRIANGLE)) {
+       if(!(path_flag & PATH_RAY_MIS_SKIP) && (sd->flag & SD_USE_MIS) && (sd->type & PRIMITIVE_ALL_TRIANGLE))
 #else
-       if(!(path_flag & PATH_RAY_MIS_SKIP) && (sd->flag & SD_USE_MIS)) {
+       if(!(path_flag & PATH_RAY_MIS_SKIP) && (sd->flag & SD_USE_MIS))
 #endif
+       {
                /* multiple importance sampling, get triangle light pdf,
                 * and compute weight with respect to BSDF pdf */
                float pdf = triangle_light_pdf(kg, sd->Ng, sd->I, t);
index 9cdcb8c52295e9f95a899411134d49bddce69a44..b3b6fc028948de078b890c541d2fd1be3359f70a 100644 (file)
@@ -51,7 +51,8 @@ ccl_device_inline void kernel_write_data_passes(KernelGlobals *kg, ccl_global fl
        if(!(path_flag & PATH_RAY_SINGLE_PASS_DONE)) {
                if(!(sd->flag & SD_TRANSPARENT) ||
                   kernel_data.film.pass_alpha_threshold == 0.0f ||
-                  average(shader_bsdf_alpha(kg, sd)) >= kernel_data.film.pass_alpha_threshold) {
+                  average(shader_bsdf_alpha(kg, sd)) >= kernel_data.film.pass_alpha_threshold)
+               {
 
                        if(sample == 0) {
                                if(flag & PASS_DEPTH) {
index e71b58aa70906363c342bbc1924aed51748b8375..bd7b53e3aec51646245139ca9e18b2af5ad0f823 100644 (file)
@@ -1304,21 +1304,21 @@ ccl_device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, in
                                /* do subsurface scatter step with copy of shader data, this will
                                 * replace the BSSRDF with a diffuse BSDF closure */
                                for(int j = 0; j < num_samples; j++) {
-                                               ShaderData bssrdf_sd[BSSRDF_MAX_HITS];
-                                               float bssrdf_u, bssrdf_v;
-                                               path_branched_rng_2D(kg, &bssrdf_rng, &state, j, num_samples, PRNG_BSDF_U, &bssrdf_u, &bssrdf_v);
-                                               int num_hits = subsurface_scatter_multi_step(kg, &sd, bssrdf_sd, state.flag, sc, &lcg_state, bssrdf_u, bssrdf_v, true);
+                                       ShaderData bssrdf_sd[BSSRDF_MAX_HITS];
+                                       float bssrdf_u, bssrdf_v;
+                                       path_branched_rng_2D(kg, &bssrdf_rng, &state, j, num_samples, PRNG_BSDF_U, &bssrdf_u, &bssrdf_v);
+                                       int num_hits = subsurface_scatter_multi_step(kg, &sd, bssrdf_sd, state.flag, sc, &lcg_state, bssrdf_u, bssrdf_v, true);
 
-                                               /* compute lighting with the BSDF closure */
-                                               for(int hit = 0; hit < num_hits; hit++) {
-                                                       PathState hit_state = state;
+                                       /* compute lighting with the BSDF closure */
+                                       for(int hit = 0; hit < num_hits; hit++) {
+                                               PathState hit_state = state;
 
-                                                       path_state_branch(&hit_state, j, num_samples);
+                                               path_state_branch(&hit_state, j, num_samples);
 
-                                                       kernel_branched_path_integrate_lighting(kg, rng,
-                                                               &bssrdf_sd[hit], throughput, num_samples_inv,
-                                                               &hit_state, &L, buffer);
-                                               }
+                                               kernel_branched_path_integrate_lighting(kg, rng,
+                                                                                       &bssrdf_sd[hit], throughput, num_samples_inv,
+                                                                                       &hit_state, &L, buffer);
+                                       }
                                }
 
                                state.flag &= ~PATH_RAY_BSSRDF_ANCESTOR;
index 1351ab2e482ff40dfff044356323bf75cf7223a8..58cec090410686c24cdd38d1787b2ef05ccce644 100644 (file)
@@ -39,7 +39,7 @@ ccl_device void shader_setup_object_transforms(KernelGlobals *kg, ShaderData *sd
 {
        if(sd->flag & SD_OBJECT_MOTION) {
                sd->ob_tfm = object_fetch_transform_motion(kg, sd->object, time);
-               sd->ob_itfm= transform_quick_inverse(sd->ob_tfm);
+               sd->ob_itfm = transform_quick_inverse(sd->ob_tfm);
        }
        else {
                sd->ob_tfm = object_fetch_transform(kg, sd->object, OBJECT_TRANSFORM);
index b350e06817781c826f4f283cfbbd1e670cfd5710..ab7524c411a4e13b4823f24c34bcf5f4df6cd772 100644 (file)
@@ -190,7 +190,7 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *
 
 ccl_device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *ray, float3 *shadow)
 {
-*shadow = make_float3(1.0f, 1.0f, 1.0f);
+       *shadow = make_float3(1.0f, 1.0f, 1.0f);
 
        if(ray->t == 0.0f)
                return false;
@@ -217,10 +217,11 @@ ccl_device_inline bool shadow_blocked(KernelGlobals *kg, PathState *state, Ray *
                                        return true;
 
 #ifdef __HAIR__
-                               if(!scene_intersect(kg, ray, PATH_RAY_SHADOW_TRANSPARENT, &isect, NULL, 0.0f, 0.0f)) {
+                               if(!scene_intersect(kg, ray, PATH_RAY_SHADOW_TRANSPARENT, &isect, NULL, 0.0f, 0.0f))
 #else
-                               if(!scene_intersect(kg, ray, PATH_RAY_SHADOW_TRANSPARENT, &isect)) {
+                               if(!scene_intersect(kg, ray, PATH_RAY_SHADOW_TRANSPARENT, &isect))
 #endif
+                               {
 
 #ifdef __VOLUME__
                                        /* attenuation for last line segment towards light */
index 6a2a7804146749fd194417fc26fee24daa9f0eb7..2d5f6091908ff0d4a82b9d515558ab1073b38747 100644 (file)
@@ -75,6 +75,6 @@ CCL_NAMESPACE_END
 
 /* needed for some linkers in combination with scons making empty compilation unit in a library */
 void __dummy_function_cycles_sse2(void);
-void __dummy_function_cycles_sse2(void){}
+void __dummy_function_cycles_sse2(void) {}
 
 #endif
index 9d0abb93cc6539f423ffba9e36feb4ad76abaf89..1062fd0c9901a6122c83272487f3928ca55a864b 100644 (file)
@@ -76,6 +76,6 @@ CCL_NAMESPACE_END
 
 /* needed for some linkers in combination with scons making empty compilation unit in a library */
 void __dummy_function_cycles_sse3(void);
-void __dummy_function_cycles_sse3(void){}
+void __dummy_function_cycles_sse3(void) {}
 
 #endif
index bc20de0ec2012204040bb8b514f071fadcd3ef2c..ba3b4887650339a78968606e99829c5e9c5f2e31 100644 (file)
@@ -77,6 +77,6 @@ CCL_NAMESPACE_END
 
 /* needed for some linkers in combination with scons making empty compilation unit in a library */
 void __dummy_function_cycles_sse41(void);
-void __dummy_function_cycles_sse41(void){}
+void __dummy_function_cycles_sse41(void) {}
 
 #endif
index 9861e527afd3642acbd485d68d203667e8ab4145..2984cc97437020b7f00bc1ba93d15953268f3372 100644 (file)
@@ -524,7 +524,8 @@ static bool get_mesh_element_attribute(KernelGlobals *kg, const ShaderData *sd,
                                const TypeDesc& type, bool derivatives, void *val)
 {
        if (attr.type == TypeDesc::TypePoint || attr.type == TypeDesc::TypeVector ||
-           attr.type == TypeDesc::TypeNormal || attr.type == TypeDesc::TypeColor) {
+           attr.type == TypeDesc::TypeNormal || attr.type == TypeDesc::TypeColor)
+       {
                float3 fval[3];
                fval[0] = primitive_attribute_float3(kg, sd, attr.elem, attr.offset,
                                                     (derivatives) ? &fval[1] : NULL, (derivatives) ? &fval[2] : NULL);
@@ -606,7 +607,7 @@ bool OSLRenderServices::get_object_standard_attribute(KernelGlobals *kg, ShaderD
        }
        else if (name == u_particle_lifetime) {
                int particle_id = object_particle_id(kg, sd->object);
-               float f= particle_lifetime(kg, particle_id);
+               float f = particle_lifetime(kg, particle_id);
                return set_attribute_float(f, type, derivatives, val);
        }
        else if (name == u_particle_location) {
@@ -643,10 +644,11 @@ bool OSLRenderServices::get_object_standard_attribute(KernelGlobals *kg, ShaderD
        }
        else if ((name == u_geom_trianglevertices || name == u_geom_polyvertices)
 #ifdef __HAIR__
-                    && sd->type & PRIMITIVE_ALL_TRIANGLE) {
+                    && sd->type & PRIMITIVE_ALL_TRIANGLE)
 #else
-               ) {
+               )
 #endif
+       {
                float3 P[3];
 
                if(sd->type & PRIMITIVE_TRIANGLE)
index c3ea12253e9352bc88f8cd1143c73971e52876fa..54ddd7a98b40b51c28a9637ee03d5a0408e18762 100644 (file)
@@ -110,9 +110,9 @@ public:
                              ustring dataname, TypeDesc datatype, void *data);
 
        static bool get_background_attribute(KernelGlobals *kg, ShaderData *sd, ustring name,
-                       TypeDesc type, bool derivatives, void *val);
+                                            TypeDesc type, bool derivatives, void *val);
        static bool get_object_standard_attribute(KernelGlobals *kg, ShaderData *sd, ustring name,
-                       TypeDesc type, bool derivatives, void *val);
+                                                 TypeDesc type, bool derivatives, void *val);
 
        static ustring u_distance;
        static ustring u_index;
index 64c734dec64a6641f24af6734d512f1e5deee8bd..843dcdd0985335f2155eba0b3c56b97cc4752c6c 100644 (file)
@@ -409,8 +409,9 @@ static void flatten_volume_closure_tree(ShaderData *sd,
                                        sc.data1 = volume->sc.data1;
 
                                        /* add */
-                                       if(sc.sample_weight > CLOSURE_WEIGHT_CUTOFF &&
-                                          sd->num_closure < MAX_CLOSURE) {
+                                       if((sc.sample_weight > CLOSURE_WEIGHT_CUTOFF) &&
+                                          (sd->num_closure < MAX_CLOSURE))
+                                       {
                                                sd->closure[sd->num_closure++] = sc;
                                                sd->flag |= volume->shaderdata_flag();
                                        }
index 0ec61fdebf0971e94904975f64d30e71575efcce..fe681ec92af762673359f54e578a4d9f0afe2e7a 100644 (file)
@@ -117,13 +117,13 @@ ccl_device void svm_node_particle_info(KernelGlobals *kg, ShaderData *sd, float
                        stack_store_float3(stack, out_offset, particle_location(kg, particle_id));
                        break;
                }
-               #if 0   /* XXX float4 currently not supported in SVM stack */
+#if 0  /* XXX float4 currently not supported in SVM stack */
                case NODE_INFO_PAR_ROTATION: {
                        int particle_id = object_particle_id(kg, sd->object);
                        stack_store_float4(stack, out_offset, particle_rotation(kg, particle_id));
                        break;
                }
-               #endif
+#endif
                case NODE_INFO_PAR_SIZE: {
                        int particle_id = object_particle_id(kg, sd->object);
                        stack_store_float(stack, out_offset, particle_size(kg, particle_id));
index ce2893e189393096d5daebc1444a6f63f8b0e348..6627786725f705008af72e62a7f8605f2a73a478 100644 (file)
@@ -65,7 +65,7 @@ ccl_device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y,
 
        float4 r;
        int ix, iy, nix, niy;
-       if (interpolation == INTERPOLATION_CLOSEST){
+       if (interpolation == INTERPOLATION_CLOSEST) {
                svm_image_texture_frac(x*width, &ix);
                svm_image_texture_frac(y*height, &iy);
 
index 0f68ecbea035080063dfe4ed6acaebf7ba1a7720..111d5d479887057c5e6bb0f7a3a7b55ac993f25d 100644 (file)
@@ -42,12 +42,12 @@ ccl_device void svm_node_separate_hsv(KernelGlobals *kg, ShaderData *sd, float *
        /* Convert to HSV */
        color = rgb_to_hsv(color);
 
-       if (stack_valid(hue_out)) 
-                       stack_store_float(stack, hue_out, color.x);
-       if (stack_valid(saturation_out)) 
-                       stack_store_float(stack, saturation_out, color.y);
-       if (stack_valid(value_out)) 
-                       stack_store_float(stack, value_out, color.z);
+       if (stack_valid(hue_out))
+               stack_store_float(stack, hue_out, color.x);
+       if (stack_valid(saturation_out))
+               stack_store_float(stack, saturation_out, color.y);
+       if (stack_valid(value_out))
+               stack_store_float(stack, value_out, color.z);
 }
 
 CCL_NAMESPACE_END
index 890a9ddda69726773e14051d9aa3809eda4da74e..61d33aeb8cfa158b94544d530b0a05fb93256f37 100644 (file)
@@ -91,9 +91,9 @@ ccl_device void svm_node_vector_transform(KernelGlobals *kg, ShaderData *sd, flo
        if(type == NODE_VECTOR_TRANSFORM_TYPE_NORMAL)
                in = normalize(in);
        
-       /* Output */    
+       /* Output */
        if(stack_valid(vector_out)) {
-                       stack_store_float3(stack, vector_out, in);
+               stack_store_float3(stack, vector_out, in);
        }
 }
 
index 7262a7904bb9ecc82561b8316ea0571f80112396..660e6e2ca47015579925bd6b1118d9c8c6e25b86 100644 (file)
@@ -45,10 +45,11 @@ ccl_device void svm_node_wireframe(KernelGlobals *kg, ShaderData *sd, float *sta
 
        /* Calculate wireframe */
 #ifdef __HAIR__
-       if (sd->prim != PRIM_NONE && sd->type & PRIMITIVE_ALL_TRIANGLE) {
+       if (sd->prim != PRIM_NONE && sd->type & PRIMITIVE_ALL_TRIANGLE)
 #else
-       if (sd->prim != PRIM_NONE) {
+       if (sd->prim != PRIM_NONE)
 #endif
+       {
                float3 Co[3];
                float pixelwidth = 1.0f;
 
index 6e6b11ca92f878e67b12c66e6e2905d435f50351..2c96ffa655e472f3ed54ab3047a5bb763003d75e 100644 (file)
@@ -110,7 +110,7 @@ void CurveSystemManager::device_update(Device *device, DeviceScene *dscene, Scen
 
        progress.set_status("Updating Hair settings", "Copying Hair settings to device");
 
-       KernelCurves *kcurve= &dscene->data.curve;
+       KernelCurves *kcurve = &dscene->data.curve;
 
        kcurve->curveflags = 0;
 
index ddcc42a9ae9bdc7ac1f572fc522177cd821aace0..9607892ceb81265668748dd0817dc21ac1045642 100644 (file)
@@ -554,7 +554,7 @@ bool Mesh::has_motion_blur() const
 {
        return (use_motion_blur &&
                (attributes.find(ATTR_STD_MOTION_VERTEX_POSITION) ||
-                        curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION)));
+                curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION)));
 }
 
 /* Mesh Manager */
index 8748294acb023bd126c63062a73b117a9f22d7d4..28d2a41a1138f3efa475e870bf264ced01daab35 100644 (file)
@@ -317,7 +317,7 @@ void ImageTextureNode::compile(OSLCompiler& compiler)
        compiler.parameter("is_float", is_float);
        compiler.parameter("use_alpha", !alpha_out->links.empty());
 
-       switch (interpolation){
+       switch (interpolation) {
                case INTERPOLATION_CLOSEST:
                        compiler.parameter("interpolation", "closest");
                        break;
index db80aad74d4a63fcec36e054549e949cdb13ea86..576c176759c5c99237d9df6a40de2fb0ed1021c1 100644 (file)
@@ -226,7 +226,8 @@ void SVMCompiler::stack_assign(ShaderInput *input)
                        else if(input->type == SHADER_SOCKET_VECTOR ||
                                input->type == SHADER_SOCKET_NORMAL ||
                                input->type == SHADER_SOCKET_POINT ||
-                               input->type == SHADER_SOCKET_COLOR) {
+                               input->type == SHADER_SOCKET_COLOR)
+                       {
 
                                add_node(NODE_VALUE_V, input->stack_offset);
                                add_node(NODE_VALUE_V, input->value);
@@ -506,8 +507,8 @@ void SVMCompiler::generate_multi_closure(ShaderNode *node, set<ShaderNode*>& don
                        find_dependencies(cl2deps, done, cl2in);
 
                        set_intersection(cl1deps.begin(), cl1deps.end(),
-                                                        cl2deps.begin(), cl2deps.end(),
-                                                        std::inserter(shareddeps, shareddeps.begin()));
+                                        cl2deps.begin(), cl2deps.end(),
+                                        std::inserter(shareddeps, shareddeps.begin()));
                        
                        if(!shareddeps.empty()) {
                                if(cl1in->link)
index 0cfa4049d3eebe63eeb847765ebc8c0a4703b872..50d9f59ea27e2ba382496b3220a7784fa42e76ba 100644 (file)
@@ -132,8 +132,8 @@ ccl_device float3 xyY_to_xyz(float x, float y, float Y)
 ccl_device float3 xyz_to_rgb(float x, float y, float z)
 {
        return make_float3(3.240479f * x + -1.537150f * y + -0.498535f * z,
-                                         -0.969256f * x +  1.875991f * y +  0.041556f * z,
-                                          0.055648f * x + -0.204043f * y +  1.057311f * z);
+                         -0.969256f * x +  1.875991f * y +  0.041556f * z,
+                          0.055648f * x + -0.204043f * y +  1.057311f * z);
 }
 
 #ifndef __KERNEL_OPENCL__
index ded25c92b9028ed69529af158927e2f5b5fae2a9..edd2448efa4e01ab5dddf3240f627ea927d12bdf 100644 (file)
@@ -23,7 +23,7 @@ CCL_NAMESPACE_BEGIN
 
 static inline uint hash_int_2d(uint kx, uint ky)
 {
-       #define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
+#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
 
        uint a, b, c;
 
@@ -41,7 +41,7 @@ static inline uint hash_int_2d(uint kx, uint ky)
 
        return c;
 
-       #undef rot
+#undef rot
 }
 
 static inline uint hash_int(uint k)
index 5f3f1667bccec107a70b64ec99e6d1c7dfa3f839..141c5e3827395c65ce5b00f3bd66153e2283e687 100644 (file)
@@ -304,7 +304,9 @@ typedef struct _cl_kernel *         cl_kernel;
 typedef struct _cl_event *          cl_event;
 typedef struct _cl_sampler *        cl_sampler;
 
-typedef cl_uint             cl_bool;                     /* WARNING!  Unlike cl_ types in cl_platform.h, cl_bool is not guaranteed to be the same size as the bool in kernels. */ 
+/* WARNING!  Unlike cl_ types in cl_platform.h,
+ * cl_bool is not guaranteed to be the same size as the bool in kernels. */
+typedef cl_uint             cl_bool;
 typedef cl_ulong            cl_bitfield;
 typedef cl_bitfield         cl_device_type;
 typedef cl_uint             cl_platform_info;
index 679556ee59b4deae67063934375adb12079e6d63..f0f37fa57aaf5b2d0389e3baf8099bc245a81f69 100644 (file)
@@ -71,7 +71,7 @@ ccl_device_inline const __m128 shuffle_swap(const __m128& a, shuffle_swap_t shuf
 
 #ifdef __KERNEL_SSE41__
 ccl_device_inline void gen_idirsplat_swap(const __m128 &pn, const shuffle_swap_t &shuf_identity, const shuffle_swap_t &shuf_swap,
-                                                                                 const float3& idir, __m128 idirsplat[3], shuffle_swap_t shufflexyz[3])
+                                          const float3& idir, __m128 idirsplat[3], shuffle_swap_t shufflexyz[3])
 {
        const __m128 idirsplat_raw[] = { _mm_set_ps1(idir.x), _mm_set_ps1(idir.y), _mm_set_ps1(idir.z) };
        idirsplat[0] = _mm_xor_ps(idirsplat_raw[0], pn);
@@ -87,7 +87,7 @@ ccl_device_inline void gen_idirsplat_swap(const __m128 &pn, const shuffle_swap_t
 }
 #else
 ccl_device_inline void gen_idirsplat_swap(const __m128 &pn, const shuffle_swap_t &shuf_identity, const shuffle_swap_t &shuf_swap,
-                                                                                 const float3& idir, __m128 idirsplat[3], shuffle_swap_t shufflexyz[3])
+                                          const float3& idir, __m128 idirsplat[3], shuffle_swap_t shufflexyz[3])
 {
        idirsplat[0] = _mm_xor_ps(_mm_set_ps1(idir.x), pn);
        idirsplat[1] = _mm_xor_ps(_mm_set_ps1(idir.y), pn);
index 9a7f1427cbece1d7a29e1ff482db71118c38940c..0764f7d93454195cacb3e2252cabc697d317704b 100644 (file)
@@ -169,14 +169,15 @@ static CPUCapabilities& system_cpu_capabilities()
                        if( os_uses_xsave_xrestore && cpu_avx_support) {
                                // Check if the OS will save the YMM registers
                                uint32_t xcr_feature_mask;
-                               #if defined(__GNUC__)
-                                       int edx; // not used
-                                       __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (xcr_feature_mask) , "=d" (edx) : "c" (0) ); /* actual opcode for xgetbv */
-                               #elif defined(_MSC_VER) && defined(_XCR_XFEATURE_ENABLED_MASK)
-                                       xcr_feature_mask = (uint32_t)_xgetbv(_XCR_XFEATURE_ENABLED_MASK);  /* min VS2010 SP1 compiler is required */
-                               #else
-                                       xcr_feature_mask = 0;
-                               #endif
+#if defined(__GNUC__)
+                               int edx; /* not used */
+                               /* actual opcode for xgetbv */
+                               __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (xcr_feature_mask) , "=d" (edx) : "c" (0) );
+#elif defined(_MSC_VER) && defined(_XCR_XFEATURE_ENABLED_MASK)
+                               xcr_feature_mask = (uint32_t)_xgetbv(_XCR_XFEATURE_ENABLED_MASK);  /* min VS2010 SP1 compiler is required */
+#else
+                               xcr_feature_mask = 0;
+#endif
                                caps.avx = (xcr_feature_mask & 0x6) == 0x6;
                        }
                }
index 4c7ce12d1de67d40b5616c94add8807b1bc39ec0..5b3dbe42f69390ad8c203500bf39df20eb68bc78 100644 (file)
@@ -108,9 +108,9 @@ ccl_device_inline Transform transform_transpose(const Transform a)
 }
 
 ccl_device_inline Transform make_transform(float a, float b, float c, float d,
-                                                                       float e, float f, float g, float h,
-                                                                       float i, float j, float k, float l,
-                                                                       float m, float n, float o, float p)
+                                           float e, float f, float g, float h,
+                                           float i, float j, float k, float l,
+                                           float m, float n, float o, float p)
 {
        Transform t;
 
index 5d2037960fc7ea0e1daffd2710fcb276a57bfe17..8ac0b11678e367584abe679ded303b6d2915e197 100644 (file)
@@ -159,8 +159,8 @@ struct int2 {
        __forceinline int& operator[](int i) { return *(&x + i); }
 };
 
-#ifdef __KERNEL_SSE__
 struct ccl_try_align(16) int3 {
+#ifdef __KERNEL_SSE__
        union {
                __m128i m128;
                struct { int x, y, z, w; };
@@ -171,7 +171,6 @@ struct ccl_try_align(16) int3 {
        __forceinline operator const __m128i&(void) const { return m128; }
        __forceinline operator __m128i&(void) { return m128; }
 #else
-struct ccl_try_align(16) int3 {
        int x, y, z, w;
 #endif
 
@@ -179,8 +178,8 @@ struct ccl_try_align(16) int3 {
        __forceinline int& operator[](int i) { return *(&x + i); }
 };
 
-#ifdef __KERNEL_SSE__
 struct ccl_try_align(16) int4 {
+#ifdef __KERNEL_SSE__
        union {
                __m128i m128;
                struct { int x, y, z, w; };
@@ -191,7 +190,6 @@ struct ccl_try_align(16) int4 {
        __forceinline operator const __m128i&(void) const { return m128; }
        __forceinline operator __m128i&(void) { return m128; }
 #else
-struct ccl_try_align(16) int4 {
        int x, y, z, w;
 #endif
 
@@ -227,8 +225,8 @@ struct float2 {
        __forceinline float& operator[](int i) { return *(&x + i); }
 };
 
-#ifdef __KERNEL_SSE__
 struct ccl_try_align(16) float3 {
+#ifdef __KERNEL_SSE__
        union {
                __m128 m128;
                struct { float x, y, z, w; };
@@ -239,7 +237,6 @@ struct ccl_try_align(16) float3 {
        __forceinline operator const __m128&(void) const { return m128; }
        __forceinline operator __m128&(void) { return m128; }
 #else
-struct ccl_try_align(16) float3 {
        float x, y, z, w;
 #endif
 
@@ -247,8 +244,8 @@ struct ccl_try_align(16) float3 {
        __forceinline float& operator[](int i) { return *(&x + i); }
 };
 
-#ifdef __KERNEL_SSE__
 struct ccl_try_align(16) float4 {
+#ifdef __KERNEL_SSE__
        union {
                __m128 m128;
                struct { float x, y, z, w; };
@@ -259,7 +256,6 @@ struct ccl_try_align(16) float4 {
        __forceinline operator const __m128&(void) const { return m128; }
        __forceinline operator __m128&(void) { return m128; }
 #else
-struct ccl_try_align(16) float4 {
        float x, y, z, w;
 #endif