Cycles: Update OSL GPU services for version 1.15

The required free functions for closure allocation changed, only a
single allocation function needs to be defined now.

This is needed to fix the failing tests after the 5.2 libraries update.

Pull Request: https://projects.blender.org/blender/blender/pulls/158507
This commit is contained in:
Brecht Van Lommel 2026-05-12 23:29:04 +02:00 • committed by Brecht Van Lommel
parent 3bca53ed35
commit addf95f48a

View file

@ -21,6 +21,21 @@ CCL_NAMESPACE_BEGIN
/* Closure */
#if OSL_LIBRARY_VERSION_CODE >= 11500
ccl_device_extern void *rs_allocate_closure(ccl_private ShaderGlobals *sg,
const size_t size,
const size_t alignment)
{
ccl_private uint8_t *closure_pool = sg->closure_pool;
closure_pool = reinterpret_cast<ccl_private uint8_t *>(
(reinterpret_cast<size_t>(closure_pool) + alignment - 1) & (-alignment));
sg->closure_pool = closure_pool + size;
return closure_pool;
}
#else
ccl_device_extern ccl_private OSLClosure *osl_mul_closure_color(ccl_private ShaderGlobals *sg,
ccl_private OSLClosure *a,
const ccl_private float3 *weight)
@ -138,6 +153,8 @@ ccl_device_extern ccl_private OSLClosure *osl_allocate_weighted_closure_componen
return closure;
}
#endif
/* Utilities */
ccl_device_extern void osl_error(ccl_private ShaderGlobals * /*sg*/,