Commit Graph

83 Commits

Author SHA1 Message Date
Jeroen Bakker 65e58fe574 CMake: Fix Compiling Shader Builder on macOS
Due to changes in the build environment shader_builder wasn't able to
compile on macOs. This patch reverts several recent changes to CMake files.

* dbb2844ed9
* 94817f64b9
* 1b6cd937ff

The idea is that in the near future shader_builder will run on the buildbot as
part of any regular build to ensure that changes to the CMake doesn't break
shader_builder and we only detect it after a few days.

Pull Request: https://projects.blender.org/blender/blender/pulls/115929
2023-12-08 15:47:14 +01:00
Ray molenkamp 94817f64b9 Cleanup: CMake: Modernize bf_intern_utfconv dependencies
- Remove any bf_intern_utfconv paths from INC
- Add a dependency though LIB when missing
- an empty target is created for non windows builds, so we don't have to
if(WIN32) this all over the place

context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/115373
2023-11-28 01:11:15 +01:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton 49594c37ae License headers: use SPDX-FileCopyrightText for CMake files 2023-06-14 23:36:23 +10:00
Campbell Barton 0099f51cdd Cleanup: sort file, uppercase booleans, add missing headers
Also update files to ignore for check_cmake.
2023-05-17 13:13:10 +10:00
Sergey Sharybin a12a8a71bb Remove "All Rights Reserved" from Blender Foundation copyright code
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.

The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.

However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.

This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software ...

This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
2023-03-30 10:51:59 +02:00
Jeroen Bakker fda65ad5ca GPU: Renderdoc Frame Capturing
This PR uses renderdoc for frame capturing when enabled.
It enabled an easier workflow for frame capturing.

- Capture GPU API calls from test cases
- Capture GPU API calls from background threads
- Capture GPU API calls from background rendering.

Renderdoc is an important GPU debugger used by the Eevee/
Viewport module. Previously we needed to change code in
order to record background rendering, that could on its own
lead to other side-effects.

The integration with renderdoc can be enabled using
`WITH_RENDERDOC=On` compiler option. `GPU_debug_capture_begin`
and `GPU_debug_capture_end` can be added to the section
of the code you want to debug. When running Blender inside
renderdoc this part will automatically be captured.

All GPU test cases are now guarded by these calls. In order
to capture the test cases you need to start the test cases
from renderdoc and the captured GPU API calls will appear
where each capture is a single test case.

Pull Request: https://projects.blender.org/blender/blender/pulls/105921
2023-03-23 16:37:52 +01:00
Christian Rauch a296b8f694 GPU: replace GLEW with libepoxy
With libepoxy we can choose between EGL and GLX at runtime, as well as
dynamically open EGL and GLX libraries without linking to them.

This will make it possible to build with Wayland, EGL, GLVND support while
still running on systems that only have X11, GLX and libGL. It also paves
the way for headless rendering through EGL.

libepoxy is a new library dependency, and is included in the precompiled
libraries. GLEW is no longer a dependency, and WITH_SYSTEM_GLEW was removed.

Includes contributions by Brecht Van Lommel, Ray Molenkamp, Campbell Barton
and Sergey Sharybin.

Ref T76428

Differential Revision: https://developer.blender.org/D15291
2022-08-15 16:10:29 +02:00
Campbell Barton e58e023e1a GHOST/Wayland: support dynamic loading libraries for Wayland
Add intern/wayland_dynload which is used when WITH_GHOST_WAYLAND_DYNLOAD
is enabled (off by default). When enabled, systems without Wayland
installed will fall back to X11.

This allows Blender to dynamically load:
- libwayland-client
- libwayland-cursor
- libwayland-egl
- libdecor-0 (when WITH_GHOST_WAYLAND_LIBDECOR is enabled).
2022-07-06 15:30:47 +10:00
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Sergey Sharybin 5085c622ea Cleanup: Remove unused numapi library 2022-01-07 12:19:02 +01:00
Sergey Sharybin 72a199e148 Atomic: Cover with unit tests
Cover all atomic functions with unit tests.

The tests are quite simple, nothing special so far. The goal is to:

- Make sure implementation exists.
- Implementation behaves the same way on all platforms
  (We had issue when MSVC and GCC were behaving differently in the
  past).
