Commit Graph

10351 Commits

Author SHA1 Message Date
Patrick Mours
f4f8b6dde3 Cycles: Change device-only memory to actually only allocate on the device
This patch changes the `MEM_DEVICE_ONLY` type to only allocate on the device and fail if
that is not possible anymore because out-of-memory (since OptiX acceleration structures may
not be allocated in host memory). It also fixes high peak memory usage during OptiX
acceleration structure building.

Reviewed By: brecht

Maniphest Tasks: T85985

Differential Revision: https://developer.blender.org/D10535
2021-03-11 14:12:35 +01:00
Brecht Van Lommel
eb20250d2a Fix wrong white point of Linear ACES in config reading and the bundled config
The Blender/Cycles XYZ color space has a D65 white point instead of E, and
this was not correctly accounted for both in the OpenColor config reading code
and the bundled config.

This meant that since the OpenColorIO v2 upgrade, the Linear ACES color space
was not working correctly, and other OpenColorIO configs defining
aces_interchange were not interpreted correctly.
2021-03-10 16:56:27 +01:00
Corbin Dunn
4069016de8 macOS/Ghost: Simplify pasteboard and screen count code
Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:47 +05:30
Corbin Dunn
9d046019e2 macOS/Ghost: Remove unnecessary nil checks.
Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:44 +05:30
Corbin Dunn
cd1e6df534 macOS/Ghost: Replace NSAutoreleasePool with @autoreleasepool
- Automatic and guaranteed cleanup.
- Improves readability and reduces chances of errors by removing
`[pool drain]` statements.

Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10616
2021-03-09 21:38:41 +05:30
Brecht Van Lommel
3669a3e2e9 Fix Cycles CUDA build error with Visual Studio 2019 v16.9
Something in this update broke the floor() function in CUDA, instead use
floorf() like we do everywhere else in the kernel code. Thanks to Ray
Molenkamp for identifying the solution.
2021-03-08 14:06:16 +01:00
Kévin Dietrich
9c8382e618 Cleanup: do not pass class member to class methods 2021-03-07 17:22:00 +01:00
Kévin Dietrich
00f218602d Alembic procedural: fix missing update when only the transforms change
The missing update has two sources:

