Commit Graph

7631 Commits

Author SHA1 Message Date
8e331c3431 Fix T59565: NaN/crash with zero radius tip of hair curves. 2018-12-21 18:54:45 +01:00
4eeab96f10 Cleanup: fix ATTR_FALLTHROUGH warnings.
Ref D3960.
2018-12-21 17:02:04 +01:00
Sergey Sharybin
b52465bd32 Cycles: Fixes for recent curve robustness
The key indices were wrong: need to offset curve key index
by first curve key index. Also corrected calculation of the
interpolation step.

Annoyingly, can not reproduce this on a simple file, need
production rig. For the possible future look the following
file from Spring was used: 03_005_A.lighting.debug.blend
2018-12-20 16:45:38 +01:00
Sergey Sharybin
2947882bb1 Cycles: Update standalone app to OIIO 2.0 2018-12-13 14:31:38 +01:00
Sergey Sharybin
66d8bfb85c Update code to be compatible with OIIO 2.0
There are some changes in API of OpenImageIO, but those are quite
simple to keep working with older and newer library versions.

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D4064
2018-12-11 15:50:02 +01:00
84b02dc54a Cleanup: remove accidentally committed debug code. 2018-12-11 15:18:15 +01:00
Sergey Sharybin
ece109dd60 Cycles: Add strict assert when assigning input socket stack offset 2018-12-11 14:34:52 +01:00
Sergey Sharybin
b45b082531 Cycles: Remove old nasty workaround
It used to be used for some sort of ignoring automatically
generated bump nodes. But nowadays it causes one of the shaders
in Classroom demo file to be compiled wrong.
2018-12-11 14:34:52 +01:00
765795aed7 Fix macOS buildbot build, wrong CUDA version check. 2018-12-11 14:16:48 +01:00
Sergey Sharybin
39d24ffccb Cycles: Cleanup, indentation 2018-12-11 12:57:57 +01:00
Sergey Sharybin
3b1f90ed84 Cycles: Do more user-friendly indication that GPU devices are not found 2018-12-07 14:53:29 +01:00
Sergey Sharybin
bb0d812d98 Cycles: Disable OpenCL on macOS
This is unfortunate, but the number of bugs in this configuration
keeps growing, and almost all of them are caused by bug in OpenCL
compiler.

The compiler is not likely to be fixed, since Apple declared OpenCL
deprecated.

This evil commit is aimed to keep officially supported features
of Blender in a good working and stable state.
2018-12-07 14:37:47 +01:00
cccc40db51 Fix T57963: Cycles crash using AO for displacement.
Note this is not supported, there exists no geometry at this point, but
it should not crash at least.
2018-12-06 19:50:05 +01:00
Bastien Montagne
834fa06614 Fix (unreported) building Cycles tests with Embree enabled. 2018-12-05 15:14:16 +01:00
c9344d6c5b Fix T58776, T58030: pressure sensitivity on Linux not working for some tablets. 2018-12-05 14:02:37 +01:00
f5b46daf52 Fix build with old CMake versions. 2018-12-05 12:53:19 +01:00
Niels
8908670623 Fix T58466: bug in macOS GHOST_GetSwapInterval.
No user level changes since this function is not used in active code.
2018-12-04 18:44:42 +01:00
f63da3dcf5 Buildbot: enable support for NVIDIA Turing cards in Cycles (like GTX 20xx).
We currently only build the sm_7x kernels with CUDA 10.0, older cards still
use 9.1 until rendering errors are solved for them.
2018-12-04 16:03:18 +01:00
b14ec18601 Cycles: add initial CUDA 10.0 support, but only recommend use for Turing cards.
There may still be rendering errors when used for older graphics cards.
2018-12-04 16:03:18 +01:00
Shane Ambler
5a6f1fa563 Fix T58600: update OSL scripts to work with OSL 1.10.x. 2018-12-03 15:14:21 +01:00
Campbell Barton
6e253fc627 Correct missing semicolon in recent commit 2018-11-30 17:07:13 +11:00
a8b8da5567 Fix T58183: crash with CPU + GPU rendering after profiling changes.
Multi-device was not passing along profiler to the CPU.
2018-11-29 23:43:27 +01:00
Campbell Barton
8ac2d85d2f Cleanup: trailing space 2018-11-30 08:38:25 +11:00
2c154399a2 Fix internal compiler error when building with VS 2017 (15.9.3).
It doesn't like alignment for function arguments, and I don't think this
alignment is needed.

