diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-30 17:04:01 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-30 17:04:04 +0300 |
commit | 3918c8b9a52ae9dcdb0488df92d7d3ca615be8c7 (patch) | |
tree | 3740e477610ab3ed020d505cd98308d29f663f5b /intern/cycles/kernel/kernels/cuda | |
parent | c8a551bf13edf711b93ea89cd3fcd244e4206cee (diff) |
Cycles: Optionally output luminance from the shader evaluation kernel
This makes it possible to move some parts of evaluation from host to the device
and hopefully reduce memory usage by avoid having full RGBA buffer on the host.
Reviewers: juicyfruit, lukasstockner97, brecht
Reviewed By: lukasstockner97, brecht
Differential Revision: https://developer.blender.org/D1702
Diffstat (limited to 'intern/cycles/kernel/kernels/cuda')
-rw-r--r-- | intern/cycles/kernel/kernels/cuda/kernel.cu | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/intern/cycles/kernel/kernels/cuda/kernel.cu b/intern/cycles/kernel/kernels/cuda/kernel.cu index 3929b676f07..e094612de01 100644 --- a/intern/cycles/kernel/kernels/cuda/kernel.cu +++ b/intern/cycles/kernel/kernels/cuda/kernel.cu @@ -159,12 +159,26 @@ kernel_cuda_convert_to_half_float(uchar4 *rgba, float *buffer, float sample_scal extern "C" __global__ void CUDA_LAUNCH_BOUNDS(CUDA_THREADS_BLOCK_WIDTH, CUDA_KERNEL_MAX_REGISTERS) -kernel_cuda_shader(uint4 *input, float4 *output, int type, int sx, int sw, int offset, int sample) +kernel_cuda_shader(uint4 *input, + float4 *output, + float *output_luma, + int type, + int sx, + int sw, + int offset, + int sample) { int x = sx + blockDim.x*blockIdx.x + threadIdx.x; - if(x < sx + sw) - kernel_shader_evaluate(NULL, input, output, (ShaderEvalType)type, x, sample); + if(x < sx + sw) { + kernel_shader_evaluate(NULL, + input, + output, + output_luma, + (ShaderEvalType)type, + x, + sample); + } } extern "C" __global__ void |