Blender Git Loki

Blender Git "cycles-x" branch commits.

Page: 2 / 44

September 17, 2021, 08:56 (GMT)
Fix wrong display when rendering multiple view layers in Cycles X

The issue was that the texture used by GPUDisplay was never cleared and
was only used for partial updates.

The actual reasoning of that is a bit more tricky than it looks on a
first glance since the GPUDisplay was re-created together with session
via session_reset so one would think it is weird to have a texture from
previous view layer to appear in the new GPUDisplay. Probably caused by
the fact that OpenGL is the same for all view layers, and texture ID is
happened to be the same.

Anyhow, the way texture is created is considered to have an undefined
behavior by the standard when is attempted to be used without explicit
data assignment.

This change makes it so new texture is always guaranteed to be zeroed
and that the GPU display is cleared when rendering multiple views from
within the same session.

The clearing is done by a GPUDisplay subclass, as the parent does not
know details of how to perform the zeroing. For the CPU the zeroing is
done on a mapped memory, as it makes it easy and does not require any
extra OpenGL requirements.

For the graphics interop things a bit more difficult as attempts to map
texture will make graphics interop to fail out (it really wants to be
an exclusive thing which takes care of the memory mapping). So for the
graphics interop clearing is done when memory is mapped by the interop
implementation.

Differential Revision: https://developer.blender.org/D12514
September 17, 2021, 08:38 (GMT)
Fix persistent data not allowing to change sample count and time limit

The root cause was that `session->params` were never updated to the new
parameters.

Made it so `session->reset()` will make sure the session is fully up to
date with the desired parameters.

Investigation by @dingto, code by self.

Differential Revision: https://developer.blender.org/D12515
September 17, 2021, 08:25 (GMT)
Fix pass accessor with 0 samples

Avoid division by zero when calculating scale, and avoid multiplication
by inf later on.

The pixel processing functions are changed so that they return fully
transparent pixel for pixels where number of samples is 0. This allows
to have matched behavior of non-finished tiles with master, without
relying on non-finite math.

The extra condition when calculating scale is inevitable, and hopefully
the pixel processing function's if statement gets folded into it as
well ()due to force-inline).

Differential Revision: https://developer.blender.org/D12518
September 17, 2021, 08:14 (GMT)
Fix race condition between draw and render threads

Caused crashes like the one William was fixing in the D12498, or the
crash when rendering multiple view layers.

Need to guarantee that the render engine is not freed during drawing,
and that the external engine is not in the middle of re-allocation due
to `update()` which might cause session reset (happens in Cycles).

Had to introduce a separate lock. The reason for this comes from the
fact that we need to acquire the engine early on in the draw manager,
and release it only when drawing is done. However, some other engines
(like overlay) might be requesting ImBuf for the image space, so that
they know dimensions. Such acquisition is guarded by the resultmutex.
This means reusing `resultmutex` for the `RenderEngine::draw()` would
cause a recursive lock.

Not entirely happy with implicit release in the external engine code,
but not sure there is an existing way of making it explicit without
introducing new draw engine callback.

Differential Revision: https://developer.blender.org/D12521
September 16, 2021, 19:20 (GMT)
Fix T91426: don't display outdated denoised result when increasing samples
September 16, 2021, 18:33 (GMT)
Fix T91427: wrong display with adaptive sampling and pixel size

Need to use the appropriate resolution divider for postprocessing of such
renders.
September 16, 2021, 17:58 (GMT)
Fix static initialization order crash with denoise parameters

Now that DenoiseParams is a Node, we can no longer create an instance of
it when defining the Integrator Node, since that might not have been
registered yet.
September 16, 2021, 17:39 (GMT)
Fix T91441: bump node not working for shadow rays
September 16, 2021, 17:20 (GMT)
Cycles X: set integrator state size relative to the number of GPU cores

More specifically, 16x the max number of threads on all multiprocessors,
with 1048576 minimum.

What this effectively does is double the state size on the very high end
GPUs like RTX A6000 and RTX 3080 while leaving the size unchanged for
others. On the RTX A6000 I there are 2-10% render time reductions on our
benchmark scenes. The biggest reduction is on the barbershop interior, as
scenes with more objects and shaders are more likely to benefit from
improved coherence.

This also adds an environment variable for developers to test different
sizes, and debug logging about the size and memory usage.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D12432
September 16, 2021, 11:00 (GMT)
Fix invalid address error in Cycles X GPUDisplay update

Make sure no display update happens after full buffer was written.
Makes it possible to free memory used by path trace works without
causing issues.
September 16, 2021, 09:23 (GMT)
Cleanup: Naming
September 15, 2021, 18:33 (GMT)
Fix wrong render with portals and constant background color

Need to apply MIS weight also in that case.
September 15, 2021, 18:04 (GMT)
Fix missing mutex lock for viewport OpenGL context

A mistake in D12468: the viewport uses GHOST to operate on contexts,
bypassing draw manager state,

Differential Revision: https://developer.blender.org/D12505
September 15, 2021, 17:52 (GMT)
Cleanup: Typo fix in a comment
September 15, 2021, 17:51 (GMT)
Render: Introduce render_frame_finish RenderEngine callback

Allows to inform the engine that nothing else will be rendered for the
current frame and that the engine can perform post-processing of any
pending result.

For example, this allows the engine to free its memory, read all files
from disk and write them to Blender.

Currently no functional changes, just preparing API for the further
development of Cycles on-disk tile storage.

Differential Revision: https://developer.blender.org/D12502
September 15, 2021, 17:35 (GMT)
Cycles X: Convert DenoiseParams to a "lite" Node

It is not supposed to be a node of a scene graph, but this change
allows to simplify serialization of the denoising parameters.

The goal is to be able to easily (de)serialize denoiser parameters
to/from image metadata, so that processing of the files can happen
outside of the scene graph (for example, on-disk tile buffer and
animation denoising).
September 15, 2021, 17:35 (GMT)
Cycles X: Switch TileManager to use BufferPass

Continuation of work related on making buffers a sufficient entity
to properly access pass pixels.

For the ease of (de)serialization the buffer pass and parameters
are now subclass of Node. Can try looking into adding an explicit
Serializable API, but it will be outside of this patch and not
currently sure it will make things more clear.
September 15, 2021, 17:33 (GMT)
Fix missing shadow catcher pass in viewport

The regression was caused by changes related on GPUDisplay used for
an offline rendering.
September 15, 2021, 17:33 (GMT)
Ensure unique names of tile buffer files in Cycles X

It is possible that processing and deletion of tile buffer from disk
will happen after tile manager was re-allocated. This happens, for
example, when rendering multiple view layers in Blender: each view
layer will reset session (which re-creates the tile manager).
September 15, 2021, 17:33 (GMT)
Cycles X: Keep track of passes list in BufferParams

Currently should no functional changes.

The goal is to completely decouple BufferParams from Scene graph for
pass accessing.

This is needed for the on-disk tiled storage when EXR is to be read
from disk after the session got freed. Also, will make animation
denoising easier to implement.
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021