Solution found by Ray Molenkamp.
2018-11-29 16:42:52 +01:00
Sergey Sharybin
b00819bcca Atomic: Avoid conflicts with definitions in other areas
While atomics library was trying to use "user-space" defined
LIKELY() and UNLIKELY(), this is not always true that user
code was checking for those macro coming from an unrelated
area.
2018-11-29 09:33:50 +01:00
Campbell Barton
140f2209b6 Cleanup: correct typo, no need for ./ prefix 2018-11-29 12:54:30 +11:00
Lukas Stockner
7fa6f72084 Cycles: Add sample-based runtime profiler that measures time spent in various parts of the CPU kernel
This commit adds a sample-based profiler that runs during CPU rendering and collects statistics on time spent in different parts of the kernel (ray intersection, shader evaluation etc.) as well as time spent per material and object.

The results are currently not exposed in the user interface or per Python yet, to see the stats on the console pass the "--cycles-print-stats" argument to Cycles (e.g. "./blender -- --cycles-print-stats").

Unfortunately, there is no clear way to extend this functionality to CUDA or OpenCL, so it is CPU-only for now.

Reviewers: brecht, sergey, swerner

Reviewed By: brecht, swerner

Differential Revision: https://developer.blender.org/D3892
2018-11-29 02:45:24 +01:00
Sergey Sharybin
2b371b65bc More fixes for NUMA on macOS 2018-11-28 18:05:35 +01:00
Sergey Sharybin
8a6aa15903 Fix compilation error on macOS 2018-11-28 17:57:04 +01:00
Sergey Sharybin
547bc2a620 Fix compilation error on 32bit Windows 2018-11-28 17:54:58 +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
acd1d1a31d CMake: Remove Cycles specific OpenSubdiv options
Just use one flag which enables OpenSubdiv globally for all the
areas of Blender.
2018-11-26 11:41:38 +01:00
7c19d9e9af Fix X11 tablet pen and eraser distinction being wrong in some cases.
This extends the earlier fix to use the latest logic from Wine's wintab.c,
to better handle eraser detection.
2018-11-24 23:24:32 +01:00
Campbell Barton
e742e0934d Cleanup: trailing space 2018-11-25 08:01:14 +11:00
Jens Verwiebe
e5bc9fae54 Fix penpressure for tablets that use libinput on linux 2018-11-24 18:26:20 +01:00
Stefan Werner
874f12480f Cycles: Fixed a warning. 2018-11-23 13:47:25 +01:00
Stefan Werner
aa000400dc Cycles: Improved robustness of hair motion blur.
In some instances, the number of control vertices of a hair could change mid-frame.
Cycles would then be unable to calculate proper motion blur for those hairs. This adds
interpolated CVs to fill in for the missing data. While this will not necessarily result in
a fully accurate reconstruction of the guide hair, it preserves motion blur instead of disabling it.

Reviewers: #cycles, sergey

Reviewed By: #cycles, sergey

Subscribers: sergey, brecht, #cycles

Tags: #cycles

Differential Revision: https://developer.blender.org/D3695
2018-11-23 13:25:26 +01:00
Sergey Sharybin
968bf0df14 Fix T57811: Render crashes in certain scenes when AO Bounces are used 2018-11-21 14:17:26 +01:00
Sergey Sharybin
6f48bfc7a8 Cycles: Cleanup, use utility function
Replaces inlined platform-specific code.
2018-11-21 13:51:18 +01:00
Sergey Sharybin
65143542af Cycles: Cleanup, reduce indentation level 2018-11-21 12:41:24 +01:00
Sergey Sharybin
700330afe8 Cycles: Cleanup, comments and dead code 2018-11-21 11:33:11 +01:00
Sergey Sharybin
65d01def80 Cycles: Cleanup, CUDA code path is not possible inside AVX2 2018-11-21 11:28:49 +01:00
Sergey Sharybin
cd9ab9d99e Cycles: Cleanup, code style 2018-11-15 17:16:40 +01:00
Campbell Barton
d7f55c4ff5 Cleanup: comment block tabs 2018-11-14 17:10:56 +11:00
Sergey Sharybin
d23a53c74a Cycles: Fix/workaround for gcc-7.2
For some reason when building with gcc-7.2 (which is default
in previous Ubuntu LTS) the guarded allocator is not being
properly instantiated.

