Commit Graph

5715 Commits

Author SHA1 Message Date
Brecht Van Lommel
394a1373a0 Cycles: use OpenCL C 2.0 if available, to improve performance for AMD
Tested with AMD Radeon Pro WX 9100, where it brings performance back to 2.80
level, and combined with recent changes is about 2-15% faster than 2.80 in
our benchmark scenes.

This somehow appears to specifically address the issue where adding more shader
nodes leads to slower runtime. I found no additional speedup by applying this
to change to 2.80 or removing the new shader node code.

Ref T71479

Patch by Jeroen Bakker.

Differential Revision: https://developer.blender.org/D6252
2020-03-24 20:09:36 +01:00
Brecht Van Lommel
5801a016d4 Cycles: slightly improve OpenCL performance by reordering SVM enum values
Ref T71479
2020-03-24 16:49:46 +01:00
Brecht Van Lommel
2bec6f1f06 Cycles: work around OpenCL performance regression after AOVs and vector rotate
We appear to be hitting some limit where adding any amount of code causes a
significant performance regression, no matter what it does. To work around
that a new node level was added.

Ref T71479
2020-03-24 16:49:46 +01:00
Brecht Van Lommel
f8a4fb43fb Cleanup: remove unused Cycles kernel feature flags, replace by node levels 2020-03-24 16:49:46 +01:00
Ray Molenkamp
44c6b6615b OpenCL: Bring back CYCLES_OPENCL_TEST override
Back in 2.79 you could either use the debug panel or an
environment variable to override using OpenCL for unsupported
hardware. Which was rather useful for developers when testing
on NVidia just to be sure the CL kernels at-least build properly.

This broke in rB949ab753bb2

This diff restores testing though the CYCLES_OPENCL_TEST
environment variable.

Differential Revision: https://developer.blender.org/D7202

Reviewers: brecht
2020-03-21 11:55:45 -06:00
Brecht Van Lommel
3033b2a044 Fix T73372: cryptomatte not filling last pass for odd number of levels
Make logic consistent with the render pass creation in Python.
2020-03-21 15:04:12 +01:00
Brecht Van Lommel
6777956005 Fix T68370, T74973: Cycles cryptomatte not working when other passes are enabled
Solution found by Blazej Floch.
2020-03-20 15:59:24 +01:00
Brecht Van Lommel
db65a6e0fb Fix T74345: missing albedo for Cycles principled hair BSDF 2020-03-20 15:23:39 +01:00
Brecht Van Lommel
0127e8522a Fix Python error in Cycles baking panel 2020-03-20 14:25:16 +01:00
Brecht Van Lommel
4b74b35322 Fix Cycles crash in Windows debug mode with volumes 2020-03-19 20:02:33 +01:00
Dalai Felinto
2d1cce8331 Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
Brecht Van Lommel
6bfe7c7a02 Fix (harmless) use of uninitialized variables in Cycles 2020-03-18 19:51:54 +01:00
Brecht Van Lommel
7537cad576 Volumes: add render settings for volume datablock
* Space: volume density and step size in object or world space
* Step Size: override automatic step size
* Clipping: values below this are ignored for tighter volume bounds

The last two are Cycles only currently.

Ref T73201
2020-03-18 11:23:05 +01:00
Brecht Van Lommel
1162ba206d Cycles: change volume step size controls, auto adjust based on voxel size
By default it will now set the step size to the voxel size for smoke and
volume objects, and 1/10th the bounding box for procedural volume shaders.

New settings are:
* Scene render/preview step rate: to globally adjust detail and performance
* Material step rate: multiplied with auto detected per-object step size
* World step size: distance to steo for world shader

Differential Revision: https://developer.blender.org/D1777
2020-03-18 11:23:05 +01:00
Brecht Van Lommel
9d20f170c7 Cycles: support for rendering of new Hair object prototype
Ref T68981
2020-03-18 11:23:05 +01:00
Brecht Van Lommel
994eb1ec17 Cycles: support rendering new Volume object type
Voxels are loaded directly from the OpenVDB grid. Rendering still only supports
dense grid, so memory usage is not great for sparse volumes, this is to be
addressed in the future.

Ref T73201
2020-03-18 11:23:05 +01:00
Brecht Van Lommel
006025ead0 Cycles: support for different 3D transform per volume grid
This is not yet fully supported by automatic volume bounds but works fine in
most cases that will have mostly matching bounds.

