The OpenImageIO version we use has broken CMYK to RGB conversion in
JPEG, this is a temporary workaround until we upgrade to a newer
version. Directly read the CMYK image with libjpeg.
Note that when we upgrade, we can remove the CMYK conversion code
entirely as OpenImageIO supports this natively nowadays.
---
NOTE: This is the backport for 5.1.1.
Pull Request: https://projects.blender.org/blender/blender/pulls/157146
The issue was caused by a failing `RegGetValueW()` call in
`getScrollDirectionFromReg()` within GHOST TrackpadWin32 due to
uninitialized output arguments, causing nondeterministic orbiting
direction depending on the environment.
Fixed by properly initializing the`scrollDirectionRegValue` and
`pcbData` variables passed to the function. In addition to this, a
correction was made to the default value returned in the querying
failing case, and comments were added to better detail the meaning of
return values.
Pull Request: https://projects.blender.org/blender/blender/pulls/156986
There is an obsolete swapchain configuration being checked.
This configuration was used 2 years ago when wayland color management
wasn’t mature. Nowadays this configuration is not being used until
the latest NVIDIA driver started to use it again. This made some bugs
appear as incorrect code paths is being selected to copy framebuffer
to the swapchain.
Pull Request: https://projects.blender.org/blender/blender/pulls/156741
Implement the missing code for this, which is just copying the attribute
without interpolation.
This issue existed in Blender 5.0 already, however in Blender 5.1
attributes with constant values on other domains can get optimized
to a mesh attribute.
Pull Request: https://projects.blender.org/blender/blender/pulls/156307
The minimum supported driver version for Blender 5.1 and
5.2 already includes a fix for the underlying issue, so
there is no need to keep the workaround that isolated each
device into a separate DPC++ context when multiple
descrete GPUs or Level-Zero platforms were detected.
It is now removed.
Ref #138384
Pull Request: https://projects.blender.org/blender/blender/pulls/156249
On systems with both an Intel iGPU and dGPU using different
drivers (e.g., legacy 11th-14th Gen driver alongside the
Arc driver), the oneAPI Level-Zero copy optimization extension
can cause crashes during host-to-device memory transfers.
Detect when multiple Level-Zero platforms are present, which
indicates separate Intel drivers in the system, and disable
the copy optimization extension in such configurations to
prevent crashes.
This workaround can be removed once the minimum supported
driver version includes a future fix for the underlying
issue.
The object matbits array length is not guaranteed to match the length
of the material slot array in geometry. The RNA code checked for this
but the ported code did not.
Regression from 244b154bb6.
Pull Request: https://projects.blender.org/blender/blender/pulls/156029
BKE_view_layer_base_find returns null for objects from background scenes
since they have no base in the current view layer. As before, such
objects will not have holdout or indirect-only flags.
Regression from 244b154bb6.
Pull Request: https://projects.blender.org/blender/blender/pulls/155876
Match the old is_updated_geometry logic that this code replaced, to avoid
missing or unnecessary updates.
Also fix ITER_END placement so the adaptive subdivision code runs once
after the depsgraph ID iteration rather than on every iteration.
Regression from 49d34491b8.
Pull Request: https://projects.blender.org/blender/blender/pulls/155857
This fixes#155588 - an issue introduced by PR #154916.
That PR included a 10% safety margin for the working set calculations to account for certain hidden overheads when shrinking the working set size. This allowed for certain scenes like Junkshop to render on the new RAM-constrained Neo machines. However the same safety margin was also used for the state growth heuristic. This PR applies a much more aggressive threshold when growing the state size. It will only double if doing so leaves us with >= 50% of the max recommended work set available.
Pull Request: https://projects.blender.org/blender/blender/pulls/155635
The fix in 2dc2e0b062 to discard flat/smooth flags if there are corner
normals didn't work well for displacement. Then the normals are fully
recomputed from displacement and for this the flat/smooth flag is
needed.
Rather than discarding the flags on conversion from Blender, do it
inside Cycles after displacement.
Pull Request: https://projects.blender.org/blender/blender/pulls/155522
The local atomic sort kernels initialize shared memory arrays sized
max_shaders, but used if (local_id < max_shaders) to do so, meaning
only one entry per thread was initialized.
With smaller workgroup sizes, further entries were left uninitialized
and caused out of bounds writes.
Replace the single-slot if-guard with a strided for loop so all
max_shaders entries are correctly initialized regardless of
workgroup size.
Pull Request: https://projects.blender.org/blender/blender/pulls/155269
Workaround for SMITHAY where drop would fail if the last accepted
mime type wasn't known.
While the spec should allow for this, it's also not useful to report
mime types as accepted if the compositor doesn't support them.
This should fix dropping on all SMITHAY based compositors
including the Cosmic Desktop.
Albedo and normal denoising features passes used several hard cutoffs
that lead to discontinuities in the passes and sometimes the denoised
render too. Use smooth transitions instead.
Specular roughness cutoff of 0.075 replaced by a smoothstep from 0.0
to 0.15. Specular and transparent 25% threshold replaced by diffuse to
specular ratio blend from 0.0 to 0.5.
Also stop using sample_weight which is meant for importance sampling
only.
Fix#150391Fix#85512Fix#78571
Pull Request: https://projects.blender.org/blender/blender/pulls/154988
Make sure headers include all the required headers and prototypes so
they can be safely included, and users of clangd don't see errors in
their IDE.
Also fix forward declarations and pragmas that were in the wrong place.
Pull Request: https://projects.blender.org/blender/blender/pulls/154976
To choose between:
* The smooth, undisplaced base surface normal and tangents, when you
have a displacement map and normal map that match.
* The displaced surface normal and tangents, when you want to apply a
normal map in addition to displacement.
This is Cycles only for now, to fix a regression in 5.0 regarding
adaptive subdivison. More unified handling with EEVEE is for another
time. This is an alternative solution to replace #122397.
Fix#153670
Pull Request: https://projects.blender.org/blender/blender/pulls/154031
The check assumed that only enabling a feature could require extra state,
but with 4b34743b4e disabling the light tree actually requires more
state. So just check for equality. I can't find a good reason it didn't
do that before, this should not have significant overhead.
Pull Request: https://projects.blender.org/blender/blender/pulls/154926
Refines the state allocation strategy in the Metal device queue to better utilise available RAM. Instead of using MTLDevice's `currentAllocatedSize` (which includes non-Cycles resources), use `Stats::mem_used` which more faithfully represents the working set of resources. As before, we double the state count if we can do it safely. Additionally, we reduce the state count in order to render scenes like Junkshop which otherwise wouldn't render on an 8 GiB machine.
Pull Request: https://projects.blender.org/blender/blender/pulls/154916
The Raycast node assumed the hit came from a triangle when computing the
hit normal.
Use `shader_setup_from_ray` to compute the normal instead, since that's
how other paths compute the normal from a hit, and takes all geometry
types into account.
Instead of allocating the whole `ShaderData` struct, we use
`ShaderDataTinyStorage` instead, to avoid excessive register pressure.
Pull Request: https://projects.blender.org/blender/blender/pulls/154818
This new version of the graphics compiler brings a fix to recently
discovered issue with Ahead-Of-Time binaries, used right now by
Blender for upcoming Intel® Core™ Ultra Series 3 which would
lead to the rejection of the GPU binaries by the future drivers
on this platform. In order to avoid such situation, and spare
users time to recompile the GPU binaries, this upgrade is
necessary.
Previously set minimal driver version 101.8306 was not increased,
and compatibility was manually tested internally at Intel, to
ensure no problems with it.
Pull Request: https://projects.blender.org/blender/blender/pulls/154647
Some headers and precompiled shaders were not properly installed.
This seems to be a regression since !153424: our custom FindOSL
used to define OSL_SHADER_DIR. It is not defined by the CMake
configs from the OSL.
Pull Request: https://projects.blender.org/blender/blender/pulls/154576
In 35f34cd468 an offset was applied to volume object static Transform to
avoid overlap, now also apply this offset for motion blur.
Also make sure this offset is applied when comparing two transforms.
Pull Request: https://projects.blender.org/blender/blender/pulls/154366
* Uninitialized variable warning in oneAPI.
* Use std::copy_n instead of memcpy.
* Use simpler bit packing for normal map convention that avoids
signed/unsigned warning.
* Unnecessary device keyword for default constructor.
* Unused variables in Principled BSDF due to constexpr.
* Hydra function that should be static.
Pull Request: https://projects.blender.org/blender/blender/pulls/154430
The problem is that volume guiding denoising was not using the RenderWork
mechanism for scheduling like other steps in the render pipeline. This
meant that it was not affected by render_work_reschedule_on_cancel to
stop path tracing work and only do the remaining work for writing out the
render. And that in turn caused volume denoising to run on a null buffer.
Pull Request: https://projects.blender.org/blender/blender/pulls/154282
This fails with CUDA 12.8 that we use for official builds, but works with
CUDA 12.9 and with other GPU generations. I could not find a logical
explanation besides a compiler bug. Upgrading would mean increasing the
minimum NVIDIA driver version which is not ideal.
I tweaked the code so the emission-only shader evaluation can optimize out
more of the principled BSDF code, which seems to sidestep the problem
and is more performant anyway. It adds some ugly indentation, but
perhaps it's best to refactor and split up this function later in main.
Pull Request: https://projects.blender.org/blender/blender/pulls/154223
Pixels retrieved through tile.get_pass_pixels were wrong when using tiled
renders with padding for adaptive sampling. It should only return pixels
within the display window.
This case did not affect Blender, only standalone. It also only affected
CPU rendering, the GPU pass accessor is correct.
Pull Request: https://projects.blender.org/blender/blender/pulls/154171
Use lazy initialization for global variables, so they get destructed before the
guardedalloc leak check and destruction. The same pattern is used elsewhere
in Blender.
There may be more cases, these were the ones I found in testing. These issue
were exposed by f8eec542f4.
Pull Request: https://projects.blender.org/blender/blender/pulls/154173
After refactoring to deduplicate code, the normal for the tangent frame was
no longer properly transform to object space. Revert code to how it was
before and add a more explicit function name and comment.
Pull Request: https://projects.blender.org/blender/blender/pulls/154102
Implement equals to allow deduplicating sky textures so they are shared,
and ensure they get refreshed properly when node sockets are modified.
There is a single OSL texture name to texture handle mapping table, and
while shaders are compiled per device this mapping table is shared.
Pull Request: https://projects.blender.org/blender/blender/pulls/154062