Commit Graph

6592 Commits

Author SHA1 Message Date
Sergey Sharybin
a96110e710 Cycles: Remove old non-optimized triangle intersection function
It is unused now and if we want similar function we should use
Pluecker intersection which is same performance with SSE optimization
but which is more watertight.
2017-03-23 17:59:34 +01:00
Sergey Sharybin
27248c8636 Cycles: Remove unused macro 2017-03-23 17:59:02 +01:00
Sergey Sharybin
ba8c7d2ba1 Cycles: Use SSE-optimized version of triangle intersection for motion triangles
The title says it all actually. Gives up to 10% speedup on test scenes here
on i7-6800K.

Render times on GPU are unreliable here, but there might be some slowdown
caused by watertight nature of intersections.
2017-03-23 17:58:03 +01:00
Sergey Sharybin
a1348dde2e Cycles: Fix speed regression on GPU
Avoid construction of temporary array and make utility function force-inlined.
Additionally avoid calling float4_to_float3 twice.

This brings render times to the same values as before current patch series.
2017-03-23 17:45:19 +01:00
Sergey Sharybin
2a5d7b5b1e Cycles: Use utility function for SSS triangle intersection
This effectively de-duplicates triangle intersection logic implemented
for both regular triangle and SSS triangle.
2017-03-23 17:45:19 +01:00
Sergey Sharybin
a5b6742ed2 Cycles: Move watertight triangle intersection to an utility file
This way the code can be reused more easily.
2017-03-23 17:45:19 +01:00
Sergey Sharybin
f8a999c965 Cycles: Move triangle intersection precalc to an util file
This is a preparation work for the followup commit which wil l move
remaining parts of Woop intersection logic to an utility file.

Doing it as a separate commit to keep changes more atomic and easier
to bisect when/if needed.
2017-03-23 17:45:19 +01:00
Sergey Sharybin
b797a5ff78 Cycles: Cleanup, move utility function to utility file
Was an old TODO, this function is handy for some math utilities as well.
2017-03-23 17:45:19 +01:00
Sergey Sharybin
aa0602130b Cycles: Cleanup, code style and comments 2017-03-23 17:45:19 +01:00
Sergey Sharybin
1c5cceb7af Cycles: Move intersection math to own header file
There are following benefits:

- Modifying intersection algorithm will not cause so much re-compilation.
- It works around header dependency hell and allows us to use vectorization
  types much easier in there.
2017-03-23 17:45:19 +01:00
Sergey Sharybin
e8ff06186e Cycles: Cleanup, inline AVX register construction from kernel global data
Currently should be no functional changes, preparing for some upcoming refactor.
2017-03-23 17:45:19 +01:00
Sergey Sharybin
5c06ff8bb9 Cycles: Cleanup, remove unused function 2017-03-23 17:45:19 +01:00
Mai Lavelle
4d82d525f8 Cycles: Fix building for some compilers 2017-03-23 00:14:48 -04:00
Stefan Werner
412220c8d3 Cycles: fixed warnings 2017-03-22 12:28:01 +01:00
Sergey Sharybin
2b44db4cfc Fix/workaround T50533: Transparency shader doesn't cast shadows with curve segments
There seems to be a compiler bug of MSVC2013. The issue does not happen on Linux and
does not happen on Windows when building with MSVC2015.

Since it's reallly a pain to debug release builds with MSVC2013 the AVX2 optimization
is disabled for curve sergemnts for this compiler.
2017-03-22 11:37:23 +01:00
Sergey Sharybin
a0f16e12a0 Cycles: Use more friendly GPU device name for AMD cards
For example, for RX480 you'll no longer see "Ellesmere" but will see
"AMD Radeon RX 480 Graphics" which makes more sense and allows to easily
distinguish which exact card it is when having multiple different cards
of Ellesmere codenames (i.e. RX480 and WX7100) in the same machine.
2017-03-21 12:01:11 +01:00
Sergey Sharybin
7780a108b3 Cycles: Simplify some extra OpenCL query code 2017-03-21 12:01:03 +01:00
Sergey Sharybin
fceb1d0781 Cycles: Cleanup, add some utility functions to shorten access to low level API
Should be no functional changes.
2017-03-21 12:01:03 +01:00
Lukas Stockner
eb1a57b12c Cycles: Fix wrong vector allocation in the mesh sync code 2017-03-21 04:30:08 +01:00
Mai Lavelle
8fff6cc2f5 Cycles: Fix building of OpenCL kernels
Theres no overloading of functions in OpenCL so we can't make use of
`safe_normalize` with `float2`.
2017-03-20 22:55:52 -04:00
Sergey Sharybin
3c4df13924 Fix T50268: Cycles allows to select un supported GPUs for OpenCL 2017-03-20 15:37:27 +01:00
Lukas Stockner
d544a61e8a Cycles: Update remaining time once per second without waiting for a tile change
Previously, the code would only update the status string if the main status changed.
However, the main status did not include the remaining time, and therefore it wasn't updated until the amount of rendered tiles (which is part of the main status) changed.

