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
path: root/intern
diff options
context:
space:
mode:
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/app/cycles_cubin_cc.cpp3
-rw-r--r--intern/cycles/blender/blender_shader.cpp6
-rw-r--r--intern/cycles/device/device_cpu.cpp2
-rw-r--r--intern/cycles/device/opencl/opencl_util.cpp12
-rw-r--r--intern/cycles/graph/node.cpp4
-rw-r--r--intern/cycles/kernel/closure/bsdf_hair_principled.h2
-rw-r--r--intern/cycles/kernel/kernel_path_state.h2
-rw-r--r--intern/cycles/kernel/kernel_shader.h2
-rw-r--r--intern/cycles/kernel/osl/osl_bssrdf.cpp12
-rw-r--r--intern/cycles/kernel/osl/osl_closures.cpp6
-rw-r--r--intern/cycles/kernel/svm/svm_ao.h4
-rw-r--r--intern/cycles/kernel/svm/svm_bevel.h4
-rw-r--r--intern/cycles/kernel/svm/svm_closure.h4
-rw-r--r--intern/cycles/kernel/svm/svm_math_util.h8
-rw-r--r--intern/cycles/kernel/svm/svm_voronoi.h8
-rw-r--r--intern/cycles/render/graph.cpp2
-rw-r--r--intern/cycles/render/light.cpp6
-rw-r--r--intern/cycles/render/nodes.cpp8
-rw-r--r--intern/cycles/util/util_math_intersect.h6
-rw-r--r--intern/cycles/util/util_system.cpp2
20 files changed, 50 insertions, 53 deletions
diff --git a/intern/cycles/app/cycles_cubin_cc.cpp b/intern/cycles/app/cycles_cubin_cc.cpp
index 01a1234531b..da8ca53c8df 100644
--- a/intern/cycles/app/cycles_cubin_cc.cpp
+++ b/intern/cycles/app/cycles_cubin_cc.cpp
@@ -159,8 +159,7 @@ bool link_ptxas(CompilationSettings &settings)
" --gpu-name sm_" + std::to_string(settings.target_arch) +
" -m" + std::to_string(settings.bits);
- if (settings.verbose)
- {
+ if(settings.verbose) {
ptx += " --verbose";
printf("%s\n", ptx.c_str());
}
diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp
index 25e6db18588..3eefb92f6af 100644
--- a/intern/cycles/blender/blender_shader.cpp
+++ b/intern/cycles/blender/blender_shader.cpp
@@ -1057,7 +1057,7 @@ static void add_nodes(Scene *scene,
for(b_node->internal_links.begin(b_link); b_link != b_node->internal_links.end(); ++b_link) {
BL::NodeSocket to_socket(b_link->to_socket());
SocketType::Type to_socket_type = convert_socket_type(to_socket);
- if (to_socket_type == SocketType::UNDEFINED) {
+ if(to_socket_type == SocketType::UNDEFINED) {
continue;
}
@@ -1084,7 +1084,7 @@ static void add_nodes(Scene *scene,
*/
for(b_node->inputs.begin(b_input); b_input != b_node->inputs.end(); ++b_input) {
SocketType::Type input_type = convert_socket_type(*b_input);
- if (input_type == SocketType::UNDEFINED) {
+ if(input_type == SocketType::UNDEFINED) {
continue;
}
@@ -1100,7 +1100,7 @@ static void add_nodes(Scene *scene,
}
for(b_node->outputs.begin(b_output); b_output != b_node->outputs.end(); ++b_output) {
SocketType::Type output_type = convert_socket_type(*b_output);
- if (output_type == SocketType::UNDEFINED) {
+ if(output_type == SocketType::UNDEFINED) {
continue;
}
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp
index be0dcc20755..6867dffc727 100644
--- a/intern/cycles/device/device_cpu.cpp
+++ b/intern/cycles/device/device_cpu.cpp
@@ -1025,7 +1025,7 @@ void device_cpu_info(vector<DeviceInfo>& devices)
info.num = 0;
info.advanced_shading = true;
info.bvh_layout_mask = BVH_LAYOUT_BVH2;
- if (system_cpu_support_sse2()) {
+ if(system_cpu_support_sse2()) {
info.bvh_layout_mask |= BVH_LAYOUT_BVH4;
}
info.has_volume_decoupled = true;
diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp
index d6304ba688a..895e4149a3a 100644
--- a/intern/cycles/device/opencl/opencl_util.cpp
+++ b/intern/cycles/device/opencl/opencl_util.cpp
@@ -1139,13 +1139,13 @@ string OpenCLInfo::get_readable_device_name(cl_device_id device_id)
/* Special exception for AMD Vega, need to be able to tell
* Vega 56 from 64 apart.
*/
- if (name == "Radeon RX Vega") {
+ if(name == "Radeon RX Vega") {
cl_int max_compute_units = 0;
- if (clGetDeviceInfo(device_id,
- CL_DEVICE_MAX_COMPUTE_UNITS,
- sizeof(max_compute_units),
- &max_compute_units,
- NULL) == CL_SUCCESS)
+ if(clGetDeviceInfo(device_id,
+ CL_DEVICE_MAX_COMPUTE_UNITS,
+ sizeof(max_compute_units),
+ &max_compute_units,
+ NULL) == CL_SUCCESS)
{
name += " " + to_string(max_compute_units);
}
diff --git a/intern/cycles/graph/node.cpp b/intern/cycles/graph/node.cpp
index 5960d9aa7d5..19fe0a168ea 100644
--- a/intern/cycles/graph/node.cpp
+++ b/intern/cycles/graph/node.cpp
@@ -443,7 +443,7 @@ template<typename T>
void array_hash(const Node *node, const SocketType& socket, MD5Hash& md5)
{
const array<T>& a = *(const array<T>*)(((char*)node) + socket.struct_offset);
- for (size_t i = 0; i < a.size(); i++) {
+ for(size_t i = 0; i < a.size(); i++) {
md5.append((uint8_t*)&a[i], sizeof(T));
}
}
@@ -452,7 +452,7 @@ void float3_array_hash(const Node *node, const SocketType& socket, MD5Hash& md5)
{
/* Don't compare 4th element used for padding. */
const array<float3>& a = *(const array<float3>*)(((char*)node) + socket.struct_offset);
- for (size_t i = 0; i < a.size(); i++) {
+ for(size_t i = 0; i < a.size(); i++) {
md5.append((uint8_t*)&a[i], sizeof(float) * 3);
}
}
diff --git a/intern/cycles/kernel/closure/bsdf_hair_principled.h b/intern/cycles/kernel/closure/bsdf_hair_principled.h
index 4ee58089384..b3b56be39ff 100644
--- a/intern/cycles/kernel/closure/bsdf_hair_principled.h
+++ b/intern/cycles/kernel/closure/bsdf_hair_principled.h
@@ -120,7 +120,7 @@ ccl_device_inline float bessel_I0(float x)
/* Logarithm of the Bessel function of the first kind. */
ccl_device_inline float log_bessel_I0(float x)
{
- if (x > 12.0f) {
+ if(x > 12.0f) {
/* log(1/x) == -log(x) iff x > 0.
* This is only used with positive cosines */
return x + 0.5f * (1.f / (8.0f * x) - M_LN_2PI_F - logf(x));
diff --git a/intern/cycles/kernel/kernel_path_state.h b/intern/cycles/kernel/kernel_path_state.h
index b13fabde268..e85050df4bb 100644
--- a/intern/cycles/kernel/kernel_path_state.h
+++ b/intern/cycles/kernel/kernel_path_state.h
@@ -170,7 +170,7 @@ ccl_device_inline bool path_state_volume_next(KernelGlobals *kg, ccl_addr_space
/* For volume bounding meshes we pass through without counting transparent
* bounces, only sanity check in case self intersection gets us stuck. */
state->volume_bounds_bounce++;
- if (state->volume_bounds_bounce > VOLUME_BOUNDS_MAX) {
+ if(state->volume_bounds_bounce > VOLUME_BOUNDS_MAX) {
return false;
}
diff --git a/intern/cycles/kernel/kernel_shader.h b/intern/cycles/kernel/kernel_shader.h
index b83460b3ffb..e834b701f96 100644
--- a/intern/cycles/kernel/kernel_shader.h
+++ b/intern/cycles/kernel/kernel_shader.h
@@ -1010,7 +1010,7 @@ ccl_device void shader_eval_surface(KernelGlobals *kg, ShaderData *sd,
DiffuseBsdf *bsdf = (DiffuseBsdf*)bsdf_alloc(sd,
sizeof(DiffuseBsdf),
make_float3(0.8f, 0.8f, 0.8f));
- if (bsdf != NULL) {
+ if(bsdf != NULL) {
bsdf->N = sd->N;
sd->flag |= bsdf_diffuse_setup(bsdf);
}
diff --git a/intern/cycles/kernel/osl/osl_bssrdf.cpp b/intern/cycles/kernel/osl/osl_bssrdf.cpp
index 2ebfd5f0c2f..66ec8a996ca 100644
--- a/intern/cycles/kernel/osl/osl_bssrdf.cpp
+++ b/intern/cycles/kernel/osl/osl_bssrdf.cpp
@@ -69,22 +69,22 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight)
{
- if (method == u_cubic) {
+ if(method == u_cubic) {
alloc(sd, path_flag, weight, CLOSURE_BSSRDF_CUBIC_ID);
}
- else if (method == u_gaussian) {
+ else if(method == u_gaussian) {
alloc(sd, path_flag, weight, CLOSURE_BSSRDF_GAUSSIAN_ID);
}
- else if (method == u_burley) {
+ else if(method == u_burley) {
alloc(sd, path_flag, weight, CLOSURE_BSSRDF_BURLEY_ID);
}
- else if (method == u_principled) {
+ else if(method == u_principled) {
alloc(sd, path_flag, weight, CLOSURE_BSSRDF_PRINCIPLED_ID);
}
- else if (method == u_random_walk) {
+ else if(method == u_random_walk) {
alloc(sd, path_flag, weight, CLOSURE_BSSRDF_RANDOM_WALK_ID);
}
- else if (method == u_principled_random_walk) {
+ else if(method == u_principled_random_walk) {
alloc(sd, path_flag, weight, CLOSURE_BSSRDF_PRINCIPLED_RANDOM_WALK_ID);
}
}
diff --git a/intern/cycles/kernel/osl/osl_closures.cpp b/intern/cycles/kernel/osl/osl_closures.cpp
index 8c7ae30725c..169351d5ad9 100644
--- a/intern/cycles/kernel/osl/osl_closures.cpp
+++ b/intern/cycles/kernel/osl/osl_closures.cpp
@@ -200,11 +200,9 @@ public:
void setup(ShaderData *sd, int path_flag, float3 weight)
{
- if(!skip(sd, path_flag, LABEL_GLOSSY))
- {
+ if(!skip(sd, path_flag, LABEL_GLOSSY)) {
PrincipledHairBSDF *bsdf = (PrincipledHairBSDF*)alloc(sd, path_flag, weight);
- if (!bsdf)
- {
+ if(!bsdf) {
return;
}
diff --git a/intern/cycles/kernel/svm/svm_ao.h b/intern/cycles/kernel/svm/svm_ao.h
index d2d36cefd50..0337c88a543 100644
--- a/intern/cycles/kernel/svm/svm_ao.h
+++ b/intern/cycles/kernel/svm/svm_ao.h
@@ -98,11 +98,11 @@ ccl_device void svm_node_ao(KernelGlobals *kg,
float3 normal = stack_valid(normal_offset)? stack_load_float3(stack, normal_offset): sd->N;
float ao = svm_ao(kg, sd, normal, state, dist, samples, flags);
- if (stack_valid(out_ao_offset)) {
+ if(stack_valid(out_ao_offset)) {
stack_store_float(stack, out_ao_offset, ao);
}
- if (stack_valid(out_color_offset)) {
+ if(stack_valid(out_color_offset)) {
float3 color = stack_load_float3(stack, color_offset);
stack_store_float3(stack, out_color_offset, ao * color);
}
diff --git a/intern/cycles/kernel/svm/svm_bevel.h b/intern/cycles/kernel/svm/svm_bevel.h
index 19cdb71c20f..79d0fb6ddbe 100644
--- a/intern/cycles/kernel/svm/svm_bevel.h
+++ b/intern/cycles/kernel/svm/svm_bevel.h
@@ -148,11 +148,11 @@ ccl_device_noinline float3 svm_bevel(
int prim = kernel_tex_fetch(__prim_index, isect.hits[hit].prim);
int shader = kernel_tex_fetch(__tri_shader, prim);
- if (shader & SHADER_SMOOTH_NORMAL) {
+ if(shader & SHADER_SMOOTH_NORMAL) {
float u = isect.hits[hit].u;
float v = isect.hits[hit].v;
- if (sd->type & PRIMITIVE_TRIANGLE) {
+ if(sd->type & PRIMITIVE_TRIANGLE) {
N = triangle_smooth_normal(kg, N, prim, u, v);
}
#ifdef __OBJECT_MOTION__
diff --git a/intern/cycles/kernel/svm/svm_closure.h b/intern/cycles/kernel/svm/svm_closure.h
index aa253223c93..cce0e0eefe0 100644
--- a/intern/cycles/kernel/svm/svm_closure.h
+++ b/intern/cycles/kernel/svm/svm_closure.h
@@ -757,7 +757,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
const AttributeDescriptor attr_descr_random = find_attribute(kg, sd, data_node4.y);
float random = 0.0f;
- if (attr_descr_random.offset != ATTR_STD_NOT_FOUND) {
+ if(attr_descr_random.offset != ATTR_STD_NOT_FOUND) {
random = primitive_attribute_float(kg, sd, attr_descr_random, NULL, NULL);
}
else {
@@ -769,7 +769,7 @@ ccl_device void svm_node_closure_bsdf(KernelGlobals *kg, ShaderData *sd, float *
if(bsdf) {
PrincipledHairExtra *extra = (PrincipledHairExtra*)closure_alloc_extra(sd, sizeof(PrincipledHairExtra));
- if (!extra)
+ if(!extra)
break;
/* Random factors range: [-randomization/2, +randomization/2]. */
diff --git a/intern/cycles/kernel/svm/svm_math_util.h b/intern/cycles/kernel/svm/svm_math_util.h
index d3490ab284f..669b174e4a3 100644
--- a/intern/cycles/kernel/svm/svm_math_util.h
+++ b/intern/cycles/kernel/svm/svm_math_util.h
@@ -94,13 +94,13 @@ ccl_device float svm_math(NodeMath type, float Fac1, float Fac2)
Fac = fabsf(Fac1);
else if(type == NODE_MATH_ARCTAN2)
Fac = atan2f(Fac1, Fac2);
- else if (type == NODE_MATH_FLOOR)
+ else if(type == NODE_MATH_FLOOR)
Fac = floorf(Fac1);
- else if (type == NODE_MATH_CEIL)
+ else if(type == NODE_MATH_CEIL)
Fac = ceilf(Fac1);
- else if (type == NODE_MATH_FRACT)
+ else if(type == NODE_MATH_FRACT)
Fac = Fac1 - floorf(Fac1);
- else if (type == NODE_MATH_SQRT)
+ else if(type == NODE_MATH_SQRT)
Fac = safe_sqrtf(Fac1);
else if(type == NODE_MATH_CLAMP)
Fac = saturate(Fac1);
diff --git a/intern/cycles/kernel/svm/svm_voronoi.h b/intern/cycles/kernel/svm/svm_voronoi.h
index 4e66e87611f..d661df54ead 100644
--- a/intern/cycles/kernel/svm/svm_voronoi.h
+++ b/intern/cycles/kernel/svm/svm_voronoi.h
@@ -70,7 +70,7 @@ ccl_device void voronoi_neighbors(float3 p, NodeVoronoiDistanceMetric distance,
}
/* To keep the shortest four distances and associated points we have to keep them in sorted order. */
- if (d < da[0]) {
+ if(d < da[0]) {
da[3] = da[2];
da[2] = da[1];
da[1] = da[0];
@@ -81,7 +81,7 @@ ccl_device void voronoi_neighbors(float3 p, NodeVoronoiDistanceMetric distance,
pa[1] = pa[0];
pa[0] = vp;
}
- else if (d < da[1]) {
+ else if(d < da[1]) {
da[3] = da[2];
da[2] = da[1];
da[1] = d;
@@ -90,14 +90,14 @@ ccl_device void voronoi_neighbors(float3 p, NodeVoronoiDistanceMetric distance,
pa[2] = pa[1];
pa[1] = vp;
}
- else if (d < da[2]) {
+ else if(d < da[2]) {
da[3] = da[2];
da[2] = d;
pa[3] = pa[2];
pa[2] = vp;
}
- else if (d < da[3]) {
+ else if(d < da[3]) {
da[3] = d;
pa[3] = vp;
}
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 3a9e2981418..eea1bed58dc 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -245,7 +245,7 @@ void ShaderGraph::connect(ShaderOutput *from, ShaderInput *to)
ShaderNode *convert;
ShaderInput *convert_in;
- if (to->type() == SocketType::CLOSURE) {
+ if(to->type() == SocketType::CLOSURE) {
EmissionNode *emission = new EmissionNode();
emission->color = make_float3(1.0f, 1.0f, 1.0f);
emission->strength = 1.0f;
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index da29e1a255a..3580f4a8eeb 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -548,7 +548,7 @@ void LightManager::device_update_background(Device *device,
/* get the resolution from the light's size (we stuff it in there) */
int2 res = make_int2(background_light->map_resolution, background_light->map_resolution/2);
/* If the resolution isn't set manually, try to find an environment texture. */
- if (res.x == 0) {
+ if(res.x == 0) {
Shader *shader = (scene->background->shader) ? scene->background->shader : scene->default_background;
foreach(ShaderNode *node, shader->graph->nodes) {
if(node->type == EnvironmentTextureNode::node_type) {
@@ -560,12 +560,12 @@ void LightManager::device_update_background(Device *device,
}
}
}
- if (res.x > 0 && res.y > 0) {
+ if(res.x > 0 && res.y > 0) {
VLOG(2) << "Automatically set World MIS resolution to " << res.x << " by " << res.y << "\n";
}
}
/* If it's still unknown, just use the default. */
- if (res.x == 0 || res.y == 0) {
+ if(res.x == 0 || res.y == 0) {
res = make_int2(1024, 512);
VLOG(2) << "Setting World MIS resolution to default\n";
}
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 96e7459a48c..1943f8c3e2b 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -951,9 +951,9 @@ void VoronoiTextureNode::compile(SVMCompiler& compiler)
ShaderOutput *color_out = output("Color");
ShaderOutput *fac_out = output("Fac");
- if (vector_in->link) compiler.stack_assign(vector_in);
- if (scale_in->link) compiler.stack_assign(scale_in);
- if (exponent_in->link) compiler.stack_assign(exponent_in);
+ if(vector_in->link) compiler.stack_assign(vector_in);
+ if(scale_in->link) compiler.stack_assign(scale_in);
+ if(exponent_in->link) compiler.stack_assign(exponent_in);
int vector_offset = tex_mapping.compile_begin(compiler, vector_in);
@@ -2856,7 +2856,7 @@ void AmbientOcclusionNode::compile(SVMCompiler& compiler)
int flags = (inside? NODE_AO_INSIDE : 0) | (only_local? NODE_AO_ONLY_LOCAL : 0);
- if (!distance_in->link && distance == 0.0f) {
+ if(!distance_in->link && distance == 0.0f) {
flags |= NODE_AO_GLOBAL_RADIUS;
}
diff --git a/intern/cycles/util/util_math_intersect.h b/intern/cycles/util/util_math_intersect.h
index 61ddcc38f50..b5fbb24091f 100644
--- a/intern/cycles/util/util_math_intersect.h
+++ b/intern/cycles/util/util_math_intersect.h
@@ -136,10 +136,10 @@ ccl_device_forceinline bool ray_triangle_intersect(
#if defined(__KERNEL_SSE2__) && defined (__KERNEL_SSE__)
int uvw_sign = movemask(UVWW) & 0x7;
- if (uvw_sign != 0)
- {
- if (uvw_sign != 0x7)
+ if(uvw_sign != 0) {
+ if(uvw_sign != 0x7) {
return false;
+ }
}
#else
const float minUVW = min(U, min(V, W));
diff --git a/intern/cycles/util/util_system.cpp b/intern/cycles/util/util_system.cpp
index 8ae5b63b2f9..2428b0b2989 100644
--- a/intern/cycles/util/util_system.cpp
+++ b/intern/cycles/util/util_system.cpp
@@ -300,7 +300,7 @@ size_t system_physical_ram()
#elif defined(__APPLE__)
uint64_t ram = 0;
size_t len = sizeof(ram);
- if (sysctlbyname("hw.memsize", &ram, &len, NULL, 0) == 0) {
+ if(sysctlbyname("hw.memsize", &ram, &len, NULL, 0) == 0) {
return ram;
}
return 0;