Doesn't happen with newer version of gcc-7 which is 7.3, and
also doesn't happen with gcc-6 and gcc-8.

Would be nice to know what is wrong, but for the time being
committing workaround which keeps Blender users happy.
2018-11-12 12:16:07 +01:00
Sergey Sharybin
e732c6af3b Cycles: Proper comment for closing header guard 2018-11-12 11:02:10 +01:00
Sergey Sharybin
65e9388440 Revert "Cycles: Cleanup, move Embree BVH logic to own file"
While we shouldn't have logic in an entry point, and since one should
not be making typos when moving lines around, there is bigger entanglement
issue with BVH host code using kernel function. This is bad violation,
but is tricky to get solved moments before the weekly.

In order to keep things in a (less) broken state than before own cleanup
reverting the changes.

This reverts commit 2bad10be96540ff50a149230d656e599775b3f47.
This reverts commit ddabb21d0584e9874e8e5c62c04abe496ec7334b
2018-11-09 17:54:09 +01:00
Sergey Sharybin
e6573138f7 Cycles: Cleanup, remove unused method declaration
Was never defined. If it's really needed, consider using `const string&`.
2018-11-09 15:21:19 +01:00
Sergey Sharybin
ddabb21d05 Cycles; Cleanup, line length
There are some more sanitization which would be cool to be done
in the neighbourhood of those functions, but that could also happen
later.
2018-11-09 12:31:46 +01:00
Sergey Sharybin
2bad10be96 Cycles: Cleanup, move Embree BVH logic to own file
There is no way we can keep generic entry point functions easy to
follow if we start adding actual logic in them.
2018-11-09 12:28:55 +01:00
Sergey Sharybin
2d98b198e9 Cycles: Cleanup, indentation in preprocessor 2018-11-09 12:12:11 +01:00
Sergey Sharybin
3e76cc494a Cycles: Cleanup, indentation 2018-11-09 12:10:48 +01:00
Sergey Sharybin
203de0bbf0 Cycles: Cleanup, space after (void)
It was used in like 95% of places.
2018-11-09 12:08:51 +01:00
Sergey Sharybin
2330cadb0f Cycles: Cleanup, don't use strict C prototypes
Those are more like a legacy of language, which is not
needed in C++.
2018-11-09 12:04:41 +01:00
Sergey Sharybin
c86d4b1d80 Cycles: Cleanup, split array from vector
Those are similar but different types, no reason to keep
their definitions in a single file.
2018-11-09 11:54:24 +01:00
Sergey Sharybin
b394e05118 Cycles: Cleanup, some documentation 2018-11-09 11:46:09 +01:00
Sergey Sharybin
a15e631537 Cycles: Cleanup, remove unneeded manual constructors specification 2018-11-09 11:44:33 +01:00
Sergey Sharybin
0e9be6fd7d Cycles: Cleanup, remove unneeded method from vector
Since we've defaulted to C++11, no need to override this
method manually anymore.
2018-11-09 11:42:12 +01:00
Sergey Sharybin
cb4b5e12ab Cycles: Cleanup, spacing after preprocessor
It is supposed to be two spaces before comment stating which if
else/endif statements corresponds to. Was mainly violated in the
header guards.
2018-11-09 11:34:54 +01:00
116be3deff Fix build on 32bit after Embree changes. 2018-11-08 14:58:01 +01:00
Lukas Stockner
47c77cd89c Cycles: Write Cryptomatte metadata according to the specification
Reviewers: brecht, sergey, swerner

Subscribers: creamsurfer, Tanguy, Noss, SteffenD

