diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-03 11:56:40 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-03 12:03:56 +0300 |
commit | b9f89b164785f28b023af071d696c298deba4f63 (patch) | |
tree | 4fd045caacf2850d34820ac4d07422ca83cc2fba /intern/cycles/kernel/split | |
parent | 80f344fd952a42fd7250e1eca67c8f2c19d8897b (diff) |
Cycles: Code cleanup in split kernel, whitespaces
Diffstat (limited to 'intern/cycles/kernel/split')
5 files changed, 14 insertions, 18 deletions
diff --git a/intern/cycles/kernel/split/kernel_background_buffer_update.h b/intern/cycles/kernel/split/kernel_background_buffer_update.h index 181a1054a0d..0132ef9c2f2 100644 --- a/intern/cycles/kernel/split/kernel_background_buffer_update.h +++ b/intern/cycles/kernel/split/kernel_background_buffer_update.h @@ -161,15 +161,14 @@ ccl_device char kernel_background_buffer_update( ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); } - if(IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND)) - { + if(IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND)) { #ifdef __BACKGROUND__ - /* sample background shader */ - float3 L_background = indirect_background(kg, state, ray, sd); - path_radiance_accum_background(L, (*throughput), L_background, state->bounce); + /* sample background shader */ + float3 L_background = indirect_background(kg, state, ray, sd); + path_radiance_accum_background(L, (*throughput), L_background, state->bounce); #endif - ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); - } + ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); + } } if(IS_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER)) { diff --git a/intern/cycles/kernel/split/kernel_data_init.h b/intern/cycles/kernel/split/kernel_data_init.h index 2cd98e466c1..421e2356f9b 100644 --- a/intern/cycles/kernel/split/kernel_data_init.h +++ b/intern/cycles/kernel/split/kernel_data_init.h @@ -291,13 +291,13 @@ ccl_device void kernel_data_init( /* Initialize queue data and queue index. */ if(thread_index < queuesize) { - /* Initialize active ray queue */ + /* Initialize active ray queue. */ Queue_data[QUEUE_ACTIVE_AND_REGENERATED_RAYS * queuesize + thread_index] = QUEUE_EMPTY_SLOT; - /* Initialize background and buffer update queue */ + /* Initialize background and buffer update queue. */ Queue_data[QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS * queuesize + thread_index] = QUEUE_EMPTY_SLOT; - /* Initialize shadow ray cast of AO queue */ + /* Initialize shadow ray cast of AO queue. */ Queue_data[QUEUE_SHADOW_RAY_CAST_AO_RAYS * queuesize + thread_index] = QUEUE_EMPTY_SLOT; - /* Initialize shadow ray cast of direct lighting queue */ + /* Initialize shadow ray cast of direct lighting queue. */ Queue_data[QUEUE_SHADOW_RAY_CAST_DL_RAYS * queuesize + thread_index] = QUEUE_EMPTY_SLOT; } @@ -316,7 +316,6 @@ ccl_device void kernel_data_init( int y = get_global_id(1); if(x < (sw * parallel_samples) && y < sh) { - int ray_index = x + y * (sw * parallel_samples); /* This is the first assignment to ray_state; @@ -400,12 +399,10 @@ ccl_device void kernel_data_init( #endif } else { /* These rays do not participate in path-iteration. */ - float4 L_rad = make_float4(0.0f, 0.0f, 0.0f, 0.0f); /* Accumulate result in output buffer. */ kernel_write_pass_float4(per_sample_output_buffers, my_sample, L_rad); path_rng_end(kg, rng_state, rng_coop[ray_index]); - ASSIGN_RAY_STATE(ray_state, ray_index, RAY_TO_REGENERATE); } } diff --git a/intern/cycles/kernel/split/kernel_next_iteration_setup.h b/intern/cycles/kernel/split/kernel_next_iteration_setup.h index 2dbdabc5fd3..e1a1577d7ae 100644 --- a/intern/cycles/kernel/split/kernel_next_iteration_setup.h +++ b/intern/cycles/kernel/split/kernel_next_iteration_setup.h @@ -127,14 +127,13 @@ ccl_device char kernel_next_iteration_setup( } if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { - ccl_global float3 *throughput = &throughput_coop[ray_index]; ccl_global Ray *ray = &Ray_coop[ray_index]; ccl_global RNG* rng = &rng_coop[ray_index]; state = &PathState_coop[ray_index]; L = &PathRadiance_coop[ray_index]; - /* compute direct lighting and next bounce */ + /* Compute direct lighting and next bounce. */ if(!kernel_path_surface_bounce(kg, rng, sd, throughput, state, L, ray)) { ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); enqueue_flag = 1; diff --git a/intern/cycles/kernel/split/kernel_scene_intersect.h b/intern/cycles/kernel/split/kernel_scene_intersect.h index 73aa005a496..7eb201ecf32 100644 --- a/intern/cycles/kernel/split/kernel_scene_intersect.h +++ b/intern/cycles/kernel/split/kernel_scene_intersect.h @@ -131,7 +131,8 @@ ccl_device void kernel_scene_intersect( if(!hit) { /* Change the state of rays that hit the background; * These rays undergo special processing in the - * background_bufferUpdate kernel*/ + * background_bufferUpdate kernel. + */ ASSIGN_RAY_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND); } } diff --git a/intern/cycles/kernel/split/kernel_shadow_blocked.h b/intern/cycles/kernel/split/kernel_shadow_blocked.h index 154ec53ffbb..28351c2b1ae 100644 --- a/intern/cycles/kernel/split/kernel_shadow_blocked.h +++ b/intern/cycles/kernel/split/kernel_shadow_blocked.h @@ -65,7 +65,7 @@ ccl_device void kernel_shadow_blocked( if(IS_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_DL) || IS_FLAG(ray_state, ray_index, RAY_SHADOW_RAY_CAST_AO)) { - /* Load kernel global structure */ + /* Load kernel global structure. */ KernelGlobals *kg = (KernelGlobals *)globals; ShaderData *sd_shadow = (ShaderData *)shader_shadow; |