Commit Graph

5518 Commits

Author SHA1 Message Date
Sergey Sharybin
99da8e1ed8 Cycles: Fix viewport rendering with multiple GPU devices 2015-12-31 17:49:25 +05:00
Sergey Sharybin
0b4abd08b3 Cycles: Experiment with use of runtime tag instead of set for SVM generation
This gives about 2x speedup (3.2sec vs. 11.9sec with 32716 handled nodes) when
updating shader for the shader tree.

Reviewers: brecht, juicyfruit, dingto, lukasstockner97

Differential Revision: https://developer.blender.org/D1700
2015-12-31 15:58:18 +05:00
cf2005d942 Fix T47081: laplacian smooth edit mode tool crash. 2015-12-30 17:26:51 +01:00
Sergey Sharybin
f5c978074c Cycles: Code cleanup: use scoped timer to measure parts of SVM compiler 2015-12-30 19:35:21 +05:00
Sergey Sharybin
4d2eb42cfd Cycles: Wrap SVM compiler state variables into a single struct
This way it's easier to pass stuff around and also much easier to add more
state variables.

So far should be no functional changes for artists.
2015-12-30 19:21:19 +05:00
Sergey Sharybin
3918c8b9a5 Cycles: Optionally output luminance from the shader evaluation kernel
This makes it possible to move some parts of evaluation from host to the device
and hopefully reduce memory usage by avoid having full RGBA buffer on the host.

Reviewers: juicyfruit, lukasstockner97, brecht

Reviewed By: lukasstockner97, brecht

Differential Revision: https://developer.blender.org/D1702
2015-12-30 19:04:04 +05:00
Sergey Sharybin
c8a551bf13 Cycles: Don't install CPU-related kernel files 2015-12-30 18:51:35 +05:00
Sergey Sharybin
2b5d60eb2d Cycles: Deduplicte CPU kernel declaration and definition code
Main goal is to make kernel signatures editing easier and less prone to the
errors caused by missing function signature update or so.

This will also make it easier to add new CPU architectures.

Reviewers: juicyfruit, dingto, lukasstockner97, brecht

Reviewed By: dingto, lukasstockner97, brecht

Differential Revision: https://developer.blender.org/D1703
2015-12-30 17:54:02 +05:00
Thomas Szepe
2583cc88de Fix Moto overflow warnings
This fault (level 2, C4056) was introduced by changing Moto from double to float.
2015-12-30 12:45:36 +01:00
Martijn Berger
939dd2e168 Skip some more workarounds when using MSVC 2015 2015-12-30 11:23:10 +01:00
Sergey Sharybin
a6b67ca802 Cycles: Add timing information to the SVM compiler stats 2015-12-29 21:20:10 +05:00
Sergey Sharybin
aff9fd60bc Cycles: Optimize nodes deduplication routines
The idea is to have separate sets per node name in order to speed up the
comparison process. This will use a bit more memory and slow down simple
shaders, but this extra memory is not so much huge and time penalty is
not really measurable (at least from initial tests).

This saves orders of magnitude seconds when de-duplicating 17K nodes and
overall process now takes 0.01sec on my laptop,
2015-12-29 20:27:00 +05:00
Sergey Sharybin
3482cdb136 Cycles: Remove assert which is no longer valid
Was a left-over since 5b33115.
2015-12-29 19:19:53 +05:00
d1a26437ef OS X: remove code for OS X <= 10.5, which is already not supported since 2 years. 2015-12-29 00:27:18 +01:00
Sergey Sharybin
1a246afe03 Cycles: Use different approach for SVM summary report
Use Summary structure to collect all summary related on the shader compilation
process which then could be either simply reported to the log or be passed to
some user interface or so.

This is type of the summary / report which is most flexible and useful and
something we could use for other parts like shader optimization.
2015-12-28 19:42:37 +05:00
Sergey Sharybin
0ae2ade17a Cycles; Fix typo in the comment 2015-12-28 19:01:26 +05:00
Sergey Sharybin
18ccc6f960 Cycles: Log basic statistics of SVM compilation process 2015-12-28 19:01:07 +05:00
Sergey Sharybin
738f6d8127 Cycles: Implement node deduplication routines
The idea of this commit is to merge nodes which has identical settings
and matching inputs into a single node in order to minimize number of
SVM instructions.