Differential Revision: https://developer.blender.org/D3862
2018-11-08 01:07:54 +01:00
Stefan Werner
d3320c5488 Cycles: Rearranged macros in kernel_types.h to fix Embree build. 2018-11-07 15:20:24 +01:00
33201a48b0 Fix build with OSL, remove unneeded file after Embree changes. 2018-11-07 14:38:07 +01:00
Stefan Werner
d3dd3739f6 Cycles: Fixed a warning. 2018-11-07 14:04:22 +01:00
Stefan Werner
e96986fa47 Cycles: Fixed OpenCL render after the Embree checkin. 2018-11-07 13:53:56 +01:00
Stefan Werner
2c5531c0a5 Cycles: Added Embree as BVH option for CPU renders.
Note that this is turned off by default and must be enabled at build time with the CMake WITH_CYCLES_EMBREE flag.
Embree must be built as a static library with ray masking turned on, the `make deps` scripts have been updated accordingly.
There, Embree is off by default too and must be enabled with the WITH_EMBREE flag.

Using Embree allows for much faster rendering of deformation motion blur while reducing the memory footprint.

TODO: GPU implementation, deduplication of data, leveraging more of Embrees features (e.g. tessellation cache).

Differential Revision: https://developer.blender.org/D3682
2018-11-07 12:58:12 +01:00
ea8e45de29 Fix assert rendering hair tests on some systems. 2018-11-04 20:25:57 +01:00
db59f30f2b Fix assert rendering with denoising, after recent changes. 2018-11-04 20:15:33 +01:00
Sergey Sharybin
e0cc3e9809 Cycles: Fix wrong BVH used when disabling AVX2 in debug settings
Mainly useful for debugging. Previously, when AVX2 was disabled
in the debug panel but BVH layout was kept on BVH8 nothing was
rendered.

Needed to make it so supported BVH layout mask for devices is
queried in "dynamic", so it is possible to use DebugFlags there.
2018-10-31 11:46:52 +01:00
7c0d37deca Fix build error on Windows 32bit, alignment was wrong. 2018-10-30 11:39:44 +01:00
Lukas Stockner
e3817e5ec1 Cycles: Support generating Denoising passes without actually denoising
Needed for the animation denoiser since the denoising filter is done separately there.

Reviewers: brecht, sergey

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D3833
2018-10-29 15:50:01 +01:00
17d91bcb61 Cycles: more detailed tooltips for cryptomatte options. 2018-10-29 13:22:58 +01:00
47953dee79 Fix Linux build after Cryptomatte commit. 2018-10-28 14:55:55 +01:00
Stefan Werner
e58c6cf0c6 Cycles: Added Cryptomatte output.
This allows for extra output passes that encode automatic object and material masks
for the entire scene. It is an implementation of the Cryptomatte standard as
introduced by Psyop. A good future extension would be to add a manifest to the
export and to do plenty of testing to ensure that it is fully compatible with other
renderers and compositing programs that use Cryptomatte.

Internally, it adds the ability for Cycles to have several passes of the same type
that are distinguished by their name.

Differential Revision: https://developer.blender.org/D3538
2018-10-28 05:37:41 -04:00
c0b3e3daeb Fix T57393: Cycles OSL bevel and AO not working after OSL upgrade. 2018-10-27 15:00:37 +02:00
Lukas Stockner
f1673d20fa Cycles: Expose noisy image pass by default when rendering with denoiser
Apparently quite a few users would like to have the noisy pass available when using the denoiser, and since it's being generated anyways we might as well expose it by default.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3608
2018-10-26 16:21:11 +02:00
Lukas Stockner
65b25df801 Cycles: Overhaul ensure_valid_reflection to fix issues with normal- and bumpmapping
This function is supposed to prevent the black artifacts caused by strong normal- or bumpmapping, but failed in some cases.

Now the code correctly handles all test files and previous issues I am aware of and also has extensive comments describing
the algorithm and the math behind it.

Basically, the main problem was that there can be multiple valid solutions that fulfil the reflection angle criterium,
but I had assumed that only one would exist and therefore simply picked the first solution with a positive term in srqt().
Now, the code uses additional validity checks and a simple heuristic to pick the best valid solution.