The TimeSampling used for looking up transformations in the cache was
uninitialized. To fix this, simply use the TimeSampling from the last
transformation in the hierarchy (that is the object's parent), which
should also contain the time information for all of its parents.

The objects are not tagged for update when their trasformations change.
2021-03-07 17:16:16 +01:00
Kévin Dietrich
ac4d45dbf1 Alembic procedural: fix infinite update loop when modifying Object level properties 2021-03-07 17:16:16 +01:00
Sergey Sharybin
0dd9a4a576 Cleanup: Libmv, clang-format
Is based on Google style which was used in the Libmv project before,
but is now consistently applied for the sources of the library itself
and to C-API. With some time C-API will likely be removed, and it
makes it easier to make it follow Libmv style, hence the diversion
from Blender's style.

There are quite some exceptions (clang-format off) in the code around
Eigen matrix initialization. It is rather annoying, and there could be
some neat way to make initialization readable without such exception.

Could be some places where loss of readability in matrix initialization
got lost as the change is quite big. If this has happened it is easier
to address readability once actually working on the code.

This change allowed to spot some missing header guards, so that's nice.

Doing it in bundled version, as the upstream library needs to have some
of the recent development ported over from bundle to upstream.

There should be no functional changes.
2021-03-05 15:05:08 +01:00
Campbell Barton
aa86710242 Cleanup: spelling 2021-03-05 14:44:28 +11:00
Campbell Barton
b9833860e5 Cleanup: maintain include order without disabling clang format 2021-03-05 14:08:00 +11:00
Harley Acheson
97fabc3c1c Fix T86185: Win32 Multiple Monitor Window Position
Because of D10469 we can now not force child windows onto parent's monitor and allow them to go where they wish.

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

Reviewed by Ray Molenkamp
2021-03-04 17:54:46 -08:00
Jacob Møller
57812c7e4f Windows/CLog: Support color logging on Win 10
Windows 10 supports V100 on all consoles given
you enable the ENABLE_VIRTUAL_TERMINAL_PROCESSING
flag for the console.

This patch enables color logging only on windows
10 and only if the log is not being redirected
to a file.

Differential Revision: https://developer.blender.org/D10546
2021-03-04 18:20:52 -07:00
Corbin Dunn
d09b874244 macOS/Ghost: Opt out of AppKit’s automatic window tabbing
Since Blender is single-tabbed, this will prevent extraneous
tab-related options from appearing in "Window" menu in case AppKit's
internals change.

Reviewed By: #platform_macos, sebbas, ankitm
Differential Revision: https://developer.blender.org/D10606
2021-03-04 21:53:27 +05:30
Corbin Dunn
93cdf461f3 macOS/Ghost: Remove redundant nil check after initWithContentRect
AppKit’s NSWindow.h has NS_ASSUME_NONNULL_BEGIN, and only methods/
properties explicitly marked nullable will ever return nil.

Reviewed By: #platform_macos, sebbas
Differential Revision: https://developer.blender.org/D10603
2021-03-03 21:26:09 +05:30
Corbin Dunn
87c949a3bd macOS/Ghost: Fix memory leak.
`new` allocates a new object that needs to be autoreleased.

Reviewed By: #platform_macos, sebbas, ankitm
Maniphest Tasks: T86222
Differential Revision: https://developer.blender.org/D10597
2021-03-03 21:25:20 +05:30
Campbell Barton
6aec6568a0 Cleanup: spelling, minor corrections
Also use doxygen comments for sculpt functions.
2021-03-03 06:20:27 +11:00
Sergey Sharybin
aeb7bc5beb GLog: Lower default logging severity to INFO
Before this change messages of ERROR and above were printed.
This change makes it so LOG(INFO), LOG(WARNING), LOG(ERROR)
and LOG(FATAL) will be printed to the console by default
(without --debug-libmv and --debug-cycles).

On a user level nothing is changed because neither INFO nor
WARNING severity are used in our codebase. For developers this
change allows to use LOG(INFO) to print relevant for debugging
information. Bering able to see WARNING messages is also nice,
since those are not related to debugging, but are about some
detected "bad" state.

After this change the LOG(INFO) is really treated as a printf.
Why not to use printf to begin with? Because it is often more
annoying to print non-scalar types. Why not to use cout? Just
a convenience, so that all type of logging is handled in the
same way. When one is familiar with Glog used in the area, it
is easy to use same utilities during development. Also, it is
easy to change LOG(INFO) to VLOG(2) when development is done
and one wants to keep the log print but make it only appear
when using special verbosity flags.

The initial reason why default severity was set to maximum
possible value is because of misuse of VLOG with verbosity
level 0, which is the same as LOG(INFO). This is also why
back in the days --debug-libmv was introduced.

Now there is some redundancy between --debug-libmv, --debug-cyles
and --verbose, but changes in their meaning will cause user
level side effects.

Differential Revision: https://developer.blender.org/D10513
2021-03-01 16:56:34 +01:00
Sergey Sharybin
ea95ea644a Libmv: Avoid use of LOG(INFO) in solver
Usage of LOG(INFO) actually went against own guidelines in the
logging.h: the INFO is for messages which are to be printed
regardless of debug/verbosity settings.
2021-03-01 16:54:14 +01:00
Brecht Van Lommel
5da418d4e6 Fix Cycles build error without Embree on Windows
Don't use ssize_t, it's not available in MSVC.
2021-03-01 16:33:31 +01:00
Campbell Barton
fc08fe82ae Cleanup: spelling 2021-03-01 11:00:22 +11:00
Kévin Dietrich
5c6cd5f8cd Cleanup: unused class member 2021-02-26 20:57:24 +01:00
Kévin Dietrich
72370b92be Fix T85926: Cycles missing viewport updates when making materials single user
This issue seems to be caused by the reallocation flag not being set on
the device shader data array so it was never updated on the GPU although
the host memory was modified.
2021-02-25 02:18:02 +01:00
Ray Molenkamp
4fb0c83c1c Cmake/deps: Update OSL to 1.11.10.0
This bumps OSL to 1.11.10.0. OSL Has a new build time
dependency: Clang, and more importantly it expects
clang and llvm to share a library folder, which it
previously for us did not.

This patch changes:

-OSL Update to 1.11.10.0

-refactor the llvm/clang/clang-tools-extra builds into the llvm
 build using the llvm-project tarball for building that has all
 of the subprojects in it.

-update ispc/openmp builds since clang no longer its own dependency
 and they have to depend on the llvm build now.

-Update the windows builder to use the 64 bit host tools since it
 ran out of ram linking clang

-Since OSL now needs clang to link successfully a findclang.cmake
 has been provided for linux/OSX

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

Reviewed By: brecht, sebbas, sybren
2021-02-24 07:13:37 -07:00
Nicholas Rishel
eb554051e7 Revert Automatic Tablet API dynamic fallback.
Removes fallback to Windows Ink when Wintab reports no devices present.
Returns to old behavior of using only Wintab if Wintab.dll exists.
2021-02-23 13:29:59 -08:00
Nicholas Rishel
ee4f306509 Fix T85844: high pressure at start of line.
m_tabletInRange is no longer set for Wintab after 2e81f2c01abd21fdbc
reverted Wintab changes. This reverts most button processing to
behavior present in 2.91.2.

Left in place is a bugfix for Windows Ink: button events while a
Windows Ink pen is in range should still be processed. Events processed
by Windows Ink and not passed to DefWindowProc do not create WM_*BUTTON
events, but button events from e.g. tablet pad express keys do create
WM_*BUTTON events and should be handled.
2021-02-23 13:29:59 -08:00
Nicholas Rishel
f227a69a87 Revert high fequency mouse input for Windows.
Windows mouse history function GetMouesMovePointsEx has well documented
bugs where it receives and returns 32 bit screen coordinates, but
internally truncates to unsigned 16 bits. For mouse (relative position)
input this is not a problem as motion events and the resulting screen
coordinates reliably fit within 16 bit precision.

For tablets (absolute position) the 16 bit truncation results in
corrupt history when tablet drivers use mouse_event or SendInput from
the Windows API to move the mouse cursor. Both of these functions take
absolute mouse position as singed 32 bit value on the range of 0-65535
(or 0x0-0xFFFF) inclusive. Values larger than 0x7FFF (the largest
signed 16 bit value) are reliably corrupt when retrieved from
GetMouesMovePointsEx history. This is true regardless of whether mouse
history is retrieved using display resolution (GMMP_USE_DISPLAY_POINTS)
or high resolution points (GMMP_USE_HIGH_RESOLUTION_POINTS), the latter
of which should return points in range 0-65535.

Reviewed By: brecht

Maniphest Tasks: T85874

Differential Revision: https://developer.blender.org/D10507
2021-02-23 13:29:51 -08:00
Nicholas Rishel
8d02fdc7e0 WM_MOUSEMOVE cleanup. 2021-02-23 11:47:53 -08:00
Patrick Mours
b2e1b13abd Cycles: Add option to change input passes for viewport denoising
There are cases where the default input passes of color+albedo do not yield useful results
and while this was possible to change that for final frame rendering (in the layer settings),
viewport denoising always used a fixed color+albedo. This adds an option to change the
input passes for viewport denoising too, so that one can use it in scenes that otherwise
wouldn't work well with it.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D10404
2021-02-23 11:45:02 +01:00
Kévin Dietrich
82605093e9 Alembic procedural: avoid storing constant hair topology for each frame
Only store the curve keys and radiuses for each frame if the topology does not change through time, this helps saving quit a bit of memory.
2021-02-23 06:06:54 +01:00
Kévin Dietrich
87ef037459 Alembic procedural: cleanup, demultiply Object and Geometry Node
creation
2021-02-23 06:06:50 +01:00
Kévin Dietrich
3d5e290ee0 Alembic procedural: use an enumeration to discriminate IObjects
Using the various IObject::matches() to do so was expensive and would
show up in profiles as requires creating std::strings for each call.
2021-02-23 05:31:34 +01:00
Kévin Dietrich
d9abcee47e Alembic procedural: fix crash when accessing data out of frame bounds 2021-02-23 05:16:49 +01:00
Harley Acheson
beb1f1b805 Win32: Do not (yet) set window styles for Dialog
Remove the setting of Dialog window styles until we confirm expected behavior between platforms.

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

Own Code
2021-02-22 12:46:45 -08:00
Pascal Schön
277b4f4b93 Fix Principled BSDF specular color for black base color
Specular color is set to black instead of white inside the Principled BSDF
when the base color is set to fully black. This is contradictory to the sample
code of the Disney BRDF in BRDF Explorer. This patch aligns both
implementations.

Differential Revision: https://developer.blender.org/D10448
2021-02-22 18:33:05 +01:00
Harley Acheson
46bdf6d59f Fix T85768: Win32 Full-Screen Owned Windows
Improvements to how window states are determined and changed.

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

Reviewed by Brecht Van Lommel
2021-02-22 09:32:15 -08:00
Brecht Van Lommel
af940c68cb Fix Cycles world volume scattering missing light in some cases
With very large distances there were precision / overflow errors, normalize
the average albedo to avoid that. This was causing test failures on macOS
Arm, but also other architectures had slightly wrong results.

Ref T78710
2021-02-22 00:22:20 +01:00
Campbell Barton
08dbc4f996 PyAPI: use postponed annotations to support Python 3.10
Support Python 3.10a5 or 3.9x with support explicitly enabled.

- Enable Python's postponed annotations for Blender's RNA classes
  types registered on startup.

- Using postponed annotations has implications for how they are defined,
  since they must evaluate in the modules name-space instead of the
  classes name-space. See changes to annotations in `release/scripts`.

- Use `from __future__ import annotations` at the top of the module
  to ensure the script will run with Python 3.10.

- Old logic is kept since it could be used if PEP-649 is supported.

Resolves T83626

Ref D10474
2021-02-21 22:37:53 +11:00
Jacques Lucke
5dced2a063 Geometry Nodes: expose float2 attribute in rna
This also fixes the issue reported in T85651.

Differential Revision: https://developer.blender.org/D10477
2021-02-20 11:33:43 +01:00
Campbell Barton
7bb2b910c0 Cleanup: doxygen sections 2021-02-20 15:35:00 +11:00
Campbell Barton
7e11595364 Cleanup: clang-format 2021-02-19 02:19:53 +11:00
Campbell Barton
10a54bbd06 Cleanup: spelling, correct doc-string arguments 2021-02-19 02:19:53 +11:00
Ray Molenkamp
74383a332b Cleanup: Fix unused variable warning
exception was not used and can be safely removed
2021-02-18 08:09:08 -07:00
Ray Molenkamp
8095aad47e Cycles: Fix build error on windows
Function __bsf was in util/util_simd.h twice

problem located by @EAW on chat.
2021-02-17 10:21:00 -07:00
Brecht Van Lommel
4d28a1d75f Fix OpenColorIO 2.0 GPU shader error in uniform assignment
And fix a (harmless) compiler warning.
2021-02-17 18:03:52 +01:00
Brecht Van Lommel
351d8bfc41 Fix T85694: Cycles incorrect grayscale conversion with some OpenColorIO configs 2021-02-17 16:26:24 +01:00
Brecht Van Lommel
0e9497e886 Cycles: add support for Arm Neon instructions using sse2neon
Based on patch contributed by Apple and Stefan Werner.

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
Brecht Van Lommel
68dd7617d7 Cycles: add utility functions for zero float2/float3/float4/transform
Ref D8237, T78710
2021-02-17 16:26:24 +01:00
Brecht Van Lommel
8119f0aad2 Cycles: refactor intrinsic functions implementation
* Add processor independent fallbacks
* Use uint32_t and uint64_t types
* Remove unused functions
* Better comments and less indentation

Ref D8237, T78710
2021-02-17 16:26:24 +01:00