This commit therefore makes the BlenderSession remember the time of the last status update and forces a status update if the last one was more than a second ago.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D2465
2017-03-20 15:28:36 +01:00
Sergey Sharybin
a201b99c5a Fix T50975: Cycles: Light sampling threshold inadvertently clamps negative lamps 2017-03-20 14:48:55 +01:00
Sergey Sharybin
18bf900b31 Fix T50990: Random black pixels in Cycles when rendering material with Multiscatter GGX 2017-03-20 12:07:41 +01:00
Campbell Barton
eaf88f564c Remove register_module use in Cycles 2017-03-20 12:16:51 +11:00
Sergey Sharybin
ea3d7a7f58 Fix T50968: Cycles crashes when image datablock points to a directory
See more details about root of the cause there:

  https://github.com/OpenImageIO/oiio/pull/1640
2017-03-17 14:47:12 +01:00
Sergey Sharybin
d6b4fb6429 Cycles: Fix mistake in previous split kernel commits
Own stupid mistake. Reported by nirved in IRC, thanks!
2017-03-17 11:55:59 +01:00
Sergey Sharybin
a58350b07f Cycles: Cleanup, indentation 2017-03-17 10:25:37 +01:00
Sergey Sharybin
e361adbca2 Cycles: Fix compilation error of LCG RNG 2017-03-17 09:58:08 +01:00
Sergey Sharybin
439a277aa5 Cycles: Silence strict compiler warning 2017-03-17 09:56:44 +01:00
Mai Lavelle
2cae58524c Cycles: Improve memory usage of CPU split kernel by using smaller global size 2017-03-17 01:54:10 -04:00
Mai Lavelle
60a344b43d Cycles: Fix handling of barriers 2017-03-17 01:54:04 -04:00
Sergey Sharybin
1cad64900e Cycles: Define ccl_local variables in kernel functions
Declaring ccl_local in a device function is not supported
by certain compilers.
2017-03-16 11:27:17 +01:00
Sergey Sharybin
1ff753baa4 Cycles: Workaround for compilation error caused by passing KernelGlobals
Pass globals as a bare pointer, same as it sued to be prior to split kernel rework.

AMD CPU platform and Intel OpenCL were complaining about this.

Perhaps we shouldn't pass globals as pointer at all, this isn't something what is
really portable and can cause issues on 32 bit perhaps.
2017-03-16 11:27:17 +01:00
Sergey Sharybin
26620f3f87 Cycles: Avoid some ccl_local in various kernels 2017-03-16 11:27:17 +01:00
Mai Lavelle
4833a71621 Cycles: Adjust global size for OpenCL CPU devices to make them faster 2017-03-16 06:11:42 -04:00
Sergey Sharybin
c44cdd5905 Cycles: Allow rendering a range of resumable chunks
The range is controlled using the following command line arguments:

  --cycles-resumable-start-chunk
  --cycles-resumable-end-chunk

Those are 1-based index of range for rendering.
2017-03-15 16:00:01 +01:00
Sergey Sharybin
c5dba540d7 Cycles: Use argument parser for resumable render feature
Currently there is no functional changes, but we will be adding
couple more of options here soon.
2017-03-15 16:00:01 +01:00
Sergey Sharybin
5ba51de84a Cycles: Cleanup, indentation 2017-03-14 16:54:16 +01:00
Mai Lavelle
8dd0355c21 Cycles: Try to avoid infinite loops by catching invalid ray states 2017-03-14 06:22:57 -04:00
Sergey Sharybin
76acaefdd7 Cycles: Cleanup, wipe obviously outdated parts of split kernel comments 2017-03-13 17:16:16 +01:00
lazydodo
0c72008592 fix msvc warnings about unknown opencl pragmas 2017-03-13 10:08:14 -06:00
Sergey Sharybin
aa36c73c33 Cycles: Add missing header in the file 2017-03-13 16:59:09 +01:00
Hristo Gueorguiev
f169ff8b88 Fix T50925: Add AO approximation to split kernel 2017-03-13 11:15:58 +01:00
Sergey Sharybin
8794a43b68 Cycles: Make MESA compiler more happy
While this compiler is not officially supported yet, getting it to work is
a nice thing because more and more AMD cards will fall under MESA driver.

It's also nice to use explicit comparison with NULL, which makes it more
clear whether variable is a boolean or pointer. Even Rust enforces this!

Patch by Ian Bruce with own modifications.
2017-03-13 09:57:25 +01:00
68ca973f7f Fix T50628: gray out cycles device menu when no device configured only for GPU Compute. 2017-03-12 18:00:17 +01:00
Campbell Barton
bcc8c04db4 Cleanup: code style & cmake 2017-03-12 02:47:53 +11:00
Mai Lavelle
96868a3941 Fix T50888: Numeric overflow in split kernel state buffer size calculation
Overflow led to the state buffer being too small and the split kernel to
get stuck doing nothing forever.
2017-03-11 05:39:28 -05:00
2d3c44389a Fix OpenCL warnings about doubles on some platforms. 2017-03-11 00:55:23 +01:00
Sergey Sharybin
59fd21296a Cycles: Cleanup, extra semicolon and space 2017-03-10 15:38:30 +01:00