- Proper bitness is used for implementation and non-fixed-size
  function implementation.

The tests can be extended further to make sure, for example, that
CAS operations do not cast arguments to a more narrow type for
comparison. Considering it a possible further improvement, as it is
better be done being focused on that specific task.

There is an annoying ifdef around 64bit implementation, which uses
same internal ifdef as the header does. This check is aimed to be
removed, so is easier to simply accept such duplication for now.

The tests seems somewhat duplicate for signed/unsigned variants and
things like this. The reason for that is to keep test code as simple
as possible: attempting to do something smart/tricky in the test code
often causes the test code to be a subject of being covered with its
own unit tests.

Differential Revision: https://developer.blender.org/D9590
2020-11-19 17:19:48 +01:00
Brecht Van Lommel 53d203dea8 Tests: move remaining gtests into their own module folders
And make them part of the blender_test runner. The one exception is blenlib
performance tests, which we don't want to run by default. They remain in their
own executable.

Differential Revision: https://developer.blender.org/D8498
2020-08-10 18:14:00 +02:00
Szymon Ulatowski 9de09220fc EEVEE: Implement the missing Sky texture
I'm not sure if the Sky was deliberately left out or was just waiting for a
better moment, but so many I was disappointed that Sky in EEVEE is
completely white.

There are already 2 implementations (osl and gpu) so this is the third one.
Looking at other cases it seems that we are not supposed to share sources
between cycles and the rest? So the new util_sky_model files are just
copies of what is already in cycles, except that the data file uses the RGB
variant of the Hosek/Wilkie model, because we output RGB anyway (but can be
easily changed to XYZ if desired - the results are nearly identical).
I am not sure if it is okay to pass 3*9 float values as 3 mat4 uniforms (I
wanted to use mat3 but it does not work).
Also, should I cache the sky model data between renders if the parameters
do not change?

Reviewed By: fclem, brecht

Differential Revision: https://developer.blender.org/D7108
2020-07-09 17:31:36 +02:00
Brecht Van Lommel 2db4a5bb9f Cleanup: remove unused string module
This is legacy code that can simply be replaced by std::string.
2020-04-28 12:57:39 +02:00
Brecht Van Lommel 22abc7f080 Build: add compatibility between precompiled libraries and new glibc
On Linux, precompiled libraries may be made with a glibc version that is
incompatible with the system libraries that Blender is built on. To solve
this we add a few -ffast-math symbols that can be missing.

Differential Revision: https://developer.blender.org/D6930
2020-02-26 18:13:14 +01:00
Sebastián Barschkis d27ccf990c Mantaflow [Part 6]: Updates in /blender/source
A collection of smaller changes that are required in the /blender/source files. A lot of them are also due to variable renaming.

Reviewed By: sergey

Maniphest Tasks: T59995

Differential Revision: https://developer.blender.org/D3855
2019-12-16 16:37:01 +01:00
Campbell Barton 0a38352588 Cleanup: clang-format, trailing space 2019-10-23 01:06:15 +11:00
Sebastian Parborg 57e55906f0 Add QuadriFlow remesher 2019-09-13 10:36:05 +02:00
Campbell Barton 3076d95ba4 Cleanup: use 2 space indentation for CMake 2019-04-17 06:35:54 +02:00
Campbell Barton ab5e69e660 Cleanup: remove contributors for CMake files
Following removal from C source code.

See: 8c68ed6df1
2019-02-05 09:10:32 +11:00
Sergey Sharybin 3ed0d5b4d4 Merge branch 'master' into blender2.8 2018-11-28 14:42:38 +01:00
Sergey Sharybin 683662e630 Add cross-platform NUMA library
Makes it simple to use NUMA libraries on various platforms.
2018-11-28 14:35:26 +01:00
Sergey Sharybin f8a499b596 OpenSubdiv: Add stub implementation of C-API
C-API is way smaller than the rest of the code which uses it.
So better to conditionally compile stub implementation than
to keep adding ifdef everywhere.
2018-08-13 12:37:18 +02:00
Clément Foucault 247ad2034d GWN: Port to GPU module: Move files to GPU
This does not include all the struct and type renaming. Only files were
renamed.

