Fix #154892: Cycles CUDA error when disabling light tree

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
This commit is contained in:
Brecht Van Lommel 2026-02-27 16:57:32 +01:00 • committed by Brecht Van Lommel
parent ffc8d818e4
commit 3a1ffd512f

View file

@ -110,10 +110,12 @@ void PathTraceWorkGPU::alloc_integrator_soa()
{
/* IntegrateState allocated as structure of arrays. */
/* Check if we already allocated memory for the required features. */
/* Check if we already allocated memory for the required features.
* Note that both disabling and enabling features may require memory
* allocations, so we check for equality. */
const int requested_volume_stack_size = device_scene_->data.volume_stack_size;
const uint kernel_features = device_scene_->data.kernel_features;
if ((integrator_state_soa_kernel_features_ & kernel_features) == kernel_features &&
if (integrator_state_soa_kernel_features_ == kernel_features &&
integrator_state_soa_volume_stack_size_ >= requested_volume_stack_size)
{
return;