f45da39bad5f692a59423a02cb33035a05528a34
[blender.git] / intern / cycles / kernel / kernel_textures.h
1 /*
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.
15  */
16
17 #ifndef KERNEL_TEX
18 #  define KERNEL_TEX(type, ttype, name)
19 #endif
20
21 #ifndef KERNEL_IMAGE_TEX
22 #  define KERNEL_IMAGE_TEX(type, ttype, name)
23 #endif
24
25 /* bvh */
26 KERNEL_TEX(float4, texture_float4, __bvh_nodes)
27 KERNEL_TEX(float4, texture_float4, __bvh_leaf_nodes)
28 KERNEL_TEX(float4, texture_float4, __prim_tri_verts)
29 KERNEL_TEX(uint, texture_uint, __prim_tri_index)
30 KERNEL_TEX(uint, texture_uint, __prim_type)
31 KERNEL_TEX(uint, texture_uint, __prim_visibility)
32 KERNEL_TEX(uint, texture_uint, __prim_index)
33 KERNEL_TEX(uint, texture_uint, __prim_object)
34 KERNEL_TEX(uint, texture_uint, __object_node)
35
36 /* objects */
37 KERNEL_TEX(float4, texture_float4, __objects)
38 KERNEL_TEX(float4, texture_float4, __objects_vector)
39
40 /* triangles */
41 KERNEL_TEX(uint, texture_uint, __tri_shader)
42 KERNEL_TEX(float4, texture_float4, __tri_vnormal)
43 KERNEL_TEX(uint4, texture_uint4, __tri_vindex)
44 KERNEL_TEX(uint, texture_uint, __tri_patch)
45 KERNEL_TEX(float2, texture_float2, __tri_patch_uv)
46
47 /* curves */
48 KERNEL_TEX(float4, texture_float4, __curves)
49 KERNEL_TEX(float4, texture_float4, __curve_keys)
50
51 /* patches */
52 KERNEL_TEX(uint, texture_uint, __patches)
53
54 /* attributes */
55 KERNEL_TEX(uint4, texture_uint4, __attributes_map)
56 KERNEL_TEX(float, texture_float, __attributes_float)
57 KERNEL_TEX(float4, texture_float4, __attributes_float3)
58 KERNEL_TEX(uchar4, texture_uchar4, __attributes_uchar4)
59
60 /* lights */
61 KERNEL_TEX(float4, texture_float4, __light_distribution)
62 KERNEL_TEX(float4, texture_float4, __light_data)
63 KERNEL_TEX(float2, texture_float2, __light_background_marginal_cdf)
64 KERNEL_TEX(float2, texture_float2, __light_background_conditional_cdf)
65
66 /* particles */
67 KERNEL_TEX(float4, texture_float4, __particles)
68
69 /* shaders */
70 KERNEL_TEX(uint4, texture_uint4, __svm_nodes)
71 KERNEL_TEX(uint, texture_uint, __shader_flag)
72 KERNEL_TEX(uint, texture_uint, __object_flag)
73
74 /* lookup tables */
75 KERNEL_TEX(float, texture_float, __lookup_table)
76
77 /* sobol */
78 KERNEL_TEX(uint, texture_uint, __sobol_directions)
79
80 #ifdef __KERNEL_CUDA__
81 #  if __CUDA_ARCH__ < 300
82 /* full-float image */
83 KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float4_000)
84 KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float4_001)
85 KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float4_002)
86 KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float4_003)
87 KERNEL_IMAGE_TEX(float4, texture_image_float4, __tex_image_float4_004)
88
89 KERNEL_IMAGE_TEX(float4, texture_image3d_float4, __tex_image_float4_3d_000)
90 KERNEL_IMAGE_TEX(float4, texture_image3d_float4, __tex_image_float4_3d_001)
91 KERNEL_IMAGE_TEX(float4, texture_image3d_float4, __tex_image_float4_3d_002)
92 KERNEL_IMAGE_TEX(float4, texture_image3d_float4, __tex_image_float4_3d_003)
93 KERNEL_IMAGE_TEX(float4, texture_image3d_float4, __tex_image_float4_3d_004)
94
95 /* image */
96 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_005)
97 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_006)
98 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_007)
99 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_008)
100 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_009)
101 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_010)
102 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_011)
103 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_012)
104 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_013)
105 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_014)
106 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_015)
107 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_016)
108 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_017)
109 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_018)
110 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_019)
111 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_020)
112 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_021)
113 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_022)
114 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_023)
115 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_024)
116 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_025)
117 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_026)
118 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_027)
119 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_028)
120 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_029)
121 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_030)
122 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_031)
123 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_032)
124 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_033)
125 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_034)
126 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_035)
127 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_036)
128 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_037)
129 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_038)
130 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_039)
131 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_040)
132 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_041)
133 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_042)
134 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_043)
135 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_044)
136 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_045)
137 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_046)
138 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_047)
139 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_048)
140 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_049)
141 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_050)
142 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_051)
143 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_052)
144 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_053)
145 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_054)
146 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_055)
147 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_056)
148 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_057)
149 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_058)
150 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_059)
151 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_060)
152 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_061)
153 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_062)
154 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_063)
155 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_064)
156 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_065)
157 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_066)
158 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_067)
159 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_068)
160 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_069)
161 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_070)
162 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_071)
163 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_072)
164 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_073)
165 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_074)
166 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_075)
167 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_076)
168 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_077)
169 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_078)
170 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_079)
171 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_080)
172 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_081)
173 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_082)
174 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_083)
175 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_084)
176 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_085)
177 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_086)
178 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_087)
179 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_088)
180 KERNEL_IMAGE_TEX(uchar4, texture_image_uchar4, __tex_image_byte4_089)
181
182 #  else
183 /* bindless textures */
184 KERNEL_TEX(uint, texture_uint, __bindless_mapping)
185 #  endif
186 #endif
187
188 /* packed image (opencl) */
189 #ifdef __KERNEL_OPENCL__
190 KERNEL_TEX(uchar4, texture_uchar4, __tex_image_byte4_packed)
191 KERNEL_TEX(float4, texture_float4, __tex_image_float4_packed)
192 KERNEL_TEX(uchar, texture_uchar, __tex_image_byte_packed)
193 KERNEL_TEX(float, texture_float, __tex_image_float_packed)
194 KERNEL_TEX(uint4, texture_uint4, __tex_image_packed_info)
195 #endif
196
197 #undef KERNEL_TEX
198 #undef KERNEL_IMAGE_TEX
199
200