Ref T73201
2020-03-18 11:23:05 +01:00
Brecht Van Lommel
1504cb26b0 Cleanup: process colorspace conversion with a 1D pixel array
No need to assume it's 2D or 3D.
2020-03-17 17:33:08 +01:00
Sergey Sharybin
f0856b1fda Cycles: Fix bad escape character used for dot 2020-03-16 16:17:13 +01:00
Brecht Van Lommel
215e474a99 Fix T74776: Cycles crash with missing image texture after recent changes 2020-03-16 16:02:06 +01:00
William Reynish
20f6700c88 UI: Show decorators for lights when using Cycles
This matches Eevee, and also the rest of Blender.
2020-03-16 14:32:09 +01:00
Brecht Van Lommel
472534d16e Fix memory leak in recent Cycles image texture refactor 2020-03-12 20:30:49 +01:00
Brecht Van Lommel
26bea849cf Cleanup: add device_texture for images, distinct from other global memory
There was too much image texture specific stuff in device_memory, and too
much code duplication between devices.
2020-03-12 17:28:55 +01:00
Brecht Van Lommel
75be60a667 Fix build error with recent OpenImageIO versions 2020-03-12 17:19:57 +01:00
Campbell Barton
1aebcdbb3a Cleanup: spelling, clang-format 2020-03-12 12:34:54 +11:00
Brecht Van Lommel
e6d0a438ab Fix T73626: crash scrubbing timeline with Cycles viewport and smoke/fire 2020-03-11 20:45:39 +01:00
Brecht Van Lommel
6cf4861c3a Cleanup: refactor image loading to use abstract ImageLoader base class
Rather than passing around void pointers, various Blender image sources now
subclass this. OIIO is also just another type of image loader.

Also fixes T67718: Cycles viewport render crash editing point density settings
2020-03-11 20:45:39 +01:00
Brecht Van Lommel
d8aa613d94 Cleanup: add ImageHandle to centralize image ownership logic 2020-03-11 20:35:38 +01:00
Brecht Van Lommel
ec3eeee46b Cycles: add internal default volume shader, to be used for new volume object
This is mostly straightforward, but required some refactoring to ensure that
the default volume material does not always turn on the volume feature for GPU
rendering.
2020-03-11 20:35:38 +01:00
Brecht Van Lommel
5a169ae2f3 Cleanup: remove foreach include from header, conflicts with OpenVDB 2020-03-11 20:35:38 +01:00
Brecht Van Lommel
21821601f2 Fix Optix build error on Linux with some compilers 2020-03-11 20:35:38 +01:00
Giovanni Remigi
19b46b2fca Fix Cycles crash in BVH8 build due to out of bounds memory access
Differential Revision: https://developer.blender.org/D7114
2020-03-11 17:35:11 +01:00
Brecht Van Lommel
f01bc597a8 Cleanup: stop encoding image data type in slot index
This is legacy code from when we had a fixed number of textures.
2020-03-11 17:07:17 +01:00
Brecht Van Lommel
9910803574 Fix Cycles link error with debug + asan after RTTI changes 2020-03-11 17:05:15 +01:00
Brecht Van Lommel
c4beb518de Cycles: disable RTTI only for OSL files, other libraries like OpenVDB need it
This is a bit weak since it's not entirely clear where the boundary is, but
tested to build and pass tests on all platforms.
2020-03-11 14:42:46 +01:00
Brecht Van Lommel
5cb2861420 Fix Cycles incorrect result when compressing some 8 bit log colorspace images
Don't clamp and do premultiply after color space conversion.
2020-03-11 12:59:29 +01:00
Brecht Van Lommel
796683db8e Cycles: add view layer setting to exclude volumes, like hair and surfaces 2020-03-11 11:25:57 +01:00
Brecht Van Lommel
b70a13fb66 UI: show more digits for adaptive sampling noise threshold 2020-03-11 10:54:28 +01:00
Campbell Barton
d195deef5c Cleanup: clang-format 2020-03-11 19:23:52 +11:00
Stefan Werner
7c027f9480 Cycles: Fixed Shadow and Mist passes with adaptive sampling.
This also fixes a side-effect where turning on UV pass but leaving
Shadow pass turned off destroyed the Combined pass.
2020-03-10 16:50:51 +01:00
Stefan Werner
811569dc11 Cycles: Using OpenCL popcount() in PMJ sampler. 2020-03-10 08:53:30 +01:00
Johan Walles
8bc8713beb Cleanup: avoid (harmless) race condition reported by Helgrind
Differential Revision: https://developer.blender.org/D7058
2020-03-09 17:11:24 +01:00
Stefan Werner
bc6bbe5fac Fix T74537: Fixed out of bounds memory access in Cycles' PMJ sampler. 2020-03-08 21:31:47 +01:00
Brecht Van Lommel
946d39f688 UI: move Cycles adaptive sampling settings to own subpanel 2020-03-07 12:40:06 +01:00
Brecht Van Lommel
dcdcc23488 Fix T74504: Cycles wrong progress bar with CPU adaptive sampling 2020-03-06 23:46:58 +01:00
Brecht Van Lommel
b31b44c223 Fix error in Cycles Optix adaptive sampling after recent cleanup 2020-03-06 23:46:58 +01:00
Dalai Felinto
c60366c01f Cycles: cleanup warning 2020-03-06 15:27:50 +01:00
Brecht Van Lommel
c8ac760c59 Cleanup: tweak Cycles #includes in preparation for clang-format sorting 2020-03-06 14:44:42 +01:00
Campbell Barton
8574d68aa0 Cleanup: spelling 2020-03-06 11:52:32 +11:00
Patrick Mours
88db9a17ce Fix T74393: Cycles crashes when both OSL and Optix Denoising are enabled
Enabling viewport denoising causes Cycles to use a multi-device, which always returned NULL when
asked for OSL memory and would subsequently crash. This fixes that by returning the correct OSL
memory pointer from the CPU device in the special viewport denoising multi-device.
2020-03-05 16:28:31 +01:00