gwn_batch.c/h was fusioned with GPU_batch.c/h
gwn_immediate.c/h was fusioned with GPU_immediate.c/h
gwn_imm_util.c/h was fusioned with GPU_immediate_util.c/h
2018-07-18 00:17:57 +02:00
Brecht Van Lommel 41748b6a5e Cleanup: remove modules that were only used by the game engine. 2018-04-17 18:37:29 +02:00
Dalai Felinto 159806140f Removing Blender Game Engine from Blender 2.8
Folders removed entirely:
* //extern/recastnavigation
* //intern/decklink
* //intern/moto
* //source/blender/editors/space_logic
* //source/blenderplayer
* //source/gameengine

This includes DNA data and any reference to the BGE code in Blender itself.
We are bumping the subversion.

Pending tasks:
* Tile/clamp code in image editor draw code.
* Viewport drawing code (so much of this will go away because of BI removal
  that we can wait until then to remove this.
2018-04-17 17:51:28 +02:00
Campbell Barton b65ea517eb Merge branch 'master' into blender2.8
- Undo that changes modes currently asserts,
  since undo is now screen data.

  Most likely we will change how object mode and workspaces work
  since it's not practical/maintainable at the moment.

- Removed view_layer from particle settings
  (wasn't needed and complicated undo).
2018-04-01 11:03:25 +02:00
Campbell Barton 891c1cfc9a C Logging: use instead of printf for messages
- See `--log` help message for usage.
- Supports enabling categories.
- Color severity.
- Optionally logs to a file.
- Currently use to replace printf calls in wm module.

See D3120 for details.
2018-03-30 18:57:41 +02:00
Mike Erwin 4452bea2f1 move Gawain library to intern
Before now it lived in source/blender/gpu for convenience. Only a few files in the gpu module use Gawain directly.

Tested on Mac, time to push and test on Windows.

Todo: some CMake magic to make it easy to
#include "gawain/some_header.h"
from any C or H file. Main problem here is the many editors that include GPU_immediate.h which includes Gawain's immediate.h -- is there a way to avoid changing every editor's CMakeLists?
2017-03-16 23:32:35 -04:00
Campbell Barton bcc8c04db4 Cleanup: code style & cmake 2017-03-12 02:47:53 +11:00
Jorge Bernal dbdc346e9f CMake: Remove MOTO library dependency when it is not needed
It is not necessary to add MOTO library dependency when we use
WITH_IK_SOLVER (now it uses Eigen) or we use WITH_MOD_BOOLEAN (it was
used by bsp intern library some time ago but it is not present in the
code anymore).

Reviewers: mont29, sergey

Subscribers: mont29, sergey

Differential Revision: https://developer.blender.org/D2477
2017-02-06 19:29:42 +01:00
Benoit Bolsee eea89417f4 BGE: DeckLink card support for video capture and streaming.
You can capture and stream video in the BGE using the DeckLink video
   cards from Black Magic Design. You need a card and Desktop Video software
   version 10.4 or above to use these features in the BGE.
   Many thanks to Nuno Estanquiero who tested the patch extensively
   on a variety of Decklink products, it wouldn't have been possible without
   his help.
   You can find a brief summary of the decklink features here: https://wiki.blender.org/index.php/Dev:Source/GameEngine/Decklink
   The full API details and samples are in the Python API documentation.

bge.texture.VideoDeckLink(format, capture=0):

   Use this object to capture a video stream. the format argument describes
   the video and pixel formats and the capture argument the card number.
   This object can be used as a source for bge.texture.Texture so that the frame
   is sent to the GPU, or by itself using the new refresh method to get the video
   frame in a buffer.
   The frames are usually not in RGB but in YUV format (8bit or 10bit); they
   require a shader to extract the RGB components in the GPU. Details and sample
   shaders in the documentation.
   3D video capture is supported: the frames are double height with left and right
   eyes in top-bottom order. The 'eye' uniform (see setUniformEyef) can be used to
   sample the 3D frame when the BGE is also in stereo mode. This allows to composite
   a 3D video stream with a 3D scene and render it in stereo.
   In Windows, and if you have a nVidia Quadro GPU, you can benefit of an additional
   performance boost by using 'GPUDirect': a method to send a video frame to the GPU
   without going through the OGL driver. The 'pinned memory' OGL extension is also
   supported (only on high-end AMD GPU) with the same effect.

bge.texture.DeckLink(cardIdx=0, format=""):

   Use this object to send video frame to a DeckLink card. Only the immediate mode
   is supported, the scheduled mode is not implemented.
   This object is similar to bge.texture.Texture: you need to attach a image source
   and call refresh() to compute and send the frame to the card.
   This object is best suited for video keying: a video stream (not captured) flows
   through the card and the frame you send to the card are displayed above it (the
   card does the compositing automatically based on the alpha channel).
   At the time of this commit, 3D video keying is supported in the BGE but not in the
   DeckLink card due to a color space issue.
2016-06-11 22:26:05 +02:00
Kévin Dietrich e9452f909c Implementation of OpenVDB as a possible cache format for smoke
simulations.

This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.

A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.

A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB

Reviewers: sergey, lukastoenne, brecht, campbellbarton

Reviewed By: brecht, campbellbarton

Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht

Differential Revision: https://developer.blender.org/D1721
2016-01-23 08:39:40 +01:00
Sergey Sharybin 0634fd0e97 Remove raskter library
it's no longer used by any of the parts of Blender.
2016-01-08 16:30:30 +05:00
Sergey Sharybin ba432299cd Move Libmv from extern/ to intern/
Logically it is intern library since being mainly developed by 1.5 blender guys.
2016-01-04 19:39:13 +05:00
Brecht Van Lommel f9047c3f8c Eigen: fold remaining OpenNL code into intern/eigen.
Differential Revision: https://developer.blender.org/D1662
2015-12-10 01:58:10 +01:00
Brecht Van Lommel 858b680a50 Eigen: move C API into intern/eigen. 2015-12-10 01:58:06 +01:00
Sergey Sharybin 3d36489672 OpenSubdiv: Commit of OpenSubdiv integration into Blender
This commit contains all the remained parts needed for initial integration of
OpenSubdiv into Blender's subdivision surface code. Includes both GPU and CPU
backends which works in the following way:

- When SubSurf modifier is the last in the modifiers stack then GPU pipeline
  of OpenSubdiv is used, making viewport performance as fast as possible.

  This also requires graphscard with GLSL 1.5 support. If this requirement is
  not met, then no GPU pipeline is used at all.

- If SubSurf is not a last modifier or if DerivesMesh is being evaluated for
  rendering then CPU limit evaluation API from OpenSubdiv is used. This only
  replaces the legacy evaluation code from CCGSubSurf_legacy, but keeps CCG
  structures exactly the same as they used to be for ages now.

This integration is fully covered with ifdef and not enabled by default
because there are several TODOs to be solved first:

- Face varying data interpolation is not really cleanly implemented for GPU
  in OpenSubdiv 3.0. It is also not implemented for limit evaluation API.

  This basically means we'll have really hard time supporting UVs.

- Limit evaluation only works with adaptivly subdivided meshes so far, which
  basically means all the points of CCG are pushed to the limit. This gives
  different result from old code.

- There are some serious optimizations possible on the topology refiner
  creation, which would speed up initial OpenSubdiv mesh creation.

- There are some hardcoded asumptions in the GPU and DerivedMesh areas which
  could be generalized.

  That's something where Antony and Campbell can help, making it so the code
  is structured in a way which is reusable by all planned viewport projects.

- There are also some workarounds in the dependency graph to make sure OpenGL
  buffers are only freed from the main thread.

Those who'll be wanting to make experiments with this code should grab dev
branch (NOT master) from

  https://github.com/Nazg-Gul/OpenSubdiv/tree/dev

There are some patches applied in there which we're working on on getting
into upstream.
2015-07-20 22:29:26 +02:00
Jason Wilkins 8d084e8c8f Ghost Context Refactor
https://developer.blender.org/D643
Separates graphics context creation from window code in Ghost so that they can vary separately.
2014-10-07 15:47:32 -05:00
Sergey Sharybin 77b7e1fe9a Deduplicate CUDA and OpenCL wranglers
For now it was mainly about OpenCL wrangler being duplicated
between Cycles and Compositor, but with OpenSubdiv work those
wranglers were gonna to be duplicated just once again.

This commit makes it so Cycles and Compositor uses wranglers
from this repositories:

  - https://github.com/CudaWrangler/cuew
  - https://github.com/OpenCLWrangler/clew

This repositories are based on the wranglers we used before
and they'll be likely continued maintaining by us plus some
more players in the market.

Pretty much straightforward change with some tricks in the
CMake/SCons to make this libs being passed to the linker
after all other libraries in order to make OpenSubdiv linked
against those wranglers in the future.

For those who're worrying about Cycles being less standalone,
it's not truth, it's rather more flexible now and in the future
different wranglers might be used in Cycles. For now it'll
just mean those libs would need to be put into Cycles repository
together with some other libs from Blender such as mikkspace.

This is mainly platform maintenance commit, should not be any
changes to the user space.

Reviewers: juicyfruit, dingto, campbellbarton

Reviewed By: juicyfruit, dingto, campbellbarton

Differential Revision: https://developer.blender.org/D707
2014-08-05 13:57:50 +06:00
Sergey Sharybin 83617d24d5 Rework carve integration into boolean modifier
Goal of this commit is to support NGons for boolean modifier
(currently mesh is being tessellated before performing boolean
operation) and also solve the limitation of loosing edge custom
data layers after boolean operation is performed.

Main idea is to make it so boolean modifier uses Carve library
directly via it's C-API, avoiding BSP intermediate level which
was doubling amount of memory needed for the operation and which
also used quite reasonable amount of overhead time.

Perhaps memory usage and CPU usage are the same after all the
features are implemented but we've got support now:

- ORIGINDEX for all the geometry
- Interpolation of edge custom data (seams, crease)
- NGons support

Triangulation rule is changed now as well, so now non-flat
polygons are not being merged back after Carve work. This is
so because it's not so trivial to support for NGons and
having different behavior for quads and NGons is even more
creepy.

Reviewers: lukastoenne, campbellbarton

Differential Revision: https://developer.blender.org/D274
2014-02-13 17:16:53 +06:00
Campbell Barton 2b4c68b902 CMake Build: option to compile without opennl/superlu. 2013-11-25 15:36:19 +11:00
Sergej Reich 7d66d3298c cmake: bsp needs moto 2013-10-27 13:58:13 +00:00
Campbell Barton af1c274be7 skip building moto if its not needed. 2013-08-24 10:23:41 +00:00
Campbell Barton b97334f992 add GPL header to treehash.c and add missing includes to cmake. 2013-08-24 03:17:28 +00:00
Sergey Sharybin 7dc33e3ef8 Move opencl and reigidbody from source/blender/ to intern/
This modules does not depend on any blender-specific data
structures or algorithms and due to our policy better be
placed to intern/

Shall be no functional changes, tested CMake and SCons on
Linux, hopefully other platforms will work as well.

P.S. SVN history shall be preserved for the files.
2013-02-01 06:24:49 +00:00
Bastien Montagne 5ff3017900 Replacing gettext i18n backend by boost::locale one.
This commit adds a small and simplistic C wrapper around boost's locale library as intern/locale, and heavily simplifies/reduces Blender's own i18n code (under blenfont/ dir). And it adds back UI translation on windows' official builds (with msvc)!

Note to platform maintainers: iconv and gettext (libintl) can now be removed from precompiled libs (not gettext binaries, under windows, of course ;) ).

Note to MinGW32/64 users: boost_locale lib has not yet been uploaded for those build env, please disable WITH_INTERNATIONAL for now (hopefully will be fixed very soon, have contacted psy-fy).
2012-11-11 16:54:26 +00:00
Campbell Barton 226a5ee834 remove LOD_Decimator (c++ decimator), now replaced by bmesh decimator. also remove CTR c++ classes that are no longer used. 2012-10-22 02:39:26 +00:00
Sergey Sharybin b93da9b01e Color Management, Stage 1: Initial OpenColorIO library integration
This commit integrates support of OpenColorIO library into build systems.

It also contains C-API for OpenColorIO library which could be used by Blender.

CMake has got find rules familiar to OpenImageIO's one which makes it easier
for build system to find needed libraries and includes. Scons only could use
explicitly defined paths to libraries and includes.

C-API would be compiled and Blender would be linked against C-API and OpenColorIO
but it wouldn't affect on Blender behavior at all.

OpenColorIO could be disabled by setting up WITH_OCIO to Off in CMake and
setting WITH_BF_OCIO in Scons.
2012-09-15 10:03:17 +00:00