~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to intern/cycles/kernel/kernel.cu

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2011, Blender Foundation.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU General Public License
6
 
 * as published by the Free Software Foundation; either version 2
7
 
 * of the License, or (at your option) any later version.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 
 * GNU General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software Foundation,
16
 
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
2
 * Copyright 2011-2013 Blender Foundation
 
3
 *
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * You may obtain a copy of the License at
 
7
 *
 
8
 * http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License
17
15
 */
18
16
 
19
17
/* CUDA kernel entry points */
35
33
                kernel_path_trace(NULL, buffer, rng_state, sample, x, y, offset, stride);
36
34
}
37
35
 
38
 
extern "C" __global__ void kernel_cuda_tonemap(uchar4 *rgba, float *buffer, int sample, int sx, int sy, int sw, int sh, int offset, int stride)
39
 
{
40
 
        int x = sx + blockDim.x*blockIdx.x + threadIdx.x;
41
 
        int y = sy + blockDim.y*blockIdx.y + threadIdx.y;
42
 
 
43
 
        if(x < sx + sw && y < sy + sh)
44
 
                kernel_film_tonemap(NULL, rgba, buffer, sample, x, y, offset, stride);
 
36
#ifdef __BRANCHED_PATH__
 
37
extern "C" __global__ void kernel_cuda_branched_path_trace(float *buffer, uint *rng_state, int sample, int sx, int sy, int sw, int sh, int offset, int stride)
 
38
{
 
39
        int x = sx + blockDim.x*blockIdx.x + threadIdx.x;
 
40
        int y = sy + blockDim.y*blockIdx.y + threadIdx.y;
 
41
 
 
42
        if(x < sx + sw && y < sy + sh)
 
43
                kernel_branched_path_trace(NULL, buffer, rng_state, sample, x, y, offset, stride);
 
44
}
 
45
#endif
 
46
 
 
47
extern "C" __global__ void kernel_cuda_convert_to_byte(uchar4 *rgba, float *buffer, float sample_scale, int sx, int sy, int sw, int sh, int offset, int stride)
 
48
{
 
49
        int x = sx + blockDim.x*blockIdx.x + threadIdx.x;
 
50
        int y = sy + blockDim.y*blockIdx.y + threadIdx.y;
 
51
 
 
52
        if(x < sx + sw && y < sy + sh)
 
53
                kernel_film_convert_to_byte(NULL, rgba, buffer, sample_scale, x, y, offset, stride);
 
54
}
 
55
 
 
56
extern "C" __global__ void kernel_cuda_convert_to_half_float(uchar4 *rgba, float *buffer, float sample_scale, int sx, int sy, int sw, int sh, int offset, int stride)
 
57
{
 
58
        int x = sx + blockDim.x*blockIdx.x + threadIdx.x;
 
59
        int y = sy + blockDim.y*blockIdx.y + threadIdx.y;
 
60
 
 
61
        if(x < sx + sw && y < sy + sh)
 
62
                kernel_film_convert_to_half_float(NULL, rgba, buffer, sample_scale, x, y, offset, stride);
45
63
}
46
64
 
47
65
extern "C" __global__ void kernel_cuda_shader(uint4 *input, float4 *output, int type, int sx)