This is quite simple bottom-top graph traversal and the trickiest part
is how to compare node settings without too much trouble which seems to
be solved is quite clean way.

Still possibilities for further improvements:

- Support comparison of BSDF nodes
- Support comparison of volume nodes
- Support comparison of curve mapping/ramp nodes

Reviewers: brecht, juicyfruit, dingto

Differential Revision: https://developer.blender.org/D1673
2015-12-28 16:37:48 +05:00
Campbell Barton
225b02fcd6 Fix for building ghost-tests 2015-12-28 21:40:49 +11:00
Kévin Dietrich
7ef10decdb Fix for heap-use-after-free happening in GHOST_EventManager.
Issue was that dispatchEvent might call removeWindowEvents/
removeTypeEvents which will delete the event before we can do so.

To address this, handled events are now put in a separate list.

Reported by psy-fi and reviewed by brecht in IRC.
2015-12-28 00:35:47 +01:00
Kévin Dietrich
c4c3d84d58 Addendum to previous GHOST commit: remove redundant check. 2015-12-27 21:32:19 +01:00
Kévin Dietrich
3e35e32e9d Fix memory leak in GHOST Event Manager.
The events are allocated on the heap, then pushed on a stack. Before
being processed, they are popped from the stack, and deleted after
processing is done. When the manager is destroyed (e.g. application
closing), any remaining event in the stack is detroyed.

Issue is that when the "application closing" event is processed, it is
never freed, because the manager gets destroyed before the call to
`delete` is made and the event is not on the stack anymore.

Now events are left on the stack while they are processed, and only
popped and deleted after processing is done.

As a slight bonus refactor: use void as return type for dispatch events
functions, as no caller is checking the return value, and it is not
clear what it means (suggested by the reviewer).

Reviewers: brecht

Differential Revision: https://developer.blender.org/D1695
2015-12-27 18:08:44 +01:00
Jörg Müller
fcc68a02e9 Fix T47064: Change Audio defaults to 48 kHz
Historically blender had an audio sample rate of 44.1 kHz as default which is mostly popular because it's the sample rate of audio CDs. Audaspace kept using this default from the pre 2.5 era. It was about time to change to 48 kHz, which is a more widespread standard nowadays, especially in video. It is the recommended sampling rate of the Audio Engineering Society.

Further reading: https://en.wikipedia.org/wiki/44,100_Hz#Status
2015-12-27 16:33:54 +01:00
Thomas Dinges
83addc0a1d Cleanup: SubsurfaceScatteringNode is a subclass of BsdfNode, no need to set the value again. 2015-12-25 11:58:52 +01:00
Lukas Stockner
8e07b87866 Cycles: Fix Tile access in the TileManager for viewport rendering
- When rendering in the Viewport, next_tile is sometimes called after a reset has been performed, but before
  new tiles were generated. In that case, the tile list would be invalid, causing Blender to crash randomly.
- When generating new tiles, the TileManager would not clear the tile lists before re-generating them, leading
  to some tiles being skipped during viewport rendering.
- When popping the next tile from a tile list, a reference to the just-deleted object would be returned, now the
  object is copied before deleting it.
2015-12-24 01:42:59 +01:00
Thomas Dinges
059b7a81e2 Cycles: Implement constant fold for the ConvertNode.
This way socket type conversions (such as color to float, or float to vector) do not stop the folding process.
Example: http://www.pasteall.org/pic/show.php?id=96803 (selected nodes are folded).
2015-12-23 21:48:19 +01:00
Lukas Stockner
548eb9eb4b Cycles: Sort tiles in rendering order at construction time
This commit modifies the TileManager to sort render tiles once after tiling the image,
instead of searching the next tile every time a new tile is acquired by a device.

This makes acquiring a tile run in constant time, therefore the render time is linear
w.r.t. the amount of tiles, instead of the quadratic dependency before.

Furthermore, each (logical) device now has its own Tile list, which makes acquiring
a tile for a specific device easier.
Also, some code in the TileManager was deduplicated.

Reviewers: dingto, sergey