Additionally, the code messed up very shallow reflections even if the normal map strength was zero due to the constant
limit for the outgoing ray angle, which caused shallow incoming rays to fail the initial test even when reflected directly
on Ng. Now, the code accounts for this by reducing the threshold in the case of a shallow incoming ray, ensuring that at
least N=Ng is always a valid solution.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3816
2018-10-25 14:50:48 +02:00
Bastien Montagne
35d7211bfa I18n: tweak/fix exception catching code of pgettex() wrapper.
Related to T57066, rather unlikely to fix core of the issue, but may
solve crash itself.

Same as rBf22385f28ec8 (did it by mistake in 2.8 first :/ ).
2018-10-24 08:23:14 +02:00
Ray Molenkamp
86dbbd156f Windows: Enable python debugging in Visual Studio.
see D3817 for technical details, and https://wiki.blender.org/wiki/Tools/Debugging/Python_Visual_Studio for a end user quick-start guide.

Differential Revision: https://developer.blender.org/D3817
2018-10-22 10:17:08 -06:00
Lukas Stockner
02e6916890 Cycles: Enable shadow information in requested features when denoising is used
The shadow information isn't only used for shadowcatchers, but also to generate the shadowing feature pass of the denoiser.
2018-10-22 00:14:22 +02:00
Campbell Barton
76f640c27d Cleanup: spelling 2018-10-09 09:29:14 +11:00
Lukas Stockner
7920ebd157 Cycles: Fix NLM denoising kernels zeroing the wrong buffer on OpenCL
Since my temporary buffer commit (about a month ago), the OpenCL device was zeroing the wrong buffer, leading to
completely wrong filtered feature passes and therefore significantly lower-quality results than CPU and CUDA.
2018-10-09 00:14:29 +02:00
Lukas Stockner
7aaeb06fb6 Cycles: Clean up extra minus in previous commit
Forgot to add that change, sorry for the noise.
2018-10-08 22:22:05 +02:00
Lukas Stockner
0234de7d85 Cycles: Reuse existing buffer in the NLM denoising kernels on CPU 2018-10-08 22:17:06 +02:00
Lukas Stockner
15e9d80375 Cycles: Use existing shared temporary memory in reconstruction step of the denoiser
Previously the code allocated its own temporary memory, but it's possible to just use the existing shared one instead.
2018-10-08 22:13:40 +02:00
Lukas Stockner
a0cc7bd961 Cycles: Implement vectorized NLM kernels for faster CPU denoising 2018-10-06 21:49:54 +02:00
Ray Molenkamp
9a674a749b cycles: Support building with cuda 10 on windows. 2018-10-03 10:18:22 -06:00
d05b9e0a2e Fix build with older CMake versions that we still need to support. 2018-10-03 12:55:43 +02:00
d2da3af073 Fix T54287: memory not freed after rendering on Linux.
With new jemalloc versions memory allocated by threads that then become
inactive is not longer automatically freed. Instead we have to enable a
background thread to do it.

Some testing is needed to find out of this is sufficient, because the
background thread only runs periodically.
2018-10-03 12:09:31 +02:00
786870e26f Fix T56909: wrong interface scale on macOS 10.14, when using 10.14 SDK.
This does not affect existing releases as far as I can tell, only new builds
using the new SDK have the problem.
2018-10-01 08:35:32 +02:00
bbd3ac73bc Fix T56396: Cycles wrong object motion blur with deformation blur disabled. 2018-09-30 19:34:34 +02:00
Sergey Sharybin
de3ee3c6e8 Cycles: Fix compilation error of CUDA kernel
Was caused by previous commit.
2018-09-28 15:02:44 +02:00
Sergey Sharybin
b030277e79 Cycles: Fix crash with BVH8 on certain scenes
The crash was caused by BVH traversal stack being overflowed.

That overflow was caused by lots of false-positive intersections
for rays originating on a non-finite location.

Not sure why those rays will be existing in the first place,
this is to be investigated separately.

