diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-10-20 15:21:01 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-10-20 18:50:31 +0300 |
commit | 001f548227c413a4fdbee275744ea8bea886081a (patch) | |
tree | a228a1b1888eefe94bfe74484f99cea127164a14 /intern/cycles/device/hip | |
parent | 2537b32392405fe586180d11f116bb39a184f6b4 (diff) |
Cycles: reduce kernel reserved local memory when not using shader raytracing
Ref T87836
Diffstat (limited to 'intern/cycles/device/hip')
-rw-r--r-- | intern/cycles/device/hip/device_impl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/device/hip/device_impl.cpp b/intern/cycles/device/hip/device_impl.cpp index 964783a08bf..583ab8ae208 100644 --- a/intern/cycles/device/hip/device_impl.cpp +++ b/intern/cycles/device/hip/device_impl.cpp @@ -430,7 +430,7 @@ bool HIPDevice::load_kernels(const uint kernel_features) return (result == hipSuccess); } -void HIPDevice::reserve_local_memory(const uint) +void HIPDevice::reserve_local_memory(const uint kernel_features) { /* Together with hipDeviceLmemResizeToMax, this reserves local memory * needed for kernel launches, so that we can reliably figure out when @@ -444,7 +444,9 @@ void HIPDevice::reserve_local_memory(const uint) { /* Use the biggest kernel for estimation. */ - const DeviceKernel test_kernel = DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE; + const DeviceKernel test_kernel = (kernel_features & KERNEL_FEATURE_NODE_RAYTRACE) ? + DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE : + DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE; /* Launch kernel, using just 1 block appears sufficient to reserve memory for all * multiprocessors. It would be good to do this in parallel for the multi GPU case |