Merge branch 'blender-v2.90-release'
[blender.git] / source / blender / gpu / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # The Original Code is Copyright (C) 2006, Blender Foundation
18 # All rights reserved.
19 # ***** END GPL LICENSE BLOCK *****
20
21 # WITH_OPENGL limits the visibility of the opengl headers to just GPU and bg_gpu,
22 # to more easily highlight codepadths in other libraries that need to be refactored,
23 # bf_gpu is allowed to have opengl regardless of this option.
24
25 if(NOT WITH_OPENGL)
26   add_definitions(-DWITH_OPENGL)
27 endif()
28
29 set(INC
30   .
31   intern
32   opengl
33   ../blenkernel
34   ../blenlib
35   ../bmesh
36   ../draw
37   ../imbuf
38   ../makesdna
39   ../makesrna
40
41   ../editors/include
42
43   # For node muting stuff...
44   ../nodes
45   ../nodes/intern
46
47   ../../../intern/ghost
48   ../../../intern/glew-mx
49   ../../../intern/guardedalloc
50   ../../../intern/mantaflow/extern
51 )
52
53 set(INC_SYS
54   ${GLEW_INCLUDE_PATH}
55 )
56
57 set(SRC
58   intern/gpu_attr_binding.cc
59   intern/gpu_batch.cc
60   intern/gpu_batch_presets.c
61   intern/gpu_batch_utils.c
62   intern/gpu_buffers.c
63   intern/gpu_codegen.c
64   intern/gpu_context.cc
65   intern/gpu_debug.cc
66   intern/gpu_drawlist.cc
67   intern/gpu_element.cc
68   intern/gpu_extensions.cc
69   intern/gpu_framebuffer.cc
70   intern/gpu_immediate.cc
71   intern/gpu_immediate_util.c
72   intern/gpu_init_exit.c
73   intern/gpu_material.c
74   intern/gpu_material_library.c
75   intern/gpu_matrix.cc
76   intern/gpu_node_graph.c
77   intern/gpu_platform.cc
78   intern/gpu_primitive.c
79   intern/gpu_select.c
80   intern/gpu_select_pick.c
81   intern/gpu_select_sample_query.c
82   intern/gpu_shader.cc
83   intern/gpu_shader_builtin.c
84   intern/gpu_shader_interface.cc
85   intern/gpu_state.cc
86   intern/gpu_texture.cc
87   intern/gpu_uniformbuffer.cc
88   intern/gpu_vertex_buffer.cc
89   intern/gpu_vertex_format.cc
90   intern/gpu_viewport.c
91
92   opengl/gl_batch.cc
93   opengl/gl_context.cc
94   opengl/gl_drawlist.cc
95   opengl/gl_vertex_array.cc
96
97   GPU_attr_binding.h
98   GPU_batch.h
99   GPU_batch_presets.h
100   GPU_batch_utils.h
101   GPU_buffers.h
102   GPU_common.h
103   GPU_context.h
104   GPU_debug.h
105   GPU_drawlist.h
106   GPU_element.h
107   GPU_extensions.h
108   GPU_framebuffer.h
109   GPU_glew.h
110   GPU_immediate.h
111   GPU_immediate_util.h
112   GPU_init_exit.h
113   GPU_legacy_stubs.h
114   GPU_material.h
115   GPU_matrix.h
116   GPU_platform.h
117   GPU_primitive.h
118   GPU_select.h
119   GPU_shader.h
120   GPU_shader_interface.h
121   GPU_state.h
122   GPU_texture.h
123   GPU_uniformbuffer.h
124   GPU_vertex_buffer.h
125   GPU_vertex_format.h
126   GPU_viewport.h
127
128   intern/gpu_attr_binding_private.h
129   intern/gpu_backend.hh
130   intern/gpu_batch_private.hh
131   intern/gpu_codegen.h
132   intern/gpu_context_private.hh
133   intern/gpu_drawlist_private.hh
134   intern/gpu_material_library.h
135   intern/gpu_matrix_private.h
136   intern/gpu_node_graph.h
137   intern/gpu_primitive_private.h
138   intern/gpu_private.h
139   intern/gpu_select_private.h
140   intern/gpu_shader_private.h
141   intern/gpu_vertex_format_private.h
142
143   opengl/gl_backend.hh
144   opengl/gl_batch.hh
145   opengl/gl_context.hh
146   opengl/gl_drawlist.hh
147   opengl/gl_vertex_array.hh
148 )
149
150 set(LIB
151   ${BLENDER_GL_LIBRARIES}
152 )
153
154 if(NOT WITH_SYSTEM_GLEW)
155   list(APPEND LIB
156     ${BLENDER_GLEW_LIBRARIES}
157   )
158 endif()
159
160 data_to_c_simple(shaders/gpu_shader_depth_only_frag.glsl SRC)
161 data_to_c_simple(shaders/gpu_shader_uniform_color_frag.glsl SRC)
162 data_to_c_simple(shaders/gpu_shader_checker_frag.glsl SRC)
163 data_to_c_simple(shaders/gpu_shader_diag_stripes_frag.glsl SRC)
164 data_to_c_simple(shaders/gpu_shader_simple_lighting_frag.glsl SRC)
165 data_to_c_simple(shaders/gpu_shader_flat_color_frag.glsl SRC)
166 data_to_c_simple(shaders/gpu_shader_flat_color_alpha_test_0_frag.glsl SRC)
167 data_to_c_simple(shaders/gpu_shader_flat_id_frag.glsl SRC)
168 data_to_c_simple(shaders/gpu_shader_2D_vert.glsl SRC)
169 data_to_c_simple(shaders/gpu_shader_2D_area_borders_vert.glsl SRC)
170 data_to_c_simple(shaders/gpu_shader_2D_area_borders_frag.glsl SRC)
171 data_to_c_simple(shaders/gpu_shader_2D_widget_base_vert.glsl SRC)
172 data_to_c_simple(shaders/gpu_shader_2D_widget_base_frag.glsl SRC)
173 data_to_c_simple(shaders/gpu_shader_2D_widget_shadow_vert.glsl SRC)
174 data_to_c_simple(shaders/gpu_shader_2D_widget_shadow_frag.glsl SRC)
175 data_to_c_simple(shaders/gpu_shader_2D_nodelink_frag.glsl SRC)
176 data_to_c_simple(shaders/gpu_shader_2D_nodelink_vert.glsl SRC)
177 data_to_c_simple(shaders/gpu_shader_2D_flat_color_vert.glsl SRC)
178 data_to_c_simple(shaders/gpu_shader_2D_line_dashed_uniform_color_vert.glsl SRC)
179 data_to_c_simple(shaders/gpu_shader_2D_line_dashed_frag.glsl SRC)
180 data_to_c_simple(shaders/gpu_shader_2D_smooth_color_vert.glsl SRC)
181 data_to_c_simple(shaders/gpu_shader_2D_smooth_color_frag.glsl SRC)
182 data_to_c_simple(shaders/gpu_shader_2D_image_vert.glsl SRC)
183 data_to_c_simple(shaders/gpu_shader_2D_image_rect_vert.glsl SRC)
184 data_to_c_simple(shaders/gpu_shader_2D_image_multi_rect_vert.glsl SRC)
185 data_to_c_simple(shaders/gpu_shader_image_frag.glsl SRC)
186 data_to_c_simple(shaders/gpu_shader_image_desaturate_frag.glsl SRC)
187 data_to_c_simple(shaders/gpu_shader_image_overlays_merge_frag.glsl SRC)
188 data_to_c_simple(shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl SRC)
189 data_to_c_simple(shaders/gpu_shader_image_shuffle_color_frag.glsl SRC)
190 data_to_c_simple(shaders/gpu_shader_image_color_frag.glsl SRC)
191 data_to_c_simple(shaders/gpu_shader_image_varying_color_frag.glsl SRC)
192 data_to_c_simple(shaders/gpu_shader_3D_image_vert.glsl SRC)
193 data_to_c_simple(shaders/gpu_shader_3D_vert.glsl SRC)
194 data_to_c_simple(shaders/gpu_shader_3D_normal_vert.glsl SRC)
195 data_to_c_simple(shaders/gpu_shader_3D_flat_color_vert.glsl SRC)
196 data_to_c_simple(shaders/gpu_shader_3D_line_dashed_uniform_color_vert.glsl SRC)
197 data_to_c_simple(shaders/gpu_shader_3D_polyline_frag.glsl SRC)
198 data_to_c_simple(shaders/gpu_shader_3D_polyline_geom.glsl SRC)
199 data_to_c_simple(shaders/gpu_shader_3D_polyline_vert.glsl SRC)
200 data_to_c_simple(shaders/gpu_shader_3D_smooth_color_vert.glsl SRC)
201 data_to_c_simple(shaders/gpu_shader_3D_smooth_color_frag.glsl SRC)
202 data_to_c_simple(shaders/gpu_shader_3D_passthrough_vert.glsl SRC)
203 data_to_c_simple(shaders/gpu_shader_3D_clipped_uniform_color_vert.glsl SRC)
204
205 data_to_c_simple(shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl SRC)
206
207 data_to_c_simple(shaders/gpu_shader_point_uniform_color_frag.glsl SRC)
208 data_to_c_simple(shaders/gpu_shader_point_uniform_color_aa_frag.glsl SRC)
209 data_to_c_simple(shaders/gpu_shader_point_uniform_color_outline_aa_frag.glsl SRC)
210 data_to_c_simple(shaders/gpu_shader_point_varying_color_outline_aa_frag.glsl SRC)
211 data_to_c_simple(shaders/gpu_shader_point_varying_color_varying_outline_aa_frag.glsl SRC)
212 data_to_c_simple(shaders/gpu_shader_point_varying_color_frag.glsl SRC)
213 data_to_c_simple(shaders/gpu_shader_3D_point_fixed_size_varying_color_vert.glsl SRC)
214 data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_vert.glsl SRC)
215 data_to_c_simple(shaders/gpu_shader_3D_point_varying_size_varying_color_vert.glsl SRC)
216 data_to_c_simple(shaders/gpu_shader_3D_point_uniform_size_aa_vert.glsl SRC)
217 data_to_c_simple(shaders/gpu_shader_3D_point_uniform_size_outline_aa_vert.glsl SRC)
218 data_to_c_simple(shaders/gpu_shader_2D_point_varying_size_varying_color_vert.glsl SRC)
219 data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_aa_vert.glsl SRC)
220 data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_outline_aa_vert.glsl SRC)
221 data_to_c_simple(shaders/gpu_shader_2D_point_uniform_size_varying_color_outline_aa_vert.glsl SRC)
222
223 data_to_c_simple(shaders/gpu_shader_2D_edituvs_points_vert.glsl SRC)
224 data_to_c_simple(shaders/gpu_shader_2D_edituvs_facedots_vert.glsl SRC)
225 data_to_c_simple(shaders/gpu_shader_2D_edituvs_edges_vert.glsl SRC)
226 data_to_c_simple(shaders/gpu_shader_2D_edituvs_edges_frag.glsl SRC)
227 data_to_c_simple(shaders/gpu_shader_2D_edituvs_faces_vert.glsl SRC)
228 data_to_c_simple(shaders/gpu_shader_2D_edituvs_stretch_vert.glsl SRC)
229
230 data_to_c_simple(shaders/gpu_shader_text_vert.glsl SRC)
231 data_to_c_simple(shaders/gpu_shader_text_frag.glsl SRC)
232 data_to_c_simple(shaders/gpu_shader_keyframe_diamond_vert.glsl SRC)
233 data_to_c_simple(shaders/gpu_shader_keyframe_diamond_frag.glsl SRC)
234
235 data_to_c_simple(shaders/gpu_shader_codegen_lib.glsl SRC)
236
237 data_to_c_simple(shaders/gpu_shader_geometry.glsl SRC)
238
239 data_to_c_simple(shaders/material/gpu_shader_material_add_shader.glsl SRC)
240 data_to_c_simple(shaders/material/gpu_shader_material_ambient_occlusion.glsl SRC)
241 data_to_c_simple(shaders/material/gpu_shader_material_anisotropic.glsl SRC)
242 data_to_c_simple(shaders/material/gpu_shader_material_attribute.glsl SRC)
243 data_to_c_simple(shaders/material/gpu_shader_material_background.glsl SRC)
244 data_to_c_simple(shaders/material/gpu_shader_material_bevel.glsl SRC)
245 data_to_c_simple(shaders/material/gpu_shader_material_blackbody.glsl SRC)
246 data_to_c_simple(shaders/material/gpu_shader_material_bright_contrast.glsl SRC)
247 data_to_c_simple(shaders/material/gpu_shader_material_bump.glsl SRC)
248 data_to_c_simple(shaders/material/gpu_shader_material_camera.glsl SRC)
249 data_to_c_simple(shaders/material/gpu_shader_material_clamp.glsl SRC)
250 data_to_c_simple(shaders/material/gpu_shader_material_color_ramp.glsl SRC)
251 data_to_c_simple(shaders/material/gpu_shader_material_color_util.glsl SRC)
252 data_to_c_simple(shaders/material/gpu_shader_material_combine_hsv.glsl SRC)
253 data_to_c_simple(shaders/material/gpu_shader_material_combine_rgb.glsl SRC)
254 data_to_c_simple(shaders/material/gpu_shader_material_combine_xyz.glsl SRC)
255 data_to_c_simple(shaders/material/gpu_shader_material_diffuse.glsl SRC)
256 data_to_c_simple(shaders/material/gpu_shader_material_displacement.glsl SRC)
257 data_to_c_simple(shaders/material/gpu_shader_material_eevee_specular.glsl SRC)
258 data_to_c_simple(shaders/material/gpu_shader_material_emission.glsl SRC)
259 data_to_c_simple(shaders/material/gpu_shader_material_fractal_noise.glsl SRC)
260 data_to_c_simple(shaders/material/gpu_shader_material_fresnel.glsl SRC)
261 data_to_c_simple(shaders/material/gpu_shader_material_gamma.glsl SRC)
262 data_to_c_simple(shaders/material/gpu_shader_material_geometry.glsl SRC)
263 data_to_c_simple(shaders/material/gpu_shader_material_glass.glsl SRC)
264 data_to_c_simple(shaders/material/gpu_shader_material_glossy.glsl SRC)
265 data_to_c_simple(shaders/material/gpu_shader_material_hair_info.glsl SRC)
266 data_to_c_simple(shaders/material/gpu_shader_material_hash.glsl SRC)
267 data_to_c_simple(shaders/material/gpu_shader_material_holdout.glsl SRC)
268 data_to_c_simple(shaders/material/gpu_shader_material_hue_sat_val.glsl SRC)
269 data_to_c_simple(shaders/material/gpu_shader_material_invert.glsl SRC)
270 data_to_c_simple(shaders/material/gpu_shader_material_layer_weight.glsl SRC)
271 data_to_c_simple(shaders/material/gpu_shader_material_light_falloff.glsl SRC)
272 data_to_c_simple(shaders/material/gpu_shader_material_light_path.glsl SRC)
273 data_to_c_simple(shaders/material/gpu_shader_material_mapping.glsl SRC)
274 data_to_c_simple(shaders/material/gpu_shader_material_map_range.glsl SRC)
275 data_to_c_simple(shaders/material/gpu_shader_material_math.glsl SRC)
276 data_to_c_simple(shaders/material/gpu_shader_material_math_util.glsl SRC)
277 data_to_c_simple(shaders/material/gpu_shader_material_mix_rgb.glsl SRC)
278 data_to_c_simple(shaders/material/gpu_shader_material_mix_shader.glsl SRC)
279 data_to_c_simple(shaders/material/gpu_shader_material_noise.glsl SRC)
280 data_to_c_simple(shaders/material/gpu_shader_material_normal.glsl SRC)
281 data_to_c_simple(shaders/material/gpu_shader_material_normal_map.glsl SRC)
282 data_to_c_simple(shaders/material/gpu_shader_material_object_info.glsl SRC)
283 data_to_c_simple(shaders/material/gpu_shader_material_output_material.glsl SRC)
284 data_to_c_simple(shaders/material/gpu_shader_material_output_world.glsl SRC)
285 data_to_c_simple(shaders/material/gpu_shader_material_particle_info.glsl SRC)
286 data_to_c_simple(shaders/material/gpu_shader_material_principled.glsl SRC)
287 data_to_c_simple(shaders/material/gpu_shader_material_refraction.glsl SRC)
288 data_to_c_simple(shaders/material/gpu_shader_material_rgb_curves.glsl SRC)
289 data_to_c_simple(shaders/material/gpu_shader_material_rgb_to_bw.glsl SRC)
290 data_to_c_simple(shaders/material/gpu_shader_material_separate_hsv.glsl SRC)
291 data_to_c_simple(shaders/material/gpu_shader_material_separate_rgb.glsl SRC)
292 data_to_c_simple(shaders/material/gpu_shader_material_separate_xyz.glsl SRC)
293 data_to_c_simple(shaders/material/gpu_shader_material_set.glsl SRC)
294 data_to_c_simple(shaders/material/gpu_shader_material_shader_to_rgba.glsl SRC)
295 data_to_c_simple(shaders/material/gpu_shader_material_squeeze.glsl SRC)
296 data_to_c_simple(shaders/material/gpu_shader_material_subsurface_scattering.glsl SRC)
297 data_to_c_simple(shaders/material/gpu_shader_material_tangent.glsl SRC)
298 data_to_c_simple(shaders/material/gpu_shader_material_tex_brick.glsl SRC)
299 data_to_c_simple(shaders/material/gpu_shader_material_tex_checker.glsl SRC)
300 data_to_c_simple(shaders/material/gpu_shader_material_tex_environment.glsl SRC)
301 data_to_c_simple(shaders/material/gpu_shader_material_tex_gradient.glsl SRC)
302 data_to_c_simple(shaders/material/gpu_shader_material_tex_image.glsl SRC)
303 data_to_c_simple(shaders/material/gpu_shader_material_tex_magic.glsl SRC)
304 data_to_c_simple(shaders/material/gpu_shader_material_tex_musgrave.glsl SRC)
305 data_to_c_simple(shaders/material/gpu_shader_material_tex_noise.glsl SRC)
306 data_to_c_simple(shaders/material/gpu_shader_material_tex_sky.glsl SRC)
307 data_to_c_simple(shaders/material/gpu_shader_material_texture_coordinates.glsl SRC)
308 data_to_c_simple(shaders/material/gpu_shader_material_tex_voronoi.glsl SRC)
309 data_to_c_simple(shaders/material/gpu_shader_material_tex_wave.glsl SRC)
310 data_to_c_simple(shaders/material/gpu_shader_material_tex_white_noise.glsl SRC)
311 data_to_c_simple(shaders/material/gpu_shader_material_toon.glsl SRC)
312 data_to_c_simple(shaders/material/gpu_shader_material_translucent.glsl SRC)
313 data_to_c_simple(shaders/material/gpu_shader_material_transparent.glsl SRC)
314 data_to_c_simple(shaders/material/gpu_shader_material_uv_map.glsl SRC)
315 data_to_c_simple(shaders/material/gpu_shader_material_vector_curves.glsl SRC)
316 data_to_c_simple(shaders/material/gpu_shader_material_vector_displacement.glsl SRC)
317 data_to_c_simple(shaders/material/gpu_shader_material_vector_math.glsl SRC)
318 data_to_c_simple(shaders/material/gpu_shader_material_vector_rotate.glsl SRC)
319 data_to_c_simple(shaders/material/gpu_shader_material_velvet.glsl SRC)
320 data_to_c_simple(shaders/material/gpu_shader_material_vertex_color.glsl SRC)
321 data_to_c_simple(shaders/material/gpu_shader_material_volume_absorption.glsl SRC)
322 data_to_c_simple(shaders/material/gpu_shader_material_volume_info.glsl SRC)
323 data_to_c_simple(shaders/material/gpu_shader_material_volume_principled.glsl SRC)
324 data_to_c_simple(shaders/material/gpu_shader_material_volume_scatter.glsl SRC)
325 data_to_c_simple(shaders/material/gpu_shader_material_wireframe.glsl SRC)
326 data_to_c_simple(shaders/material/gpu_shader_material_world_normals.glsl SRC)
327
328 data_to_c_simple(shaders/gpu_shader_gpencil_stroke_vert.glsl SRC)
329 data_to_c_simple(shaders/gpu_shader_gpencil_stroke_frag.glsl SRC)
330 data_to_c_simple(shaders/gpu_shader_gpencil_stroke_geom.glsl SRC)
331
332 data_to_c_simple(shaders/gpu_shader_gpencil_fill_vert.glsl SRC)
333 data_to_c_simple(shaders/gpu_shader_gpencil_fill_frag.glsl SRC)
334
335 data_to_c_simple(shaders/gpu_shader_cfg_world_clip_lib.glsl SRC)
336 data_to_c_simple(shaders/gpu_shader_colorspace_lib.glsl SRC)
337
338 data_to_c_simple(shaders/gpu_shader_common_obinfos_lib.glsl SRC)
339
340
341 if(WITH_MOD_FLUID)
342   add_definitions(-DWITH_FLUID)
343 endif()
344
345 add_definitions(${GL_DEFINITIONS})
346
347 if(WITH_IMAGE_DDS)
348   add_definitions(-DWITH_DDS)
349 endif()
350
351 blender_add_lib(bf_gpu "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")