This commit moves pre-SSE4.1 check to a higher level function
and enables it for all miroarchitectures.
2018-09-28 13:57:50 +02:00
Sergey Sharybin
81f68bbba1 Fix compilation errors and warnings with Clang-6 2018-09-28 09:46:12 +02:00
bd267b0332 Fix cycles_cubin_cc build error on macOS. 2018-09-27 15:59:14 +02:00
e8e2f51063 Fix CUDA build with Xcode 10.0, use nvrtc due to incompatible compilers. 2018-09-27 15:20:33 +02:00
Sergey Sharybin
8f9a6b1bab Cycles: Cleanup 2018-09-27 14:49:37 +02:00
Sergey Sharybin
bee16ec4d8 Cycles: Sync BVH8 unaligned node packing code with BVH4
Similar to dfae3de6bdf.
2018-09-27 14:49:12 +02:00
2a63e062b0 Tests: add --no-window-focus to open window without focus.
This is useful to run OpenGL tests while continuing to do other tasks
without windows constantly popping up in the foreground.
2018-09-27 12:21:48 +02:00
Sergey Sharybin
a5101e4da8 Cycles: Cleanup, double semicolon 2018-09-19 18:41:43 +02:00
a0402074ed Fix wrong CUDA version warning in cmake.
Fix suggested by Dalai.
2018-09-19 16:24:45 +02:00
Campbell Barton
4c918efd44 Cleanup: trailing space 2018-09-19 12:04:34 +10:00
Ray Molenkamp
16b8d223b7 Cycles: Fix usage of AVX2 intrinsics in AVX kernel
While building the AVX kernel, util_avxf.h/avxb.h were using some AVX2 intrinsics,
these were never called, so it wasn't a run-time issue, but the intrinsics headers
on centos excluded the AVX2 prototypes when building the AVX kernel causing build errors.

This commit cleans up the improper usage of the AVX2 intrinsics and provides AVX
fallback implementations for future use.

Differential Revision: https://developer.blender.org/D3696
2018-09-17 16:27:13 -06:00
Sergey Sharybin
284cd1375b Cycles: Cleanup, remove dead code 2018-09-17 18:07:22 +02:00
Sergey Sharybin
81f1f9c85e Cycles: Remove unused malformed function
This isn't really possible to do the shuffle which was attempted to do.

While it's possible to achieve expected behavior, the function needs to
be rewritten. Since it's not used anyway, it's simpler to remove it for
now.
2018-09-17 18:05:32 +02:00
Sergey Sharybin
82e729d986 Cycles: Use proper mask for vectrorized boolean print 2018-09-17 18:02:01 +02:00
Sergey Sharybin
aa844ad676 Cycles: Don't allocate Extra if BSDF allocation failed
Failed as in did not allocate due to possibly weight cutoff.
Tryign to allocated Extra storage for closure in such situation
will consfuse Cycles and cause crashes later one due to obscure
values in ShaderData.
2018-09-12 12:28:55 +02:00
a1651ddc98 Build: require OpenJPEG 2.x minimum, remove bundled version.
* WITH_SYSTEM_OPENJPEG is removed and is now always on, this was already
  the case for macOS and Windows.
* This should not break existing Linx builds. If there is no new enough
  OpenJPEG installed, CMake will no find libopenjp2 and WITH_IMAGE_OPENJPEG
  will be disabled.
* install_deps.sh was updated with new package names, since distributions
  put this version in a new package.

Differential Revision: https://developer.blender.org/D3663
2018-09-11 12:45:05 +02:00
76a4042c23 Fix Cycles principled BSDF black with transmission and IOR 1.0. 2018-09-10 18:50:15 +02:00
a5bb401704 Cleanup: fix compiler warning. 2018-09-06 20:09:13 +02:00
0728c897d7 Fix T56704: black / NaN values in Cycles normal pass. 2018-09-06 20:06:23 +02:00
Mai Lavelle
feb3c74a05 Cycles: Allow cancel during displacement of meshes 2018-09-06 00:25:35 -04:00
Ray Molenkamp
19c7e499e1 cycles: Fix x86 build error.
WITH_CYCLES_CUDA_BINARIES was set as a regular variable causing it to be overwritten by the release.cmake settings.
2018-09-04 16:58:41 -06:00
Alex Fuller
107f1c0a2b Fix Cycles half float pragma for strict OpenCL compilers (like ROCm).
Differential Revision: https://developer.blender.org/D3669
2018-09-03 12:03:56 +02:00
Campbell Barton
0ddf3e110e Cleanup: comment blocks 2018-09-02 18:51:31 +10:00
9492522db5 Fix T56618: crash when typing certain characters on Linux. 2018-08-31 12:43:39 +02:00
Sergey Sharybin
e51f51d55d Cycles: Cleanup, use explicit comparison with NULL 2018-08-31 12:28:12 +02:00
Sergey Sharybin
8ee76535da Fix T56626: Cycles ambient occlusion only local : crash
Was caused by missing NULL pointer check in BVH8.
2018-08-31 12:14:36 +02:00
Sergey Sharybin
94ea566b5a Cycles: Cleanup, whitespace after keyword 2018-08-30 17:34:11 +02:00
Sergey Sharybin
8c3d2e549c Cycles: Fix detection of CPU brand string on 32 bit platforms
The assembler template was backing up and restoring ebx, which is
fair enough. However, this did not prevent compiler for putting
result variables to ebx. This was causing data corruption.