Differential Revision: https://developer.blender.org/D1684
2015-12-23 13:14:36 +01:00
Thomas Dinges
887829e3d8 Cleanup: Remove comments, now that we have the dedicated constant fold functions, it's obvious. 2015-12-22 14:02:57 +01:00
Thomas Dinges
377b52be2e Cycles: Constant fold for the Gamma Node. 2015-12-22 13:53:13 +01:00
Campbell Barton
32be51dc66 Cleanup: warnings (msvc)
Part of patch D1670 by @LazyDodo
2015-12-21 13:02:38 +11:00
Sergey Sharybin
82921ce420 OpenSubdiv: Avoid having bad-level call
This is always asking for problems. Additionally, that call was leading
to OpenGL calls happening from threads.
2015-12-18 23:16:52 +05:00
Sergey Sharybin
672f2efbe6 Cycles: Log OSL texture system statistics after finishing the render 2015-12-18 21:50:30 +05:00
Sergey Sharybin
349affe370 Cycles: Implement proper texture derivatives evaluation for OSL
This was an oldie TODO since initial work on newer OSL/OIIO support.
Now we should be ready for the libraries bump.
2015-12-18 21:50:30 +05:00
Jorge Bernal
ee59df521f BGE clean up: use float version of trigonometric functions 2015-12-16 01:53:48 +01:00
Sergey Sharybin
5b33115070 Cycles: Fix wrong assert failure happening after recent de-duplicate
This is actually intended behavior to return NULL when the socket is not
found. It's used in certain BSDF nodes to query whether some inputs exists
or not.

Perhaps we can be more explicit here and have dedicated logic to query
socket existance and keep assert in place.

In any case, even if we lost assert() for the constant fold now it's
still somewhat better than duplicated code. Perhaps.
2015-12-15 21:01:56 +05:00
Sergey Sharybin
baaf10cb26 Cycles: De-duplicate utility functions in ccl::Graph 2015-12-15 20:04:35 +05:00
Ines Almeida
46218dc9f9 Fix: unreported crash with misconfigured nvidia opengl drivers 2015-12-13 10:36:52 +00:00
Jorge Bernal
0dcca69589 Moto Clean-up: double-promotion warnings 2015-12-13 02:56:30 +01:00
Porteries Tristan
6329e20cbb BGE: Use float as default instead of double in Moto library.
Use float in moto instead of double for MT_Scalar.
This switch allow future optimization like SSE.
Additionally, it changes the OpenGL calls to float versions as they are
very bad with doubles.

Reviewers: campbellbarton, moguri, lordloki

Reviewed By: lordloki

Subscribers: brecht, lordloki

Differential Revision: https://developer.blender.org/D1610
2015-12-13 02:09:05 +01:00
37c6a207ce Memutil: remove some unused code. 2015-12-11 01:48:26 +01:00
c7122b5391 IK Solver: remove unused and outdated test code. 2015-12-11 01:42:41 +01:00
8a66d4966a Moto: remove some unused code. 2015-12-11 01:40:56 +01:00
6e4802d712 IK Solver: replace TNT math library with Eigen.
Performance is about the same or slightly better for typical IK chains.
In extreme cases with many bones and multiple targets, of which some are
unreachable, I've seen 2x speedups.
2015-12-11 00:59:00 +01:00
aaa627d5f5 IK solver: replace Moto math library with Eigen. 2015-12-11 00:59:00 +01:00
Campbell Barton
5f0cf67882 Cleanup: quiet warning 2015-12-10 21:18:50 +11:00
f9047c3f8c Eigen: fold remaining OpenNL code into intern/eigen.
Differential Revision: https://developer.blender.org/D1662
2015-12-10 01:58:10 +01:00
858b680a50 Eigen: move C API into intern/eigen. 2015-12-10 01:58:06 +01:00
Sergey Sharybin
19dba67d15 Cycles: Comment out unused arguments 2015-12-09 18:38:02 +05:00
Mike Erwin
d7851b87a7 remove a debug printf 2015-12-08 20:13:45 -05:00
Mike Erwin
6006173f4a OpenGL: use sized texture internal formats
Maybe this is pedantic but I read it’s best to explicitly set the
desired component size.

Also append “_ARB” to float texture formats since those need an
extension in GL 2.1.
2015-12-08 01:19:55 -05:00