Blender Git Statistics -> Developers -> pmoursnv

Patrick Mours (pmoursnv)

Total Commits : 136
Master Commits : 114
Branch Commits : 22
First Commit : August 26, 2019
Latest Commit : October 8, 2021

Commits by Month

DateNumber of Commits
October, 20212
September, 20212
August, 20210
July, 20211
June, 20211
May, 20211
April, 202115
March, 20212
February, 20217
January, 202112
December, 20206
November, 20206
October, 20204
September, 20201
August, 20200
July, 20209
June, 20204
May, 20202
April, 20202
March, 20202
February, 202015
January, 20209
December, 20191
November, 20198
October, 20195
September, 20195
August, 201914

Commit Distribution

PathNumber of Commits

Favourite Files

FilenameTotal Edits

File Changes

ActionTotalPer Commit

Code Changes

ActionTotalPer Commit
Lines Added7 35763.4
Lines Removed4 61039.7

Latest commits Feed

Revision 3a65571 by Patrick Mours (master)
October 8, 2021, 16:03 (GMT)
Fix T90666: Toggling motion blur while persistent data is enabled results in artifacts

Enabling or disabling motion blur requires rebuilding the BVH of affected geometry and
uploading modified vertices to the device (since without motion blur the transform is
applied to the vertex positions, whereas with motion blur this is done during traversal).
Previously neither was happening when persistent data was enabled, since the relevant
node sockets were not tagged as modified after toggling motion blur.

The change to blender_object.cpp makes it so `geom->set_use_motion_blur()` is always
called (regardless of motion blur being toggled on or off), which will tag the geometry
as modified if that value changed and ensures the BVH is updated.
The change to hair.cpp/mesh.cpp was necessary since after motion blur is disabled,
the transform is applied to the vertex positions of a mesh, but those changes were not
uploaded to the device. This is fixed now that they are tagged as modified.

Maniphest Tasks: T90666

Differential Revision:
Revision c11585a by Patrick Mours (master)
October 5, 2021, 14:36 (GMT)

This is required for Cycles to report a meaningful error message when it fails to load a PTX module
created with a newer CUDA toolkit version than the driver supports.

Ref T91879
Revision 2189dfd by Patrick Mours (master)
September 27, 2021, 15:12 (GMT)
Cycles: Rework OptiX visibility flags handling

Before the visibility test against the visibility flags was performed in an any-hit program in OptiX
(called `__anyhit__kernel_optix_visibility_test`), which was using the `__prim_visibility` array.
This is not entirely correct however, since `__prim_visibility` is filled with the merged visibility
flags of all objects that reference that primitive, so if one object uses different visibility flags
than another object, but they both are instances of the same geometry, they would appear the same
way. The reason that the any-hit program was used rather than the OptiX instance visibility mask is
that the latter is currently limited to 8 bits only, which is not sufficient to contain all Cycles
visibility flags (12 bits).

To mostly fix the problem with multiple instances and different visibility flags, I changed things to
use the OptiX instance visibility mask for a subset of the Cycles visibility flags (`PATH_RAY_CAMERA`
to `PATH_RAY_VOLUME_SCATTER`, which fit into 8 bits) and only fall back to the visibility test any-hit
program if that isn't enough (e.g. the ray visibility mask exceeds 8 bits or when using the built-in
curves from OptiX, since the any-hit program is then also used to skip the curve endcaps).

This may also improve performance in some cases, since by default OptiX can now perform the normal
scene intersection trace calls entirely on RT cores without having to jump back to the SM on every
hit to execute the any-hit program.

Fixes T89801

Differential Revision:
Revision cad00ba by Patrick Mours (cycles-x)
September 17, 2021, 11:29 (GMT)
Cycles X: Improve performance of transparent shadows with OptiX

This changes the shadow record-all any-hit program to accept all
hits (return without calling `optixIgnoreIntersection`) beyond
the furthest distance recorded after the maximum number of hits
that can be recorded was reached.
OptiX will not call the any-hit program anymore for hits beyond
the distance of the accepted hits and also reduces the current
ray length behind the scenes. As a result performance improves
drastically in scenes where shadow rays can hit a lot of
transparent objects, like the "koro" benchmark scene.

With this applied I now get similar performance with both CUDA
and OptiX in "koro". Not quite perfect yet, but much better than

Reviewed By: brecht

Differential Revision:
Revision 27db38f by Patrick Mours (cycles-x)
July 6, 2021, 13:51 (GMT)
Cycles X: Shading performance improvements by changing inlining behavior for SVM

The shading kernels (shade_surface, ...) are limited by memory a lot. I found several hotspots
where execution was stalled waiting for spills to be loaded back into registers. That's
something that can be adjusted by changing the inlining logic:

For example, the compiler did not inline "kernel_write_denoising_features" (even though it
was marked __inline__), which caused it to force synchronization before the function call.
Forcing it inline avoided that and got rid of that hotspot.

Then there was cubic texture filtering and NanoVDB, which introduced huge code chunks
into each texture sampling evaluation (increasing register and instruction cache pressure),
even though they are rarely actually used. Making them __noinline__ outsources that
overhead to only occur when actually used.

Another case is the SVM. The compiler currently converts the node type switch statement
into a binary searched branch sequence. This means depending on the SVM node hit, the
GPU has to branch over large portions of code, which increases instruction cache pressure
immensely (GPU is fetching lots of code even for stuff it immediately jumps away from
again, while jumping through the binary searched branches). This can be reduced somewhat
by making all the node functions __noinline__, so that the GPU only has to branch over a
bunch of call instructions, rather than all the inlined code.
The SVM "offset" value is passed by value into the node functions now and returned through
function return value, to make the compiler keep it in a register. Otherwise when passed as
a pointer, in OptiX the compiler was forced to move it into local memory (since functions
are compiled separately there, so the compiler is unaware of how that pointer is used).

Differential Revision:
Revision 45cfa58 by Patrick Mours (cycles-x)
June 24, 2021, 10:55 (GMT)
Enable built-in OptiX curves by default

Starting with OptiX 7.3 curves now behave as expected with Cycles and render the same as the
custom intersection implementation, so enable by default.
Revision b046bc5 by Patrick Mours (master)
May 25, 2021, 14:56 (GMT)
Fix T88096: Baking with OptiX and displacement fails

Using displacement runs the shader eval kernel, but since OptiX modules are not loaded when
baking is active, those were not available and therefore failed to launch. This fixes that by falling
back to the CUDA kernels.
Revision ffa70e7 by Patrick Mours / Brecht Van Lommel (master)
April 29, 2021, 13:58 (GMT)
Fix missing Cycles CPU name for Arm processors
Revision 9496025 by Patrick Mours (master)
April 26, 2021, 12:55 (GMT)
Cycles: Fix build with OptiX 7.3 SDK
Revision 5abfe99 by Patrick Mours (cycles-x)
April 23, 2021, 11:07 (GMT)
Avoid costly OptiX module creation when only doing denoising

MiikaHweb - Blender Git Statistics v1.06
By: Miika HämäläinenLast update: Nov-07-2014 14:18 MiikaHweb | 2003-2021