In order to prevent this easiest solution is to list ebx in clobbers
for the assembly.
2018-08-30 12:52:27 +02:00
49041e5611 Fix T56612: crash in Cycles viewport render update, after recent changes.
BVH8 refitting code had a bug.
2018-08-30 12:46:46 +02:00
a1b38a635e Cleanup: license header formatting. 2018-08-30 12:09:47 +02:00
Campbell Barton
76a9752be2 Cleanup: trailing space 2018-08-30 01:05:13 +10:00
ddf8c49736 Fix Cycles CUDA build after recent changes. 2018-08-29 16:35:21 +02:00
a7f5418caa Cleanup: consistent includes. 2018-08-29 16:32:07 +02:00
Sergey Sharybin
b2c707747d CMake: Comply with include path reported by FindOpenGL.cmake
The script clearly states:

  This makes the presumption that you are include al.h like
  #include "al.h"
  and not
  #include <AL/al.h>
  The reason for this is that the latter is not entirely portable.
  Windows/Creative Labs does not by default put their headers in AL/ and
  OS X uses the convention <OpenAL/al.h>.

This commit makes default precompiled OpenAL to be properly detected
and also removes hack on MacOS which was finding the OpenAL package but
then was overwriting include directory.

Note, that new audaspace in 2.8 is using expected #include <al.h>.
2018-08-29 15:08:28 +02:00
Sergey Sharybin
73f2056052 Cycles: Add BVH8 and packeted triangle intersection
This is an initial implementation of BVH8 optimization structure
and packated triangle intersection. The aim is to get faster ray
to scene intersection checks.

    Scene                BVH4      BVH8
barbershop_interior    10:24.94   10:10.74
bmw27                  02:41.25   02:38.83
classroom              08:16.49   07:56.15
fishy_cat              04:24.56   04:17.29
koro                   06:03.06   06:01.45
pavillon_barcelona     09:21.26   09:02.98
victor                 23:39.65   22:53.71

As memory goes, peak usage raises by about 4.7% in a complex
scenes.

Note that BVH8 is disabled when using OSL, this is because OSL
kernel does not get per-microarchitecture optimizations and
hence always considers BVH3 is used.

Original BVH8 patch from Anton Gavrikov.
Batched triangles intersection from Victoria Zhislina.
Extra work and tests and fixes from Maxym Dmytrychenko.
2018-08-29 15:03:09 +02:00
Ray Molenkamp
5e8a030a08 cmake: adjustments required for lib-upgrade on windows. 2018-08-27 19:38:31 -06:00
Colby Klein
31c99c0c4e Fix pen tablet stuck on Windows for some non-Wacom tablets.
Differential Revision: https://developer.blender.org/D3573
2018-08-26 23:19:31 +02:00
Campbell Barton
03fd1da3ee Cleanup: trailing space 2018-08-26 20:20:35 +10:00
Lukas Stockner
94efc651d4 Cycles Denoiser: Allocate a single temporary buffer for the entire denoising process
With small tiles, the repeated allocations on GPUs can actually slow down the denoising quite a lot.
Allocating the buffer just once reduces rendertime for the default cube with 16x16 tiles and denoising on a mobile 1050 from 22.7sec to 14.0sec.
2018-08-25 12:23:52 -07:00
Lukas Stockner
60a5ba265c Cycles: Add Denoising Clean to the debugging denoising passes 2018-08-25 09:32:29 -07:00
Sergey Sharybin
658a9c6cf5 Cycles: Cleanup, style
I wouldn't mind changing style to have space after keyword, but there was
no official code style change proposed.
2018-08-24 14:36:18 +02:00
Sergey Sharybin
e92e90c30e Cycles: Fix wrong looking voronoi of second 2nd closest
Was only happening for release builds made with GCC-8. Probably some
optimization strtegy was confused by uninitialized variable.
2018-08-24 12:29:13 +02:00
Lukas Stockner
b3ac3d13a2 Cycles: Add option for building CUDA kernels sequentially
Building the CUDA kernels takes quite a bit of memory, and when building all of
them the combined usage can be too much on some systems (especially VMs).

