Files
test2/source/blender/compositor/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

448 lines
17 KiB
CMake
Raw Normal View History

# SPDX-FileCopyrightText: 2011-2024 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
____ `````|````` | | | ..'''' | | | |______ .'' | | | | ..' | | |_______ |___________ ....'' merge to TRUNK! * The old compositor is still available (Debug Menu: 200) This commit was brought to you by: Developers: * Monique Dewanchand * Jeroen Bakker * Dalai Felinto * Lukas Tönne Review: * Brecht van Lommel Testers: * Nate Wiebe * Wolfgang Faehnle * Carlo Andreacchio * Daniel Salazar * Artur Mag * Christian Krupa * Francesco Siddi * Dan McGrath * Bassam Kurdali But mostly by the community: Gold: Joshua Faulkner Michael Tiemann Francesco Paglia Blender Guru Blender Developers Fund Silver: Pablo Vazquez Joel Heethaar Amrein Olivier Ilias Karasavvidis Thomas Kumlehn Sebastian Koenig Hannu Hoffrén Benjamin Dansie Fred M'ule Michel Vilain Bradley Cathey Gianmichele Mariani Gottfried Hofmann Bjørnar Frøyse Valentijn Bruning Paul Holmes Clemens Rudolph Juris Graphix David Strebel Ronan Zeegers François Tarlier Felipe Andres Esquivel Reed Olaf Beckman Jesus Alberto Olmos Linares Kajimba Maria Figueiredo Alexandr Galperin Francesco Siddi Julio Iglesias Lopez Kjartan Tysdal Thomas Torfs Film Works Teruyuki Nakamura Roger Luethi Benoit Bolsee Stefan Abrahamsen Andreas Mattijat Xavier Bouchoux Blender 3D Graphics and Animation Henk Vostermans Daniel Blanco Delgado BlenderDay/2011 Bradley Cathey Matthieu Dupont de Dinechin Gianmichele Mariani Jérôme Scaillet Bronze (Ivo Grigull, Dylan Urquidi, Philippe Derungs, Phil Beauchamp, Bruce Parrott, Mathieu Quiblier, Daniel Martinez, Leandro Inocencio, Lluc Romaní Brasó, Jonathan Williamson, Michael Ehlen, Karlis Stigis, Dreamsteep, Martin Lindelöf, Filippo Saracino, Douwe van der Veen, Olli Äkräs, Bruno D'Arcangeli, Francisco Sedrez Warmling, Watchmike.ca, peter lener, Matteo Novellino, Martin Kirsch, Austars Schnore, KC Elliott, Massimiliano Puliero, Karl Stein, Wood Design Studios, Omer Khan, Jyrki Kanto, Michał Krupa, Lars Brubaker, Neil Richmond, Adam Kalisz, Robert Garlington, Ian Wilson, Carlo Andreacchio, Jeremias Boos, Robert Holcomb, Gabriel Zöller, Robert Cude, Natibel de Leon, Nathan Turnage, Nicolas Vergnes, Philipp Kleinhenz, Norman Hartig, Louis Kreusel, Christopher Taylor, Giovanni Remondini, Daniel Rentzsch, Nico Partipilo, Thomas Ventresco, Johannes Schwarz, Александр Коротеев, Brendon Harvey, Marcelo G. Malheiros, Marius Giurgi, Richard Burns, Perttu Iso-Metsälä, Steve Bazin, Radoslav Borisov, Yoshiyuki Shida, Julien Guigner, Andrew Hunter, Philipp Oeser, Daniel Thul, Thobias Johansson, Mauro Bonecchi, Georg Piorczynski, Sebastian Michailidis, L M Weedy, Gen X, Stefan Hinze, Nicolò Zubbini, Erik Pusch, Rob Scott, Florian Koch, Charles Razack, Adrian Baker, Oliver Villar Diz, David Revoy, Julio Iglesias Lopez, Coen Spoor, Carlos Folch, Joseph Christie, Victor Hernández García, David Mcsween, James Finnerty, Cory Kruckenberg, Giacomo Graziosi, Olivier Saraja, Lars Brubaker, Eric Hudson, Johannes Schwarz, David Elguea, Marcus Schulderinsky, Karel De Bruijn, Lucas van Wijngaarden, Stefano Ciarrocchi, Mehmet Eribol, Thomas Berglund, Zuofei Song, Dylan Urquidi )
2012-05-17 12:49:33 +00:00
set(INC
.
algorithms
cached_resources
derived_resources
utilities
../gpu/intern
../makesrna
../render/intern
../imbuf/opencolorio/intern/libocio
)
set(INC_SYS
)
set(SRC
COM_compile_state.hh
COM_compositor.hh
COM_context.hh
COM_conversion_operation.hh
COM_derived_resources.hh
COM_domain.hh
COM_evaluator.hh
COM_implicit_input_operation.hh
COM_input_descriptor.hh
COM_input_single_value_operation.hh
COM_meta_data.hh
COM_multi_function_procedure_operation.hh
COM_node_operation.hh
COM_operation.hh
COM_pixel_operation.hh
COM_profiler.hh
COM_realize_on_domain_operation.hh
COM_render_context.hh
COM_result.hh
COM_scheduler.hh
COM_shader_node.hh
COM_shader_operation.hh
COM_simple_operation.hh
COM_static_cache_manager.hh
COM_utilities.hh
intern/COM_compositor.cc
intern/compile_state.cc
intern/context.cc
intern/conversion_operation.cc
intern/domain.cc
intern/evaluator.cc
intern/implicit_input_operation.cc
intern/input_single_value_operation.cc
intern/meta_data.cc
intern/multi_function_procedure_operation.cc
intern/node_operation.cc
intern/operation.cc
intern/pixel_operation.cc
intern/profiler.cc
intern/realize_on_domain_operation.cc
intern/render_context.cc
intern/result.cc
intern/scheduler.cc
intern/shader_node.cc
intern/shader_operation.cc
intern/simple_operation.cc
intern/static_cache_manager.cc
intern/utilities.cc
algorithms/intern/compute_preview.cc
algorithms/intern/convolve.cc
algorithms/intern/deriche_gaussian_blur.cc
algorithms/intern/extract_alpha.cc
algorithms/intern/jump_flooding.cc
algorithms/intern/morphological_blur.cc
algorithms/intern/morphological_distance.cc
algorithms/intern/morphological_distance_feather.cc
algorithms/intern/pad.cc
algorithms/intern/parallel_reduction.cc
algorithms/intern/recursive_gaussian_blur.cc
algorithms/intern/sample_pixel.cc
algorithms/intern/smaa.cc
algorithms/intern/summed_area_table.cc
algorithms/intern/symmetric_separable_blur.cc
algorithms/intern/symmetric_separable_blur_variable_size.cc
algorithms/intern/van_vliet_gaussian_blur.cc
algorithms/COM_algorithm_compute_preview.hh
algorithms/COM_algorithm_convolve.hh
algorithms/COM_algorithm_deriche_gaussian_blur.hh
algorithms/COM_algorithm_extract_alpha.hh
algorithms/COM_algorithm_jump_flooding.hh
algorithms/COM_algorithm_morphological_blur.hh
algorithms/COM_algorithm_morphological_distance.hh
algorithms/COM_algorithm_morphological_distance_feather.hh
algorithms/COM_algorithm_pad.hh
algorithms/COM_algorithm_parallel_reduction.hh
algorithms/COM_algorithm_recursive_gaussian_blur.hh
algorithms/COM_algorithm_sample_pixel.hh
algorithms/COM_algorithm_smaa.hh
algorithms/COM_algorithm_summed_area_table.hh
algorithms/COM_algorithm_symmetric_separable_blur.hh
algorithms/COM_algorithm_symmetric_separable_blur_variable_size.hh
algorithms/COM_algorithm_van_vliet_gaussian_blur.hh
cached_resources/intern/bokeh_kernel.cc
cached_resources/intern/cached_image.cc
cached_resources/intern/cached_mask.cc
cached_resources/intern/cached_shader.cc
cached_resources/intern/deriche_gaussian_coefficients.cc
cached_resources/intern/distortion_grid.cc
cached_resources/intern/fog_glow_kernel.cc
cached_resources/intern/image_coordinates.cc
cached_resources/intern/keying_screen.cc
cached_resources/intern/morphological_distance_feather_weights.cc
cached_resources/intern/ocio_color_space_conversion_shader.cc
cached_resources/intern/smaa_precomputed_textures.cc
cached_resources/intern/symmetric_blur_weights.cc
cached_resources/intern/symmetric_separable_blur_weights.cc
cached_resources/intern/van_vliet_gaussian_coefficients.cc
cached_resources/COM_bokeh_kernel.hh
cached_resources/COM_cached_image.hh
cached_resources/COM_cached_mask.hh
cached_resources/COM_cached_resource.hh
cached_resources/COM_cached_shader.hh
cached_resources/COM_deriche_gaussian_coefficients.hh
cached_resources/COM_distortion_grid.hh
cached_resources/COM_fog_glow_kernel.hh
cached_resources/COM_image_coordinates.hh
cached_resources/COM_keying_screen.hh
cached_resources/COM_morphological_distance_feather_weights.hh
cached_resources/COM_ocio_color_space_conversion_shader.hh
cached_resources/COM_smaa_precomputed_textures.hh
cached_resources/COM_symmetric_blur_weights.hh
cached_resources/COM_symmetric_separable_blur_weights.hh
cached_resources/COM_van_vliet_gaussian_coefficients.hh
derived_resources/intern/denoised_auxiliary_pass.cc
derived_resources/COM_denoised_auxiliary_pass.hh
utilities/intern/gpu_material.cc
utilities/intern/oidn.cc
utilities/COM_utilities_diagonals.hh
utilities/COM_utilities_gpu_material.hh
utilities/COM_utilities_oidn.hh
)
set(LIB
PRIVATE bf::blenkernel
PRIVATE bf::blentranslation
PRIVATE bf::extern::fmtlib
PRIVATE bf::functions
PRIVATE bf::gpu
PRIVATE bf::imbuf
PRIVATE bf::nodes
PRIVATE bf::render
PRIVATE bf::blenlib
PRIVATE bf::dna
PRIVATE bf::intern::guardedalloc
PRIVATE bf::intern::clog
Refactor: OpenColorIO integration Briefly about this change: - OpenColorIO C-API is removed. - The information about color spaces in ImBuf module is removed. It was stored in global ListBase in colormanagement.cc. - Both OpenColorIO and fallback implementation supports GPU drawing. - Fallback implementation supports white point, RGB curves, etc. - Removed check for support of GPU drawing in IMB. Historically it was implemented in a separate library with C-API, this is because way back C++ code needed to stay in intern. This causes all sort of overheads, and even calls that are strictly considered bad level. This change moves OpenColorIO integration into a module within imbuf, next to movie, and next to IMB_colormanagement which is the main user of it. This allows to avoid copy of color spaces, displays, views etc in the ImBuf: they were used to help quickly querying information to be shown on the interface. With this change it can be stored in the same data structures as what is used by the OpenColorIO integration. While it might not be fully avoiding duplication it is now less, and there is no need in the user code to maintain the copies. In a lot of cases this change also avoids allocations done per access to the OpenColorIO. For example, it is not needed anymore to allocate image descriptor in a heap. The bigger user-visible change is that the fallback implementation now supports GLSL drawing, with the whole list of supported features, such as curve mapping and white point. This should help simplifying code which relies on color space conversion on GPU: there is no need to figure out fallback solution in such cases. The only case when drawing will not work is when there is some actual bug, or driver issue, and shader has failed to compile. The change avoids having an opaque type for color space, and instead uses forward declaration. It is a bit verbose on declaration, but helps avoiding unsafe type-casts. There are ways to solve this in the future, like having a header for forward declaration, or to flatten the name space a bit. There should be no user-level changes under normal operation. When building without OpenColorIO or the configuration has a typo or is missing a fuller set of color management tools is applies (such as the white point correction). Pull Request: https://projects.blender.org/blender/blender/pulls/138433
2025-05-09 14:01:43 +02:00
PRIVATE bf::dependencies::optional::opencolorio
)
set(GLSL_SRC
shaders/infos/compositor_alpha_crop_infos.hh
shaders/infos/compositor_bilateral_blur_infos.hh
shaders/infos/compositor_bokeh_blur_infos.hh
shaders/infos/compositor_bokeh_blur_variable_size_infos.hh
shaders/infos/compositor_bokeh_image_infos.hh
shaders/infos/compositor_box_mask_infos.hh
shaders/infos/compositor_compute_preview_infos.hh
shaders/infos/compositor_convert_infos.hh
shaders/infos/compositor_cryptomatte_infos.hh
shaders/infos/compositor_defocus_infos.hh
shaders/infos/compositor_deriche_gaussian_blur_infos.hh
shaders/infos/compositor_despeckle_infos.hh
shaders/infos/compositor_directional_blur_infos.hh
shaders/infos/compositor_displace_infos.hh
shaders/infos/compositor_double_edge_mask_infos.hh
shaders/infos/compositor_edge_filter_infos.hh
shaders/infos/compositor_ellipse_mask_infos.hh
shaders/infos/compositor_filter_infos.hh
shaders/infos/compositor_flip_infos.hh
shaders/infos/compositor_gamma_correct_infos.hh
shaders/infos/compositor_glare_infos.hh
shaders/infos/compositor_id_mask_infos.hh
shaders/infos/compositor_image_coordinates_infos.hh
shaders/infos/compositor_image_crop_infos.hh
shaders/infos/compositor_inpaint_infos.hh
shaders/infos/compositor_jump_flooding_infos.hh
shaders/infos/compositor_keying_infos.hh
shaders/infos/compositor_keying_screen_infos.hh
shaders/infos/compositor_kuwahara_infos.hh
shaders/infos/compositor_lens_distortion_infos.hh
shaders/infos/compositor_map_uv_infos.hh
shaders/infos/compositor_morphological_blur_infos.hh
shaders/infos/compositor_morphological_distance_feather_infos.hh
shaders/infos/compositor_morphological_distance_infos.hh
shaders/infos/compositor_morphological_distance_threshold_infos.hh
shaders/infos/compositor_morphological_step_infos.hh
shaders/infos/compositor_motion_blur_infos.hh
shaders/infos/compositor_movie_distortion_infos.hh
shaders/infos/compositor_normalize_infos.hh
shaders/infos/compositor_pad_infos.hh
shaders/infos/compositor_parallel_reduction_infos.hh
shaders/infos/compositor_pixelate_infos.hh
shaders/infos/compositor_plane_deform_infos.hh
shaders/infos/compositor_premultiply_alpha_infos.hh
shaders/infos/compositor_read_input_infos.hh
shaders/infos/compositor_realize_on_domain_infos.hh
shaders/infos/compositor_sample_pixel_infos.hh
shaders/infos/compositor_scale_variable_infos.hh
shaders/infos/compositor_smaa_infos.hh
shaders/infos/compositor_split_infos.hh
shaders/infos/compositor_summed_area_table_infos.hh
shaders/infos/compositor_symmetric_blur_infos.hh
shaders/infos/compositor_symmetric_blur_variable_size_infos.hh
shaders/infos/compositor_symmetric_separable_blur_infos.hh
shaders/infos/compositor_symmetric_separable_blur_variable_size_infos.hh
shaders/infos/compositor_tone_map_photoreceptor_infos.hh
shaders/infos/compositor_tone_map_simple_infos.hh
shaders/infos/compositor_translate_wrapped_infos.hh
shaders/infos/compositor_van_vliet_gaussian_blur_infos.hh
shaders/infos/compositor_write_output_infos.hh
shaders/infos/compositor_z_combine_infos.hh
shaders/compositor_alpha_crop.glsl
shaders/compositor_bilateral_blur.glsl
shaders/compositor_bokeh_blur.glsl
shaders/compositor_bokeh_blur_variable_size.glsl
shaders/compositor_bokeh_image.glsl
shaders/compositor_box_mask.glsl
shaders/compositor_compute_preview.glsl
shaders/compositor_convert.glsl
shaders/compositor_cryptomatte_image.glsl
shaders/compositor_cryptomatte_matte.glsl
shaders/compositor_cryptomatte_pick.glsl
shaders/compositor_defocus_blur.glsl
shaders/compositor_defocus_radius_from_depth.glsl
shaders/compositor_defocus_radius_from_scale.glsl
shaders/compositor_despeckle.glsl
shaders/compositor_deriche_gaussian_blur.glsl
shaders/compositor_deriche_gaussian_blur_sum.glsl
shaders/compositor_directional_blur.glsl
shaders/compositor_displace.glsl
shaders/compositor_displace_anisotropic.glsl
shaders/compositor_double_edge_mask_compute_boundary.glsl
shaders/compositor_double_edge_mask_compute_gradient.glsl
shaders/compositor_edge_filter.glsl
shaders/compositor_ellipse_mask.glsl
shaders/compositor_filter.glsl
shaders/compositor_flip.glsl
shaders/compositor_gamma_correct.glsl
shaders/compositor_glare_bloom_downsample.glsl
shaders/compositor_glare_bloom_upsample.glsl
shaders/compositor_glare_ghost_accumulate.glsl
shaders/compositor_glare_ghost_base.glsl
shaders/compositor_glare_highlights.glsl
shaders/compositor_glare_mix.glsl
shaders/compositor_glare_simple_star_anti_diagonal_pass.glsl
shaders/compositor_glare_simple_star_diagonal_pass.glsl
shaders/compositor_glare_simple_star_horizontal_pass.glsl
shaders/compositor_glare_simple_star_vertical_pass.glsl
shaders/compositor_glare_streaks_accumulate.glsl
shaders/compositor_glare_streaks_filter.glsl
shaders/compositor_glare_sun_beams.glsl
Compositor: Improve Glare node UX This patch redesigns the Glare node to improve the user experience. The improvements are as follows. Two new outputs were added, Glare and Highlights. The Glare output gives the generated glare without the input, and is useful when the user wants to adjust the glare before adding it to the image. The Highlights output gives the areas that are considered highlights when computing the glare, and is useful if the user wants to temporally check the highlights while doing adjustments or wants to use those as a base for creating a custom glare setup. The Mix node option was removed and a new Strength single value input was added to serve the same functionality. The Mix option had a range of [-1, 1], where the [-1, 0] sub-range essentially controlled the strength of the glare, 0 being full strength and -1 being zero strength. While the [0, 1] range returned the generated glare with an attenuated version of the image added, that is, it was useless except for the value of 1, which returned the generate glare only. Aside from being a very intuitive range, it also meant that the power of glare can't be boosted beyond the full strength of, you guessed it, 0. The newly added Strength input has a soft range of [0, 1] and can be boosted beyond 1. If the users want the glare only, they can use the newly provided Glare output. The Size node option used for Bloom and Fog Glow was removed and a new Size single value input was added. The Size node option had yet another very intuitive range of [1, 9], and it was related exponentially to the actual size of the Glare. For Bloom, the actual bloom size relative to the image was 2^(Size-9), so a Size of 8 means the bloom covers half of the image. For Fog Glow, the actual bloom size in pixels is 2^Size, so the glare size is not relative to the image size and would thus change as the image resolution change. Furthermore, the maximum possible glare size was 512 pixels, and the user couldn't make fine adjustments to the size. The newly added Size input has a range [0, 1], where 1 means the glare covers the entire image, 0.5 means it covers half the image, and so on. That means it is consistent between Bloom and Fog Glow, it is relative to the image size, it allows as large of a glare as possible, it is continuous for Fog Glow, but not for Bloom because that requires an algorithmic change that will be implemented separately. The Threshold, Streaks, Streaks Angle, Iterations, Fade, and Color Modulation node option was turned into a single value node input to allow the option to be used in node groups. --- Versioning was added to transfer node options into sockets, but it is not all 1:1 versioning, since the old Size option was not relative to the image size, so it depends on runtime information of the input size. As a guess, we assume the render size in that case. Versioning the [0, 1] range of the Mix option intentionally omits the attenuation of the image input, because that is almost certainly not what the user wants and was probably done thinking it controls the strength. Glare code now sets the alpha channel to 1, that's because it was already ignored in the mixing step, but now that we expose the Glare output, we need to set it to 1. So this is not a functional change. The get_glare_size() method was renamed for clarity since it now conflicts with the newly added Size input. --- This is a partial implementation of #124176 to address #131325. In particular, it adjust existing functionality, it doesn't add any new ones. Those will be added in separate patches. Pull Request: https://projects.blender.org/blender/blender/pulls/132499
2025-01-07 11:15:26 +01:00
shaders/compositor_glare_write_glare_output.glsl
shaders/compositor_glare_write_highlights_output.glsl
shaders/compositor_horizontal_lens_distortion.glsl
shaders/compositor_id_mask.glsl
shaders/compositor_image_coordinates_normalized.glsl
shaders/compositor_image_coordinates_pixel.glsl
shaders/compositor_image_coordinates_uniform.glsl
shaders/compositor_image_crop.glsl
shaders/compositor_inpaint_compute_boundary.glsl
shaders/compositor_inpaint_compute_region.glsl
shaders/compositor_inpaint_fill_region.glsl
shaders/compositor_jump_flooding.glsl
shaders/compositor_keying_compute_image.glsl
shaders/compositor_keying_compute_matte.glsl
shaders/compositor_keying_extract_chroma.glsl
shaders/compositor_keying_replace_chroma.glsl
shaders/compositor_keying_screen.glsl
shaders/compositor_keying_tweak_matte.glsl
shaders/compositor_kuwahara_anisotropic.glsl
shaders/compositor_kuwahara_anisotropic_compute_structure_tensor.glsl
shaders/compositor_kuwahara_classic.glsl
shaders/compositor_map_uv.glsl
shaders/compositor_map_uv_anisotropic.glsl
shaders/compositor_morphological_blur.glsl
shaders/compositor_morphological_distance.glsl
shaders/compositor_morphological_distance_feather.glsl
shaders/compositor_morphological_distance_threshold.glsl
shaders/compositor_morphological_step.glsl
shaders/compositor_motion_blur.glsl
shaders/compositor_motion_blur_max_velocity_dilate.glsl
shaders/compositor_movie_distortion.glsl
shaders/compositor_normalize.glsl
shaders/compositor_pad.glsl
shaders/compositor_parallel_reduction.glsl
shaders/compositor_pixelate.glsl
shaders/compositor_plane_deform_anisotropic.glsl
shaders/compositor_plane_deform_mask.glsl
shaders/compositor_plane_deform_motion_blur.glsl
shaders/compositor_plane_deform_motion_blur_mask.glsl
shaders/compositor_plane_deform.glsl
shaders/compositor_premultiply_alpha.glsl
shaders/compositor_radial_lens_distortion.glsl
shaders/compositor_read_input.glsl
shaders/compositor_realize_on_domain.glsl
shaders/compositor_sample_pixel.glsl
shaders/compositor_scale_variable.glsl
shaders/compositor_smaa_blending_weight_calculation.glsl
shaders/compositor_smaa_edge_detection.glsl
shaders/compositor_smaa_neighborhood_blending.glsl
shaders/compositor_split.glsl
shaders/compositor_summed_area_table_compute_complete_blocks.glsl
shaders/compositor_summed_area_table_compute_complete_x_prologues.glsl
shaders/compositor_summed_area_table_compute_complete_y_prologues.glsl
shaders/compositor_summed_area_table_compute_incomplete_prologues.glsl
shaders/compositor_symmetric_blur.glsl
shaders/compositor_symmetric_blur_variable_size.glsl
shaders/compositor_symmetric_separable_blur.glsl
shaders/compositor_symmetric_separable_blur_variable_size.glsl
shaders/compositor_tone_map_photoreceptor.glsl
shaders/compositor_tone_map_simple.glsl
shaders/compositor_translate_wrapped.glsl
shaders/compositor_van_vliet_gaussian_blur.glsl
shaders/compositor_van_vliet_gaussian_blur_sum.glsl
shaders/compositor_write_output.glsl
shaders/compositor_z_combine_compute_mask.glsl
shaders/compositor_z_combine_from_mask_depth.glsl
shaders/compositor_z_combine_from_mask_image.glsl
shaders/compositor_z_combine_simple_depth.glsl
shaders/compositor_z_combine_simple_image.glsl
shaders/library/gpu_shader_compositor_alpha_over.glsl
shaders/library/gpu_shader_compositor_bright_contrast.glsl
shaders/library/gpu_shader_compositor_channel_matte.glsl
shaders/library/gpu_shader_compositor_chroma_matte.glsl
shaders/library/gpu_shader_compositor_color_balance.glsl
shaders/library/gpu_shader_compositor_color_correction.glsl
shaders/library/gpu_shader_compositor_color_matte.glsl
shaders/library/gpu_shader_compositor_color_spill.glsl
shaders/library/gpu_shader_compositor_color_to_luminance.glsl
shaders/library/gpu_shader_compositor_convert_alpha.glsl
shaders/library/gpu_shader_compositor_difference_matte.glsl
shaders/library/gpu_shader_compositor_distance_matte.glsl
shaders/library/gpu_shader_compositor_eval.glsl
shaders/library/gpu_shader_compositor_exposure.glsl
shaders/library/gpu_shader_compositor_hue_correct.glsl
shaders/library/gpu_shader_compositor_hue_saturation_value.glsl
shaders/library/gpu_shader_compositor_image_diagonals.glsl
shaders/library/gpu_shader_compositor_invert.glsl
shaders/library/gpu_shader_compositor_jump_flooding_lib.glsl
shaders/library/gpu_shader_compositor_luminance_matte.glsl
shaders/library/gpu_shader_compositor_main.glsl
shaders/library/gpu_shader_compositor_map_value.glsl
shaders/library/gpu_shader_compositor_motion_blur_lib.glsl
shaders/library/gpu_shader_compositor_ocio_processor.glsl
shaders/library/gpu_shader_compositor_posterize.glsl
shaders/library/gpu_shader_compositor_separate_combine.glsl
shaders/library/gpu_shader_compositor_set_alpha.glsl
shaders/library/gpu_shader_compositor_store.glsl
shaders/library/gpu_shader_compositor_store_output.glsl
shaders/library/gpu_shader_compositor_summed_area_table_lib.glsl
shaders/library/gpu_shader_compositor_texture_utilities.glsl
shaders/library/gpu_shader_compositor_type_conversion.glsl
)
set(GLSL_C)
foreach(GLSL_FILE ${GLSL_SRC})
glsl_to_c(${GLSL_FILE} GLSL_C)
endforeach()
blender_add_lib(bf_compositor_shaders "${GLSL_C}" "" "" "")
blender_set_target_unity_build(bf_compositor_shaders 10)
list(APPEND LIB
bf_compositor_shaders
)
set(GLSL_SOURCE_CONTENT "")
set(GLSL_METADATA_CONTENT "")
set(GLSL_INFOS_CONTENT "")
foreach(GLSL_FILE ${GLSL_SRC})
get_filename_component(GLSL_FILE_NAME ${GLSL_FILE} NAME)
string(REPLACE "." "_" GLSL_FILE_NAME_UNDERSCORES ${GLSL_FILE_NAME})
string(APPEND GLSL_SOURCE_CONTENT "SHADER_SOURCE\(${GLSL_FILE_NAME_UNDERSCORES}, \"${GLSL_FILE_NAME}\", \"${GLSL_FILE}\"\)\n")
string(APPEND GLSL_METADATA_CONTENT "#include \"${GLSL_FILE}.hh\"\n")
string(APPEND GLSL_INFOS_CONTENT "#include \"${GLSL_FILE}.info\"\n")
endforeach()
set(glsl_source_list_file "${CMAKE_CURRENT_BINARY_DIR}/glsl_compositor_source_list.h")
file(GENERATE OUTPUT ${glsl_source_list_file} CONTENT "${GLSL_SOURCE_CONTENT}")
list(APPEND SRC ${glsl_source_list_file})
set(glsl_metadata_list_file "${CMAKE_CURRENT_BINARY_DIR}/glsl_compositor_metadata_list.hh")
file(GENERATE OUTPUT ${glsl_metadata_list_file} CONTENT "${GLSL_METADATA_CONTENT}")
list(APPEND SRC ${glsl_metadata_list_file})
set(glsl_infos_list_file "${CMAKE_CURRENT_BINARY_DIR}/glsl_compositor_infos_list.hh")
file(GENERATE OUTPUT ${glsl_infos_list_file} CONTENT "${GLSL_INFOS_CONTENT}")
list(APPEND SRC ${glsl_infos_list_file})
list(APPEND INC ${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(bf_compositor_shaders PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
if(WITH_TBB)
if(WIN32)
# TBB includes Windows.h which will define min/max macros
# that will collide with the STL versions.
add_definitions(-DNOMINMAX)
endif()
endif()
if(WITH_OPENIMAGEDENOISE)
add_definitions(-DWITH_OPENIMAGEDENOISE)
add_definitions(-DOIDN_STATIC_LIB)
list(APPEND INC_SYS
${OPENIMAGEDENOISE_INCLUDE_DIRS}
${TBB_INCLUDE_DIRS}
CMake: Refactor external dependencies handling This is a more correct fix to the issue Brecht was fixing in D6600. While the fix in that patch worked fine for linking it broke ASAN runtime under some circumstances. For example, `make full debug developer` would compile, but trying to start blender will cause assert failure in ASAN (related on check that ASAN is not running already). Top-level idea: leave it to CMake to keep track of dependency graph. The root of the issue comes to the fact that target like "blender" is configured to use a lot of static libraries coming from Blender sources and to use external static libraries. There is nothing which ensures order between blender's and external libraries. Only order of blender libraries is guaranteed. It was possible that due to a cycle or other circumstances some of blender libraries would have been passed to linker after libraries it uses, causing linker errors. For example, this order will likely fail: libbf_blenfont.a libfreetype6.a libbf_blenfont.a This change makes it so blender libraries are explicitly provided their dependencies to an external libraries, which allows CMake to ensure they are always linked against them. General rule here: if bf_foo depends on an external library it is to be provided to LIBS for bf_foo. For example, if bf_blenkernel depends on opensubdiv then LIBS in blenkernel's CMakeLists.txt is to include OPENSUBDIB_LIBRARIES. The change is made based on searching for used include folders such as OPENSUBDIV_INCLUDE_DIRS and adding corresponding libraries to LIBS ion that CMakeLists.txt. Transitive dependencies are not simplified by this approach, but I am not aware of any downside of this: CMake should be smart enough to simplify them on its side. And even if not, this shouldn't affect linking time. Benefit of not relying on transitive dependencies is that build system is more robust towards future changes. For example, if bf_intern_opensubiv is no longer depends on OPENSUBDIV_LIBRARIES and all such code is moved to bf_blenkernel this will not break linking. The not-so-trivial part is change to blender_add_lib (and its version in Cycles). The complexity is caused by libraries being provided as a single list argument which doesn't allow to use different release and debug libraries on Windows. The idea is: - Have every library prefixed as "optimized" or "debug" if separation is needed (non-prefixed libraries will be considered "generic"). - Loop through libraries passed to function and do simple parsing which will look for "optimized" and "debug" words and specify following library to corresponding category. This isn't something particularly great. Alternative would be to use target_link_libraries() directly, which sounds like more code but which is more explicit and allows to have more flexibility and control comparing to wrapper approach. Tested the following configurations on Linux, macOS and Windows: - make full debug developer - make full release developer - make lite debug developer - make lite release developer NOTE: Linux libraries needs to be compiled with D6641 applied, otherwise, depending on configuration, it's possible to run into duplicated zlib symbols error. Differential Revision: https://developer.blender.org/D6642
2020-01-20 18:36:19 +01:00
)
list(APPEND LIB
${OPENIMAGEDENOISE_LIBRARIES}
${TBB_LIBRARIES}
)
endif()
if(WITH_FFTW3)
list(APPEND INC_SYS
${FFTW3_INCLUDE_DIRS}
)
list(APPEND LIB
${FFTW3_LIBRARIES}
)
add_definitions(-DWITH_FFTW3)
endif()
blender_add_lib(bf_compositor "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
if(CXX_WARN_NO_SUGGEST_OVERRIDE)
target_compile_options(bf_compositor PRIVATE "-Wsuggest-override")
endif()