Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 09:16:53 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 09:17:13 +0300
commit108045faa01849115c54190ebed788faf36dcb56 (patch)
tree64d024b47b0dcb6850108377c55e96917645efe5 /intern/cycles
parent3076d95ba441cd32706a27d18922a30f8fd28b8a (diff)
ClangFormat: format '#if 0' code in intern/
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/app/cycles_xml.cpp2
-rw-r--r--intern/cycles/blender/blender_object.cpp5
-rw-r--r--intern/cycles/blender/blender_shader.cpp26
-rw-r--r--intern/cycles/blender/blender_util.h8
-rw-r--r--intern/cycles/device/device_cuda.cpp2
-rw-r--r--intern/cycles/kernel/osl/osl_services.cpp2
-rw-r--r--intern/cycles/kernel/shaders/stdosl.h47
-rw-r--r--intern/cycles/render/camera.cpp13
-rw-r--r--intern/cycles/render/nodes.cpp4
-rw-r--r--intern/cycles/util/util_math.h4
-rw-r--r--intern/cycles/util/util_transform.h6
11 files changed, 75 insertions, 44 deletions
diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp
index 9caf7068d3d..1dbe8a30ff2 100644
--- a/intern/cycles/app/cycles_xml.cpp
+++ b/intern/cycles/app/cycles_xml.cpp
@@ -495,7 +495,7 @@ static void xml_read_mesh(const XMLReadState &state, xml_node node)
float3 *fdata = attr->data_float3();
#if 0
- if(subdivide_uvs) {
+ if (subdivide_uvs) {
attr->flags |= ATTR_SUBDIVIDED;
}
#endif
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index 095ecd59985..00f53804e38 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -307,8 +307,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
/* TODO: don't use lights for excluded layers used as mask layer,
* when dynamic overrides are back. */
#if 0
- if(!((layer_flag & view_layer.holdout_layer) &&
- (layer_flag & view_layer.exclude_layer)))
+ if (!((layer_flag & view_layer.holdout_layer) && (layer_flag & view_layer.exclude_layer)))
#endif
{
sync_light(b_parent,
@@ -345,7 +344,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph,
/* TODO: make holdout objects on excluded layer invisible for non-camera rays. */
#if 0
- if(use_holdout && (layer_flag & view_layer.exclude_layer)) {
+ if (use_holdout && (layer_flag & view_layer.exclude_layer)) {
visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA);
}
#endif
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index 169c4d414a6..5fd60ff7970 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -656,13 +656,12 @@ static ShaderNode *add_node(Scene *scene,
/* TODO: restore */
/* TODO(sergey): Does not work properly when we change builtin type. */
#if 0
- if(b_image.is_updated()) {
- scene->image_manager->tag_reload_image(
- image->filename.string(),
- image->builtin_data,
- get_image_interpolation(b_image_node),
- get_image_extension(b_image_node),
- image->use_alpha);
+ if (b_image.is_updated()) {
+ scene->image_manager->tag_reload_image(image->filename.string(),
+ image->builtin_data,
+ get_image_interpolation(b_image_node),
+ get_image_extension(b_image_node),
+ image->use_alpha);
}
#endif
}
@@ -702,13 +701,12 @@ static ShaderNode *add_node(Scene *scene,
/* TODO: restore */
/* TODO(sergey): Does not work properly when we change builtin type. */
#if 0
- if(b_image.is_updated()) {
- scene->image_manager->tag_reload_image(
- env->filename.string(),
- env->builtin_data,
- get_image_interpolation(b_env_node),
- EXTENSION_REPEAT,
- env->use_alpha);
+ if (b_image.is_updated()) {
+ scene->image_manager->tag_reload_image(env->filename.string(),
+ env->builtin_data,
+ get_image_interpolation(b_env_node),
+ EXTENSION_REPEAT,
+ env->use_alpha);
}
#endif
}
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index e68f92474bf..500634e7526 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -54,8 +54,8 @@ static inline BL::Mesh object_to_mesh(BL::BlendData &data,
bool subsurf_mod_show_render = false;
bool subsurf_mod_show_viewport = false;
- if(subdivision_type != Mesh::SUBDIVISION_NONE) {
- BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1];
+ if (subdivision_type != Mesh::SUBDIVISION_NONE) {
+ BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length() - 1];
subsurf_mod_show_render = subsurf_mod.show_render();
subsurf_mod_show_viewport = subsurf_mod.show_viewport();
@@ -83,8 +83,8 @@ static inline BL::Mesh object_to_mesh(BL::BlendData &data,
}
#if 0
- if(subdivision_type != Mesh::SUBDIVISION_NONE) {
- BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length()-1];
+ if (subdivision_type != Mesh::SUBDIVISION_NONE) {
+ BL::Modifier subsurf_mod = object.modifiers[object.modifiers.length() - 1];
subsurf_mod.show_render(subsurf_mod_show_render);
subsurf_mod.show_viewport(subsurf_mod_show_viewport);
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp
index 68bc3bd4045..936e1dccfa6 100644
--- a/intern/cycles/device/device_cuda.cpp
+++ b/intern/cycles/device/device_cuda.cpp
@@ -653,7 +653,7 @@ class CUDADevice : public Device {
/* For testing mapped host memory, fill up device memory. */
const size_t keep_mb = 1024;
- while(free_after > keep_mb * 1024 * 1024LL) {
+ while (free_after > keep_mb * 1024 * 1024LL) {
CUdeviceptr tmp;
cuda_assert(cuMemAlloc(&tmp, 10 * 1024 * 1024LL));
cuMemGetInfo(&free_after, &total);
diff --git a/intern/cycles/kernel/osl/osl_services.cpp b/intern/cycles/kernel/osl/osl_services.cpp
index eb9f672fd8a..0257e18c3e8 100644
--- a/intern/cycles/kernel/osl/osl_services.cpp
+++ b/intern/cycles/kernel/osl/osl_services.cpp
@@ -733,7 +733,7 @@ bool OSLRenderServices::get_object_standard_attribute(
return set_attribute_float3(f, type, derivatives, val);
}
#if 0 /* unsupported */
- else if(name == u_particle_rotation) {
+ else if (name == u_particle_rotation) {
int particle_id = object_particle_id(kg, sd->object);
float4 f = particle_rotation(kg, particle_id);
return set_attribute_float4(f, type, derivatives, val);
diff --git a/intern/cycles/kernel/shaders/stdosl.h b/intern/cycles/kernel/shaders/stdosl.h
index 9b9720ffff9..2762b414ce4 100644
--- a/intern/cycles/kernel/shaders/stdosl.h
+++ b/intern/cycles/kernel/shaders/stdosl.h
@@ -235,15 +235,42 @@ int clamp(int x, int minval, int maxval)
return max(min(x, maxval), minval);
}
#if 0
-normal mix (normal x, normal y, normal a) { return x*(1-a) + y*a; }
-normal mix (normal x, normal y, float a) { return x*(1-a) + y*a; }
-vector mix (vector x, vector y, vector a) { return x*(1-a) + y*a; }
-vector mix (vector x, vector y, float a) { return x*(1-a) + y*a; }
-point mix (point x, point y, point a) { return x*(1-a) + y*a; }
-point mix (point x, point y, float a) { return x*(1-a) + y*a; }
-color mix (color x, color y, color a) { return x*(1-a) + y*a; }
-color mix (color x, color y, float a) { return x*(1-a) + y*a; }
-float mix (float x, float y, float a) { return x*(1-a) + y*a; }
+normal mix(normal x, normal y, normal a)
+{
+ return x * (1 - a) + y * a;
+}
+normal mix(normal x, normal y, float a)
+{
+ return x * (1 - a) + y * a;
+}
+vector mix(vector x, vector y, vector a)
+{
+ return x * (1 - a) + y * a;
+}
+vector mix(vector x, vector y, float a)
+{
+ return x * (1 - a) + y * a;
+}
+point mix(point x, point y, point a)
+{
+ return x * (1 - a) + y * a;
+}
+point mix(point x, point y, float a)
+{
+ return x * (1 - a) + y * a;
+}
+color mix(color x, color y, color a)
+{
+ return x * (1 - a) + y * a;
+}
+color mix(color x, color y, float a)
+{
+ return x * (1 - a) + y * a;
+}
+float mix(float x, float y, float a)
+{
+ return x * (1 - a) + y * a;
+}
#else
normal mix(normal x, normal y, normal a) BUILTIN;
normal mix(normal x, normal y, float a) BUILTIN;
@@ -369,7 +396,7 @@ point rotate(point p, float angle, point a, point b)
* anisotropic shader where angle is usually constant.
*/
#if 0
- sincos (angle, sinang, cosang);
+ sincos(angle, sinang, cosang);
#else
sinang = sin(angle);
cosang = cos(angle);
diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp
index 9c9070c8a90..a950324d4d4 100644
--- a/intern/cycles/render/camera.cpp
+++ b/intern/cycles/render/camera.cpp
@@ -716,10 +716,17 @@ float Camera::world_to_raster_size(float3 P)
float3 raster = transform_perspective(&full_cameratoraster, make_float3(dir.x, dir.y, 0.0f));
ray.t = 1.0f;
- camera_sample_panorama(&kernel_camera, kernel_camera_motion.data(), raster.x, raster.y, 0.0f, 0.0f, &ray);
- if(ray.t == 0.0f) {
+ camera_sample_panorama(
+ &kernel_camera, kernel_camera_motion.data(), raster.x, raster.y, 0.0f, 0.0f, &ray);
+ if (ray.t == 0.0f) {
/* No differentials, just use from directly ahead. */
- camera_sample_panorama(&kernel_camera, kernel_camera_motion.data(), 0.5f*full_width, 0.5f*full_height, 0.0f, 0.0f, &ray);
+ camera_sample_panorama(&kernel_camera,
+ kernel_camera_motion.data(),
+ 0.5f * full_width,
+ 0.5f * full_height,
+ 0.0f,
+ 0.0f,
+ &ray);
}
#else
camera_sample_panorama(&kernel_camera,
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index f3572ee1585..30968ab0c5e 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -3888,7 +3888,7 @@ void ParticleInfoNode::attributes(Shader *shader, AttributeRequestSet *attribute
if (!output("Location")->links.empty())
attributes->add(ATTR_STD_PARTICLE);
#if 0 /* not yet supported */
- if(!output("Rotation")->links.empty())
+ if (!output("Rotation")->links.empty())
attributes->add(ATTR_STD_PARTICLE);
#endif
if (!output("Size")->links.empty())
@@ -3933,7 +3933,7 @@ void ParticleInfoNode::compile(SVMCompiler &compiler)
/* quaternion data is not yet supported by Cycles */
#if 0
out = output("Rotation");
- if(!out->links.empty()) {
+ if (!out->links.empty()) {
compiler.add_node(NODE_PARTICLE_INFO, NODE_INFO_PAR_ROTATION, compiler.stack_assign(out));
}
#endif
diff --git a/intern/cycles/util/util_math.h b/intern/cycles/util/util_math.h
index 2c7f826db93..92cab29346a 100644
--- a/intern/cycles/util/util_math.h
+++ b/intern/cycles/util/util_math.h
@@ -417,12 +417,12 @@ ccl_device_inline float triangle_area(const float3 v1, const float3 v2, const fl
ccl_device_inline void make_orthonormals(const float3 N, float3 *a, float3 *b)
{
#if 0
- if(fabsf(N.y) >= 0.999f) {
+ if (fabsf(N.y) >= 0.999f) {
*a = make_float3(1, 0, 0);
*b = make_float3(0, 0, 1);
return;
}
- if(fabsf(N.z) >= 0.999f) {
+ if (fabsf(N.z) >= 0.999f) {
*a = make_float3(1, 0, 0);
*b = make_float3(0, 1, 0);
return;
diff --git a/intern/cycles/util/util_transform.h b/intern/cycles/util/util_transform.h
index 13ca27c2fed..cfe71d696ed 100644
--- a/intern/cycles/util/util_transform.h
+++ b/intern/cycles/util/util_transform.h
@@ -328,11 +328,11 @@ ccl_device_inline float4 quat_interpolate(float4 q1, float4 q2, float t)
/* possible optimization: it might be possible to precompute theta/qperp */
- if(costheta > 0.9995f) {
+ if (costheta > 0.9995f) {
/* linear interpolation in degenerate case */
- return normalize((1.0f - t)*q1 + t*q2);
+ return normalize((1.0f - t) * q1 + t * q2);
}
- else {
+ else {
/* slerp */
float theta = acosf(clamp(costheta, -1.0f, 1.0f));
float4 qperp = normalize(q2 - q1 * costheta);