Therefore, this patch adds an option to force the build system to build them
sequentially by making each build step depend on the previous kernel.

Reviewers: brecht, sergey

Differential Revision: https://developer.blender.org/D3623
2018-08-22 19:54:59 -07:00
7ffcce8607 Fix Cycles AO pass not working for shadow catcher objects. 2018-08-20 16:09:17 +02:00
Stefan Werner
a9700e7ad2 Fix T56359: Unitialized variable in Cycles OpenCL could cause crashes. 2018-08-14 22:51:53 +02:00
fclem
e20a0798dc Cycles: Append compute units for RX Vega card names
Makes it more clear whether compute device is Vega 56 or Vega 64.
2018-08-09 15:51:23 +02:00
fclem
01feb5d6cc Cycles: Report more details about OpenCL devices 2018-08-09 15:51:23 +02:00
fclem
a241286859 Cycles: Util, add to_string() with some helper
Currently unused, but will allow to convert unknown
argument type to a string for reporting and such.
2018-08-09 15:51:23 +02:00
Campbell Barton
697d4b227e Ghost/X11: correct function signature 2018-08-08 17:54:41 +10:00
Campbell Barton
931a279f44 Cleanup: use static variables 2018-08-08 11:00:57 +10:00
5261cd233c Fix Cycles crash rendering mix of instanced and non-instanced volumes. 2018-08-05 12:05:10 +02:00
e50a3dd4c4 Fix T56197: Cycles OpenCL build error after recent changes. 2018-08-01 19:44:32 +02:00
Campbell Barton
a3085190f8 Fix building w/ FreeBSD
fileno could be a macro which can't take a void pointer.
2018-07-31 20:52:36 +10:00
885cc4cf9a Build: require C11/C++11 for all operating systems in master.
This is in preparation of upgrading our library dependencies, some of which
need C++11. We already use C++11 in blender2.8 and for Windows and macOS, so
this just affects Linux.

On many distributions this will not require any changes, on some
install_deps.sh will need to be run again to rebuild libraries.

Differential Revision: https://developer.blender.org/D3568
2018-07-30 17:12:24 +02:00
Stefan Werner
b59d85b5a5 Cycles: Fixed OpenCL build. sqr(float4) is available on CUDA and CPU, but not on OpenCL. 2018-07-30 15:42:00 +02:00
Stefan Werner
b747524144 Cycles: speed up mesh volume bounds construction.
Patch by Stefan, with minor tweaks by Brecht.
2018-07-28 19:23:35 +02:00
Lukas Stockner
bcefb202a2 Cycles: Save a few instructions in area light sampling
Just basic algebra - because all vectors have the same z coordinate, a lot of terms end up cancelling out.

Not exactly a massive improvement, but it's measurable with Branched PT and a high sample count on the lamp.

Reviewers: brecht, sergey

Reviewed By: brecht

Subscribers: swerner

Differential Revision: https://developer.blender.org/D3540
2018-07-27 23:42:50 +02:00
Sergey Sharybin
84d47e3685 Cycles: Initial implementation of detailed statistics
Gathers information about object geometry and textures. Very basic at
this moment, but need to start somewhere.

Things which needs to be included still:

- "Runtime" information, like BVH. While it is not directly controllable
  by artists, it's still important to know.

- Device array sizes. Again, not under artists control, but is added to
  the overall size.

- Memory peak at different synchronization stages.

At this point it simply prints info to the stdout after F12 is done,
need better control over that too.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D3566
2018-07-27 17:19:54 +02:00