Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/device/gpu/kernel.h
| Show First 20 Lines • Show All 750 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS) | ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS) | ||||
| ccl_gpu_kernel_signature(filter_guiding_preprocess, | ccl_gpu_kernel_signature(filter_guiding_preprocess, | ||||
| ccl_global float *guiding_buffer, | ccl_global float *guiding_buffer, | ||||
| int guiding_pass_stride, | int guiding_pass_stride, | ||||
| int guiding_pass_albedo, | int guiding_pass_albedo, | ||||
| int guiding_pass_normal, | int guiding_pass_normal, | ||||
| int guiding_pass_flow, | |||||
| ccl_global const float *render_buffer, | ccl_global const float *render_buffer, | ||||
| int render_offset, | int render_offset, | ||||
| int render_stride, | int render_stride, | ||||
| int render_pass_stride, | int render_pass_stride, | ||||
| int render_pass_sample_count, | int render_pass_sample_count, | ||||
| int render_pass_denoising_albedo, | int render_pass_denoising_albedo, | ||||
| int render_pass_denoising_normal, | int render_pass_denoising_normal, | ||||
| int render_pass_motion, | |||||
| int full_x, | int full_x, | ||||
| int full_y, | int full_y, | ||||
| int width, | int width, | ||||
| int height, | int height, | ||||
| int num_samples) | int num_samples) | ||||
| { | { | ||||
| const int work_index = ccl_gpu_global_id_x(); | const int work_index = ccl_gpu_global_id_x(); | ||||
| const int y = work_index / width; | const int y = work_index / width; | ||||
| Show All 35 Lines | if (guiding_pass_normal != PASS_UNUSED) { | ||||
| ccl_global const float *normal_in = buffer + render_pass_denoising_normal; | ccl_global const float *normal_in = buffer + render_pass_denoising_normal; | ||||
| ccl_global float *normal_out = guiding_pixel + guiding_pass_normal; | ccl_global float *normal_out = guiding_pixel + guiding_pass_normal; | ||||
| normal_out[0] = normal_in[0] * pixel_scale; | normal_out[0] = normal_in[0] * pixel_scale; | ||||
| normal_out[1] = normal_in[1] * pixel_scale; | normal_out[1] = normal_in[1] * pixel_scale; | ||||
| normal_out[2] = normal_in[2] * pixel_scale; | normal_out[2] = normal_in[2] * pixel_scale; | ||||
| } | } | ||||
| /* Flow pass. */ | |||||
| if (guiding_pass_flow != PASS_UNUSED) { | |||||
| kernel_assert(render_pass_motion != PASS_UNUSED); | |||||
| const float *motion_in = buffer + render_pass_motion; | |||||
| float *flow_out = guiding_pixel + guiding_pass_flow; | |||||
| flow_out[0] = -motion_in[0] * pixel_scale; | |||||
| flow_out[1] = -motion_in[1] * pixel_scale; | |||||
| } | |||||
| } | } | ||||
| ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS) | ccl_gpu_kernel(GPU_KERNEL_BLOCK_NUM_THREADS, GPU_KERNEL_MAX_REGISTERS) | ||||
| ccl_gpu_kernel_signature(filter_guiding_set_fake_albedo, | ccl_gpu_kernel_signature(filter_guiding_set_fake_albedo, | ||||
| ccl_global float *guiding_buffer, | ccl_global float *guiding_buffer, | ||||
| int guiding_pass_stride, | int guiding_pass_stride, | ||||
| int guiding_pass_albedo, | int guiding_pass_albedo, | ||||
| int width, | int width, | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | else if (!use_compositing) { | ||||
| * or do not have transparency (shadow catcher). Implicitly rely on this logic, as it | * or do not have transparency (shadow catcher). Implicitly rely on this logic, as it | ||||
| * simplifies logic and avoids extra memory allocation. */ | * simplifies logic and avoids extra memory allocation. */ | ||||
| ccl_global const float *noisy_pixel = buffer + pass_noisy; | ccl_global const float *noisy_pixel = buffer + pass_noisy; | ||||
| denoised_pixel[3] = noisy_pixel[3]; | denoised_pixel[3] = noisy_pixel[3]; | ||||
| } | } | ||||
| else { | else { | ||||
| /* Assigning to zero since this is a default alpha value for 3-component passes, and it | /* Assigning to zero since this is a default alpha value for 3-component passes, and it | ||||
| * is an opaque pixel for 4 component passes. */ | * is an opaque pixel for 4 component passes. */ | ||||
| denoised_pixel[3] = 0; | denoised_pixel[3] = 0; | ||||
| } | } | ||||
| } | } | ||||
| /* -------------------------------------------------------------------- | /* -------------------------------------------------------------------- | ||||
| * Shadow catcher. | * Shadow catcher. | ||||
| */ | */ | ||||
| Show All 20 Lines | |||||