Blender  V2.93
filter_defines.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2017 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.
15  */
16 
17 #ifndef __FILTER_DEFINES_H__
18 #define __FILTER_DEFINES_H__
19 
20 #define DENOISE_FEATURES 11
21 #define TRANSFORM_SIZE (DENOISE_FEATURES * DENOISE_FEATURES)
22 #define XTWX_SIZE (((DENOISE_FEATURES + 1) * (DENOISE_FEATURES + 2)) / 2)
23 #define XTWY_SIZE (DENOISE_FEATURES + 1)
24 
25 #define DENOISE_MAX_FRAMES 16
26 
27 typedef struct TileInfo {
28  int offsets[9];
29  int strides[9];
30  int x[4];
31  int y[4];
35  /* TODO(lukas): CUDA doesn't have uint64_t... */
36 #ifdef __KERNEL_OPENCL__
37  ccl_global float *buffers[9];
38 #else
39  long long int buffers[9];
40 #endif
42 
43 #ifdef __KERNEL_OPENCL__
44 # define CCL_FILTER_TILE_INFO \
45  ccl_global TileInfo *tile_info, ccl_global float *tile_buffer_1, \
46  ccl_global float *tile_buffer_2, ccl_global float *tile_buffer_3, \
47  ccl_global float *tile_buffer_4, ccl_global float *tile_buffer_5, \
48  ccl_global float *tile_buffer_6, ccl_global float *tile_buffer_7, \
49  ccl_global float *tile_buffer_8, ccl_global float *tile_buffer_9
50 # define CCL_FILTER_TILE_INFO_ARG \
51  tile_info, tile_buffer_1, tile_buffer_2, tile_buffer_3, tile_buffer_4, tile_buffer_5, \
52  tile_buffer_6, tile_buffer_7, tile_buffer_8, tile_buffer_9
53 # define ccl_get_tile_buffer(id) \
54  (id == 0 ? tile_buffer_1 : \
55  id == 1 ? \
56  tile_buffer_2 : \
57  id == 2 ? \
58  tile_buffer_3 : \
59  id == 3 ? tile_buffer_4 : \
60  id == 4 ? tile_buffer_5 : \
61  id == 5 ? tile_buffer_6 : \
62  id == 6 ? tile_buffer_7 : \
63  id == 7 ? tile_buffer_8 : tile_buffer_9)
64 #else
65 # ifdef __KERNEL_CUDA__
66 # define CCL_FILTER_TILE_INFO ccl_global TileInfo *tile_info
67 # else
68 # define CCL_FILTER_TILE_INFO TileInfo *tile_info
69 # endif
70 # define ccl_get_tile_buffer(id) (tile_info->buffers[id])
71 #endif
72 
73 #endif /* __FILTER_DEFINES_H__*/
#define DENOISE_MAX_FRAMES
struct TileInfo TileInfo
#define ccl_global
int offsets[9]
int from_render
int num_frames
int y[4]
int strides[9]
int x[4]
long long int buffers[9]
int frames[DENOISE_MAX_FRAMES]