Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-21Fix missing OpenMP in Linux buildsSergey Sharybin
OpenSubdiv OpenMP detection was interfering, but we don't use it there anymore so just remove that code.
2022-09-23Cleanup: use lowercase function calls & macros in for CMakeCampbell Barton
This is already the case for most CMake usage. Although some find modules are an exception to this, as they were originally maintained externally they use some different conventions. Also corrected bad indentation in: intern/cycles/CMakeLists.txt
2022-09-18Build: fix gtest build flags affecting actual libraryBrecht Van Lommel
Switch to target_ functions to avoid this.
2022-08-15Cleanup OpenGL linking and related code after libepoxy mergeSebastian Parborg
This cleans up the OpenGL build flags and linking. It additionally also removes some dead code. One of these dead code paths is WITH_X11_ALPHA which actually never was active even with the build flag on. The call to use this was never called because the default initializer for GHOST was set to have it off per default. Nothing called this function with a boolean value to enable it. These cleanups are needed to support true headless OpenGL rendering. Without these cleanups libepoxy will fail to load the correct OpenGL Libraries as we have already linked them to the blender binary. Reviewed By: Brecht, Campbell, Jeroen Differential Revision: http://developer.blender.org/D15554
2022-08-15GPU: replace GLEW with libepoxyChristian Rauch
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-07-18Subdiv: remove unused GPU device choice, fix crash with libepoxy on initBrecht Van Lommel
openSubdiv_init() would detect available evaluators before any OpenGL context exists, causing a crash with libepoxy. This test however is redundant as we already check the requirements on the Blender side through the GPU API. To simplify things, completely remove the device detection in the opensubdiv module and reduce the evaluators to just CPU and GPU. The plan here is to move to the GPU module abstraction over OpenGL/Metal/Vulkan and so all these different backends no longer make sense. This also removes the user preference for OpenSubdiv compute device, which was not used for the new GPU subdivision implementation. Ref D15291 Differential Revision: https://developer.blender.org/D15470
2022-02-17Merge remote-tracking branch 'origin/blender-v3.1-release'Kévin Dietrich
2022-02-17Fix T94881: GPU subdivision fails with high polycount coarse meshesKévin Dietrich
Coarse meshes with high polycount would show as corrupted when GPU subdivision is used with AMD cards This was caused by the OpenSubdiv library not taking `GL_MAX_COMPUTE_WORK_GROUP_COUNT` into account when dispatching computes. AMD drivers tend to set the limit lower than NVidia ones (2^16 for the former, and 2^32 for the latter, at least on my machine). This moves the `GLComputeEvaluator` from the OpenSubdiv library into `intern/opensubdiv` and modifies it to compute a dispatch size in a similar way as for the draw code: we split the dispatch size into a 2 dimensional value based on `GL_MAX_COMPUTE_WORK_GROUP_COUNT` and manually compute an index in the shader. We could have patched the OpenSubdiv library and sent the fix upstream (which can still be done), however, moving it to our side allows us to better control the `GLComputeEvaluator` and in the future remove some redundant work that it does compared to Blender (see T94644) and probably prepare the ground for Vulkan support. As a matter of fact, this patch also removes the OpenGL initialization that OpenSubdiv would do here. This removal is not related to the bug fix, but necessary to not have to copy more files/code over. Differential Revision: https://developer.blender.org/D14131
2022-02-11File headers: SPDX License migrationCampbell Barton
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
2021-12-27OpenSubDiv: add support for an OpenGL evaluatorKévin Dietrich
This evaluator is used in order to evaluate subdivision at render time, allowing for faster renders of meshes with a subdivision surface modifier placed at the last position in the modifier list. When evaluating the subsurf modifier, we detect whether we can delegate evaluation to the draw code. If so, the subdivision is first evaluated on the GPU using our own custom evaluator (only the coarse data needs to be initially sent to the GPU), then, buffers for the final `MeshBufferCache` are filled on the GPU using a set of compute shaders. However, some buffers are still filled on the CPU side, if doing so on the GPU is impractical (e.g. the line adjacency buffer used for x-ray, whose logic is hardly GPU compatible). This is done at the mesh buffer extraction level so that the result can be readily used in the various OpenGL engines, without having to write custom geometry or tesselation shaders. We use our own subdivision evaluation shaders, instead of OpenSubDiv's vanilla one, in order to control the data layout, and interpolation. For example, we store vertex colors as compressed 16-bit integers, while OpenSubDiv's default evaluator only work for float types. In order to still access the modified geometry on the CPU side, for use in modifiers or transform operators, a dedicated wrapper type is added `MESH_WRAPPER_TYPE_SUBD`. Subdivision will be lazily evaluated via `BKE_object_get_evaluated_mesh` which will create such a wrapper if possible. If the final subdivision surface is not needed on the CPU side, `BKE_object_get_evaluated_mesh_no_subsurf` should be used. Enabling or disabling GPU subdivision can be done through the user preferences (under Viewport -> Subdivision). See patch description for benchmarks. Reviewed By: campbellbarton, jbakker, fclem, brecht, #eevee_viewport Differential Revision: https://developer.blender.org/D12406
2021-07-24GTest: Use INC/INC_SYS for Libmv/OSD testsRay Molenkamp
This change transitions libmv/osd tests to our blender_add_test_executable macro that explicitly takes the include directories as a parameter. This is in preparation for future clean-up of global include directories. Differential Revision: https://developer.blender.org/D12012 Reviewed By: sergey
2020-09-18CMake/OpenSubdiv: Rename INCLUDE_DIR -> INCLUDE_DIRS.Ankit Meel
Ref {D8855} Unix and Apple platform files use find_package(OpenSubdiv) which sets `OPENSUBDIV_INCLUDE_DIR` as an advanced variable, as well as `OPENSUBDIV_INCLUDE_DIRS` which should be used usually. Windows sets `OPENSUBDIV_INCLUDE_DIR` which is used by the rest of the code. This patch renames it to `_DIRS` everywhere, for it to be like other similar variables. Reviewed By: brecht Differential Revision: https://developer.blender.org/D8917
2020-05-27OpenSubdiv: Add regression tests for mesh topologySergey Sharybin
While this looks trivial it already allowed to catch issues in one of previous attempt to optimize memory usage. It will totally be useful for an upcoming refactor of face topology storage.
2020-05-27OpenSubdiv: Cleanup, remove unused codeSergey Sharybin
There is no need in edge map anymore.
2020-05-27OpenSubdiv: Refactor, move mesh topology comparison to own fileSergey Sharybin
Makes it easier to follow and extend.
2020-05-27OpenSubdiv: Refactor, move comparison to own fileSergey Sharybin
2020-05-27OpenSubdiv: Add explicit storage for mesh topologySergey Sharybin
The idea is to use this explicit storage for topology comparison rather than using base level. While this will have memory overhead it allows to simplify comparison of such things as: - Vertex sharpness (where base level from topology refiner will have it refined, meaning it will be different from what application requested for non-manifold and corner vertices). - It will allow to simplify face-vertices comparison, where currently O(N^2) algorithm is used due to possible difference in face winding. - It will also allow to avoid comparison-time allocation of edge map. Currently no functional changes, just preparing for development which will happen next.
2020-05-27OpenSubdiv: Refactor, move utils to baseSergey Sharybin
Also split them across utilities and types.
2020-05-27OpenSubdiv: Refactor, move base C-API file to base folderSergey Sharybin
2020-05-27OpenSubdiv: Refactor, move type conversion to base fodlerSergey Sharybin
2020-05-27OpenSubdiv: Refactor, move evaluator to own folderSergey Sharybin
2020-05-27OpenSubdiv: Completely disable topology verificationSergey Sharybin
Previously it was enabled for debug builds, now it is to be enabled explicitly. The reason for this is to reduce overhead when debugging other areas which might involve subdivision surface. When conversion is to be debugged set this manually in the code.
2020-05-27OpenSubdiv: Refactor, move edge map to base folderSergey Sharybin
2020-05-27OpenSubdiv: Refactor creation of topology refinerSergey Sharybin
Consolidate it inside of the topology refiner implementation class, which would allow to store extra data acquired during construction of the OpenSubdiv's object.
2020-05-27OpenSubdiv: Refactor, use C++ allocation for internal classesSergey Sharybin
Only use OBJECT_GUARDED_{NEW. DELETE} for structures which are part of public C-API (and hence can not have new/delete operators overloaded). Could try being brave and override new/delete from under C++ ifdef.
2020-05-27OpenSubdiv: Refactor, move topology refiner factory to topology folderSergey Sharybin
2020-05-27OpenSubdiv: Refactor, move topology refiner to own folderSergey Sharybin
In the future factory will also be moved there.
2020-05-27OpenSubdiv: Refactor, move device specific code to own filesSergey Sharybin
Also, move all device files to own folder. Makes it so checks for device availability are done in a localized place.
2020-05-19OpenSubdiv: Remove old GPU codeSebastián Barschkis
This code was accidentally reintroduced in e73d7d27dc66.
2020-05-19Merge branch 'blender-v2.83-release'Sebastián Barschkis
2020-05-19Fix: build error due to missing definitionsJacques Lucke
Reviewers: sergey, brecht Differential Revision: https://developer.blender.org/D7787
2020-05-18OpenSubdiv: Cleanyp, remove old GPU codeSergey Sharybin
All parts of drawing (shaders, GL mesh descriptor, material partitioner and so on) needs to be redone for the draw manager and new OpenSubdiv library. Removing untested code which is doomed to be replaced to make localized refactoring easier.
2020-05-18OpenSubdiv: Cleanup, remove unused topology orientation codeSergey Sharybin
The code was trying to make winding consistent and manifold, same as OpenSubdiv expects it to. Unfortunately, the code was having some issues in corner cases so the winding wasn't really correct. Fortunately, the latter (compared to when this code was originally written) supports orientation on OpenSubdiv side. Removing code which is currently unused in Blender and which had known issues. Is simple enough to bring the code from Git history if the functionality is needed in the future.
2020-01-27Cleanup: fix compiler warningsBrecht Van Lommel
2020-01-23CMake: Refactor external dependencies handlingSergey Sharybin
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
2019-10-28CMake: add missing headers, use space before commentsCampbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-14CMake: prepare for BLENDER_SORTED_LIBS removalCampbell Barton
No functional change, this adds LIB definition and args to cmake files. Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS' since there are many platforms/configurations that could break when changing linking order. Manually add and enable WITHOUT_SORTED_LIBS to try building without sorted libs (currently fails since all variables are empty). This check will eventually be removed. See T46725.
2019-02-05Cleanup: remove contributors for CMake filesCampbell Barton
Following removal from C source code. See: 8c68ed6df16d8893
2019-01-16OpenSubdiv: Correct topology cpmparatorSergey Sharybin
This fixes following errors: - The code didn't work correctly for edges reconstructed by the OpenSubdiv's topology refiner (due to indexing difference). - Sharpness of non-manifold and boundary edges was not working correctly.
2018-09-06CMake: add missing headersCampbell Barton
2018-08-13OpenSubdiv: Add stub implementation of C-APISergey Sharybin
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-07-16OpenSubdiv: Re-work C-API integrationSergey Sharybin
Main goal is to make API simpler to follow (at least ion terms what is defined/declared where, as opposite of handful big headers which includes all the declarations), and also avoid a big set of long and obscure functions. Now C-API files are split into smaller ones, following OpenSubdiv behavior more closely, and also function pointers in structures used a lot more, which shortens functions names, UV integration part in GL Mesh is mainly stripped away, it needs to be done differently. On a related topic, UV coordinates API in converter needs to be removed as well, we do not need coordinates, only island connectivity information there. Additional changes: - Varying interpolation in evaluator API are temporarily disabled, need to extend API somewhere (probably, evaluator's API) to inform layout information of vertex data (whether it contains varying data, width, stride and such). - Evaluator now can interpolate face-varying data. Only works for adaptive refiner, since some issues in OpenSubdiv itself. Planned changes: - Remove uv coordinates from TopologyConverter. - Support evaluation of patches (as opposite to individual coordinates as it happens currently). - Support more flexible layout of varying and face-varying data. It is stupid to assume varying is 3 floats and face-varying 2 floats. - Support of second order derivatives. - Everything else what i'm missing in this list.
2016-09-16OpenSubdiv: Split shader source filesSergey Sharybin
Was a bit annoying to do tweaks in a file which contained all vertex, geometry and fragment shaders.
2016-07-21Attempt to fix compilation on Windows, take 2Kévin Dietrich
Previous patch was wrong apparently... :|
2016-07-21Attempt to fix compilation error on Windows.Kévin Dietrich
Patch from @fjuhec.
2016-07-20OpenSubdiv: Wrap OSD's TopologyRefier with own structSergey Sharybin
This is a way for us to store extra data, such as UVs which we can collect now on topology refiner stage.
2016-01-30CMake: Remove per-module Werror settingsSergey Sharybin
Seems i was the only one who was really up to using it and i do have gcc-5 finally backported and installed here so such a fine-tune flags are no longer needed.
2015-08-25OpenSubdiv: Remove partitioned mesh interfaceSergey Sharybin
It's hopefully no longer needed, at least not needed for as long as single ptex face corresponds to a single patch which should be always correct for uniform subdivisions as far as i know.
2015-07-30OpenSubdiv: Add CMake option to enable -Werror in subsurf codeSergey Sharybin