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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-12-23 13:31:19 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-01-23 14:56:55 +0300
commitbc096e1eb8790c1624ce7386cd86668267fbea48 (patch)
tree9a58e4f9f2c9bd20595d65836a00f699df83a79a /intern/cycles/kernel/kernel_path_branched.h
parentb9311b5e5a51fec85e3bb3c1d3eaa8a2dcc839e3 (diff)
Cycles: Split ShaderData object and shader flags
We started to run out of bits there, so now we separate flags which came from __object_flags and which are either runtime or coming from __shader_flags. Rule now is: SD_OBJECT_* flags are to be tested against new object_flags field of ShaderData, all the rest flags are to be tested against flags field of ShaderData. There should be no user-visible changes, and time difference should be minimal. In fact, from tests here can only see hardly measurable difference and sometimes the new code is somewhat faster (all within a noise floor, so hard to tell for sure). Reviewers: brecht, dingto, juicyfruit, lukasstockner97, maiself Differential Revision: https://developer.blender.org/D2428
Diffstat (limited to 'intern/cycles/kernel/kernel_path_branched.h')
-rw-r--r--intern/cycles/kernel/kernel_path_branched.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/intern/cycles/kernel/kernel_path_branched.h b/intern/cycles/kernel/kernel_path_branched.h
index 4ec0ac8e8c9..ff2b828795d 100644
--- a/intern/cycles/kernel/kernel_path_branched.h
+++ b/intern/cycles/kernel/kernel_path_branched.h
@@ -167,8 +167,9 @@ ccl_device void kernel_branched_path_subsurface_scatter(KernelGlobals *kg,
true);
#ifdef __VOLUME__
Ray volume_ray = *ray;
- bool need_update_volume_stack = kernel_data.integrator.use_volumes &&
- ccl_fetch(sd, flag) & SD_OBJECT_INTERSECTS_VOLUME;
+ bool need_update_volume_stack =
+ kernel_data.integrator.use_volumes &&
+ ccl_fetch(sd, object_flag) & SD_OBJECT_INTERSECTS_VOLUME;
#endif /* __VOLUME__ */
/* compute lighting with the BSDF closure */
@@ -473,21 +474,21 @@ ccl_device float4 kernel_branched_path_integrate(KernelGlobals *kg, RNG *rng, in
/* holdout */
#ifdef __HOLDOUT__
- if(sd.flag & (SD_HOLDOUT|SD_OBJECT_HOLDOUT_MASK)) {
+ if((sd.flag & SD_HOLDOUT) || (sd.object_flag & SD_OBJECT_HOLDOUT_MASK)) {
if(kernel_data.background.transparent) {
float3 holdout_weight;
-
- if(sd.flag & SD_OBJECT_HOLDOUT_MASK)
+ if(sd.object_flag & SD_OBJECT_HOLDOUT_MASK) {
holdout_weight = make_float3(1.0f, 1.0f, 1.0f);
- else
+ }
+ else {
holdout_weight = shader_holdout_eval(kg, &sd);
-
+ }
/* any throughput is ok, should all be identical here */
L_transparent += average(holdout_weight*throughput);
}
-
- if(sd.flag & SD_OBJECT_HOLDOUT_MASK)
+ if(sd.object_flag & SD_OBJECT_HOLDOUT_MASK) {
break;
+ }
}
#endif /* __HOLDOUT__ */