Blender V5.3
services_gpu.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2009-2010 Sony Pictures Imageworks Inc., et al. All Rights Reserved.
2 * SPDX-FileCopyrightText: 2011-2022 Blender Foundation
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 * Adapted code from Open Shading Language. */
7
9
10#include "kernel/util/ies.h"
12
14#include "kernel/osl/strings.h"
15
16#include "util/types_image.h"
17
18#ifndef __KERNEL_GPU__
20#endif
21
22/* Closure */
23
25 const size_t size,
26 const size_t alignment)
27{
28 ccl_private uint8_t *closure_pool = sg->closure_pool;
29 /* Align pointer to closure struct requirement. */
30 closure_pool = reinterpret_cast<ccl_private uint8_t *>(
31 (reinterpret_cast<size_t>(closure_pool) + alignment - 1) & (-alignment));
32
33 if (closure_pool > sg->closure_pool_end || size > sg->closure_pool_end - closure_pool) {
34 return nullptr;
35 }
36
37 sg->closure_pool = closure_pool + size;
38
39 return closure_pool;
40}
41
42#if OSL_LIBRARY_VERSION_CODE < 11500
43
46 const ccl_private float3 *weight)
47{
48 if (*weight == zero_float3() || !a) {
49 return nullptr;
50 }
51 if (*weight == one_float3()) {
52 return a;
53 }
54
55 ccl_private OSLClosureMul *const closure = reinterpret_cast<ccl_private OSLClosureMul *>(
56 rs_allocate_closure(sg, sizeof(OSLClosureMul), alignof(OSLClosureMul)));
57 if (closure != nullptr) {
58 closure->id = OSL_CLOSURE_MUL_ID;
59 closure->weight = *weight;
60 closure->closure = a;
61 }
62 return closure;
63}
64
67 const float weight)
68{
69 if (weight == 0.0f || !a) {
70 return nullptr;
71 }
72 if (weight == 1.0f) {
73 return a;
74 }
75
76 ccl_private OSLClosureMul *const closure = reinterpret_cast<ccl_private OSLClosureMul *>(
77 rs_allocate_closure(sg, sizeof(OSLClosureMul), alignof(OSLClosureMul)));
78 if (closure != nullptr) {
79 closure->id = OSL_CLOSURE_MUL_ID;
80 closure->weight = make_float3(weight, weight, weight);
81 closure->closure = a;
82 }
83 return closure;
84}
85
89{
90 if (!a) {
91 return b;
92 }
93 if (!b) {
94 return a;
95 }
96
97 ccl_private OSLClosureAdd *const closure = reinterpret_cast<ccl_private OSLClosureAdd *>(
98 rs_allocate_closure(sg, sizeof(OSLClosureAdd), alignof(OSLClosureAdd)));
99 if (closure != nullptr) {
100 closure->id = OSL_CLOSURE_ADD_ID;
101 closure->closureA = a;
102 closure->closureB = b;
103 }
104 return closure;
105}
106
108 ccl_private ShaderGlobals *sg, const int id, const int size)
109{
110 ccl_private OSLClosureComponent *const closure =
111 reinterpret_cast<ccl_private OSLClosureComponent *>(rs_allocate_closure(
112 sg, sizeof(OSLClosureComponent) + size, alignof(OSLClosureComponent)));
113 if (closure != nullptr) {
114 closure->id = static_cast<OSLClosureType>(id);
115 closure->weight = one_float3();
116 }
117 return closure;
118}
119
121 ccl_private ShaderGlobals *sg, const int id, const int size, const ccl_private float3 *weight)
122{
123 ccl_private OSLClosureComponent *const closure =
124 reinterpret_cast<ccl_private OSLClosureComponent *>(rs_allocate_closure(
125 sg, sizeof(OSLClosureComponent) + size, alignof(OSLClosureComponent)));
126 if (closure != nullptr) {
127 closure->id = static_cast<OSLClosureType>(id);
128 closure->weight = *weight;
129 }
130 return closure;
131}
132
133#endif
134
135/* Utilities */
136
138 DeviceString /*format*/,
139 void * /*args*/)
140{
141}
142
144 DeviceString /*format*/,
145 void * /*args*/)
146{
147}
148
150 DeviceString /*format*/,
151 void * /*args*/)
152{
153}
154
156 DeviceString /*filename*/,
157 DeviceString /*format*/,
158 void * /*args*/)
159{
160}
161
162ccl_device_extern uint osl_range_check_err(const int indexvalue,
163 const int length,
164 DeviceString /*symname*/,
165 ccl_private ShaderGlobals * /*sg*/,
166 DeviceString /*sourcefile*/,
167 const int /*sourceline*/,
168 DeviceString /*groupname*/,
169 const int /*layer*/,
170 DeviceString /*layername*/,
171 DeviceString /*shadername*/)
172{
173 const int result = indexvalue < 0 ? 0 : indexvalue >= length ? length - 1 : indexvalue;
174#if 0
175 if (result != indexvalue) {
176 printf("Index [%d] out of range\n", indexvalue);
177 }
178#endif
179 return result;
180}
181
182/* Matrix Utilities */
183
185 ccl_private float *res,
186 DeviceString from)
187{
188 KernelGlobals kg = nullptr;
189
190 if (from == DeviceStrings::u_common) {
192 return true;
193 }
194 if (from == DeviceStrings::u_shader || from == DeviceStrings::u_object) {
195 return osl_shared_get_object_matrix(kg, sg->sd, res);
196 }
197 return osl_shared_get_named_matrix(kg, from, res);
198}
199
201 ccl_private float *res,
202 DeviceString to)
203{
204 KernelGlobals kg = nullptr;
205
206 if (to == DeviceStrings::u_common) {
208 return true;
209 }
210 if (to == DeviceStrings::u_shader || to == DeviceStrings::u_object) {
211 return osl_shared_get_object_inverse_matrix(kg, sg->sd, res);
212 }
213 return osl_shared_get_named_inverse_matrix(kg, to, res);
214}
215
216/* The ABI for these callbacks is different, so DeviceString and TypeDesc don't work here. */
217using RSTypeDesc = long long;
218
222
223/* Attributes */
224
226 const int derivatives,
227 DeviceString object_name,
228 DeviceString name,
229 const int /*array_lookup*/,
230 const int /*index*/,
231 const RSTypeDesc type_abi,
232 ccl_private void *res)
233{
234 const TypeDesc type = *reinterpret_cast<const TypeDesc *>(&type_abi);
235 KernelGlobals kg = nullptr;
236 ccl_private ShaderData *const sd = sg->sd;
237
238 if (sd->shader == SHADER_NONE) {
239 /* Camera shader. */
240 return osl_shared_get_camera_attribute(kg, sg, name, type, derivatives, res);
241 }
242
243 if (object_name != DeviceStrings::u_empty) {
244 /* TODO: Get object index from name */
245 return false;
246 }
247
248 const int object = sd->object;
249
250 const AttributeDescriptor desc = find_attribute(kg, object, sd->prim, name);
251 if (is_attribute_found(desc)) {
252 return osl_shared_get_object_attribute(kg, sd, desc, type, derivatives, res);
253 }
254 return osl_shared_get_object_standard_attribute(kg, sg, sd, name, type, derivatives, res);
255}
256
257/* Renderer services */
258
260 ccl_private void *data,
261 int data_size,
262 const TypeDesc &type,
263 int /*index*/)
264{
265 if (type.basetype == TypeDesc::PTR) {
266 kernel_assert(data_size == sizeof(void *));
267 (void)data_size;
268
269 ccl_private void **ptr_data = (ccl_private void **)data;
270
271 if (name.val == DeviceStrings::u_colorsystem) {
272#ifdef __KERNEL_OPTIX__
273 *ptr_data = kernel_params.osl_colorsystem;
274 return true;
275#else
276 (void)ptr_data;
277 return false;
278#endif
279 }
280 }
281 return false;
282}
283
285 RSDeviceString /*filename*/,
286 ccl_private void *texture_handle,
287 ccl_private void * /*texture_thread_info*/,
289 const float s,
290 const float t,
291 const float dsdx,
292 const float dtdx,
293 const float dsdy,
294 const float dtdy,
295 const int nchannels,
296 ccl_private float *result,
297 ccl_private float * /*dresultds*/,
298 ccl_private float * /*dresultdt*/,
299 ccl_private void * /*errormessage*/)
300{
301 return osl_shared_texture(
302 nullptr, sg, texture_handle, opt, s, t, dsdx, dtdx, dsdy, dtdy, nchannels, result);
303}
304
306 RSDeviceString /*filename*/,
307 ccl_private void *texture_handle,
308 ccl_private void * /*texture_thread_info*/,
310 const ccl_private float3 *P,
311 const ccl_private float3 *dPdx,
312 const ccl_private float3 *dPdy,
313 const ccl_private float3 *dPdz,
314 const int nchannels,
315 ccl_private float *result,
316 ccl_private float * /*dresultds*/,
317 ccl_private float * /*dresultdt*/,
318 ccl_private float * /*dresultdr*/,
319 ccl_private void * /*errormessage*/)
320{
322 nullptr, sg, texture_handle, *P, *dPdx, *dPdy, *dPdz, nchannels, result);
323}
324
326 RSDeviceString /*filename*/,
327 ccl_private void *texture_handle,
328 ccl_private void * /*texture_thread_info*/,
330 const ccl_private float3 *R,
331 const ccl_private float3 *dRdx,
332 const ccl_private float3 *dRdy,
333 const int nchannels,
334 ccl_private float *result,
335 ccl_private float * /*dresultds*/,
336 ccl_private float * /*dresultdt*/,
337 ccl_private void * /*errormessage*/)
338{
340 nullptr, sg, texture_handle, opt, *R, *dRdx, *dRdy, nchannels, result);
341}
342
344 RSDeviceString /*filename*/,
345 ccl_private void *texture_handle,
346 ccl_private void * /*texture_thread_info*/,
347 int /*subimage*/,
348 RSDeviceString dataname,
349 TypeDesc datatype,
350 ccl_private void *data,
351 ccl_private void * /*errormessage*/)
352{
354 nullptr, texture_handle, zero_float2(), false, dataname.val, datatype, data);
355}
356
358 RSDeviceString /*filename*/,
359 ccl_private void *texture_handle,
360 const float s,
361 const float t,
362 ccl_private void * /*texture_thread_info*/,
363 int /*subimage*/,
364 RSDeviceString dataname,
365 TypeDesc datatype,
366 ccl_private void *data,
367 ccl_private void * /*errormessage*/)
368{
370 nullptr, texture_handle, make_float2(s, t), true, dataname.val, datatype, data);
371}
372
374 RSDeviceString /*filename*/,
375 const ccl_private float3 * /*center*/,
376 float /*radius*/,
377 int /*max_points*/,
378 bool /*sort*/,
379 ccl_private int * /*out_indices*/,
380 ccl_private float * /*out_distances*/,
381 int /*derivs_offset*/)
382{
383 return 0;
384}
385
387 RSDeviceString /*filename*/,
388 const ccl_private int * /*indices*/,
389 int /*count*/,
390 RSDeviceString /*attr_name*/,
391 TypeDesc /*attr_type*/,
392 ccl_private void * /*out_data*/)
393{
394 return 0;
395}
396
398 RSDeviceString /*filename*/,
399 const ccl_private float3 * /*pos*/,
400 int /*nattribs*/,
401 const ccl_private DeviceString * /*names*/,
402 const ccl_private TypeDesc * /*types*/,
403 const ccl_private void ** /*data*/)
404{
405 return false;
406}
407
409 ccl_private void * /*options*/,
410 const ccl_private float3 * /*P*/,
411 const ccl_private float3 * /*dPdx*/,
412 const ccl_private float3 * /*dPdy*/,
413 const ccl_private float3 * /*R*/,
414 const ccl_private float3 * /*dRdx*/,
415 const ccl_private float3 * /*dRdy*/)
416{
417 return false;
418}
419
421 RSDeviceString /*name*/,
422 TypeDesc /*type*/,
423 ccl_private void * /*data*/,
424 bool /*derivatives*/)
425{
426 return false;
427}
428
429/* These osl_ functions are supposed to be implemented by OSL itself, but they are not yet.
430 * See: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1951
431 * So we have to keep them around for now.
432 *
433 * The 1.14.4 based beta used for Blender 4.5 does not need them though, so we check the
434 * version for that. */
435#if (OSL_LIBRARY_VERSION_CODE >= 11405) || (OSL_LIBRARY_VERSION_CODE < 11403)
437 const int /*firstchannel*/)
438{
439}
440
442{
443 return 0;
444}
445
447 const int /*mode*/)
448{
449}
450
452 const int /*mode*/)
453{
454}
455
457 const int /*mode*/)
458{
459}
460
462 const int /*mode*/)
463{
464}
465
467 const float /*blur*/)
468{
469}
470
472 const float /*blur*/)
473{
474}
475
477 const float /*blur*/)
478{
479}
480
482 const float /*blur*/)
483{
484}
485
487 const float /*width*/)
488{
489}
490
492 const float /*width*/)
493{
494}
495
497 const float /*width*/)
498{
499}
500
502 const float /*width*/)
503{
504}
505
507 const float /*fill*/)
508{
509}
510
512 const float /*time*/)
513{
514}
515
517 const int /*mode*/)
518{
519}
520
522 const int /*subimage*/)
523{
524}
525
530
532 ccl_private float *missing)
533{
534 opt->missingcolor = (const float *)missing;
535}
536
538 const int alphaindex,
539 const float missingalpha)
540{
541 float *m = (float *)(opt)->missingcolor;
542 if (m) {
543 m[alphaindex] = missingalpha;
544 }
545}
546
548 ccl_private void * /*opt*/)
549{
550}
551
552ccl_device_extern void osl_trace_set_mindist(ccl_private void * /*opt*/, float /*x*/) {}
553
554ccl_device_extern void osl_trace_set_maxdist(ccl_private void * /*opt*/, float /*x*/) {}
555
556ccl_device_extern void osl_trace_set_shade(ccl_private void * /*opt*/, int /*x*/) {}
557
559{
560}
561#endif
562
563#ifndef __KERNEL_GPU__
565#endif
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
#define printf
ccl_device_forceinline float3 dPdx(const ccl_private ShaderData *sd)
ccl_device_forceinline float3 dPdy(const ccl_private ShaderData *sd)
ccl_device_inline ProjectionTransform projection_identity()
#define kernel_assert(cond)
#define SHADER_NONE
#define ccl_private
#define ccl_device_extern
#define CCL_NAMESPACE_END
ccl_device_forceinline float3 make_float3(const float x, const float y, const float z)
float length(VecOp< float, D >) RET
CCL_NAMESPACE_BEGIN ccl_device_forceinline bool is_attribute_found(const ccl_private AttributeDescriptor &desc)
ccl_device_inline AttributeDescriptor find_attribute(const ccl_global AttributeMap *attributes_map, uint attr_offset, const int prim, const uint64_t id)
OSLClosureType
@ OSL_CLOSURE_MUL_ID
@ OSL_CLOSURE_ADD_ID
const char * DeviceString
CCL_NAMESPACE_BEGIN ccl_device_inline float2 zero_float2()
Definition math_float2.h:13
ccl_device_inline float3 one_float3()
Definition math_float3.h:26
CCL_NAMESPACE_BEGIN ccl_device_inline float3 zero_float3()
Definition math_float3.h:17
#define R
#define make_float2
ccl_device_extern void osl_texture_set_stblur(ccl_private OSLTextureOptions *, const float)
ccl_device_extern uint osl_range_check_err(const int indexvalue, const int length, DeviceString, ccl_private ShaderGlobals *, DeviceString, const int, DeviceString, const int, DeviceString, DeviceString)
ccl_device_extern void osl_texture_set_swrap_code(ccl_private OSLTextureOptions *, const int)
ccl_device_extern void osl_texture_set_fill(ccl_private OSLTextureOptions *, const float)
ccl_device_extern void osl_trace_set_traceset(ccl_private void *, const DeviceString)
ccl_device_extern void osl_printf(ccl_private ShaderGlobals *, DeviceString, void *)
ccl_device_extern void osl_warning(ccl_private ShaderGlobals *, DeviceString, void *)
ccl_device_extern ccl_private OSLClosure * osl_allocate_closure_component(ccl_private ShaderGlobals *sg, const int id, const int size)
ccl_device_extern void osl_init_trace_options(ccl_private void *, ccl_private void *)
ccl_device_extern void osl_texture_set_interp_code(ccl_private OSLTextureOptions *, const int)
ccl_device_extern void osl_texture_set_rblur(ccl_private OSLTextureOptions *, const float)
ccl_device_extern bool rs_get_texture_info(ccl_private ShaderGlobals *, RSDeviceString, ccl_private void *texture_handle, ccl_private void *, int, RSDeviceString dataname, TypeDesc datatype, ccl_private void *data, ccl_private void *)
ccl_device_extern void osl_texture_set_subimagename(ccl_private OSLTextureOptions *, DeviceString)
ccl_device_extern ccl_private OSLClosure * osl_add_closure_closure(ccl_private ShaderGlobals *sg, ccl_private OSLClosure *a, ccl_private OSLClosure *b)
ccl_device_extern void osl_texture_set_time(ccl_private OSLTextureOptions *, const float)
ccl_device_extern bool rs_environment(ccl_private ShaderGlobals *sg, RSDeviceString, ccl_private void *texture_handle, ccl_private void *, ccl_private OSLTextureOptions *opt, const ccl_private float3 *R, const ccl_private float3 *dRdx, const ccl_private float3 *dRdy, const int nchannels, ccl_private float *result, ccl_private float *, ccl_private float *, ccl_private void *)
long long RSTypeDesc
ccl_device_extern void osl_texture_set_subimage(ccl_private OSLTextureOptions *, const int)
ccl_device_extern void osl_texture_set_firstchannel(ccl_private OSLTextureOptions *, const int)
ccl_device_extern bool rs_trace(ccl_private ShaderGlobals *, ccl_private void *, const ccl_private float3 *, const ccl_private float3 *, const ccl_private float3 *, const ccl_private float3 *, const ccl_private float3 *, const ccl_private float3 *)
ccl_device_extern bool rs_texture3d(ccl_private ShaderGlobals *sg, RSDeviceString, ccl_private void *texture_handle, ccl_private void *, ccl_private OSLTextureOptions *, const ccl_private float3 *P, const ccl_private float3 *dPdx, const ccl_private float3 *dPdy, const ccl_private float3 *dPdz, const int nchannels, ccl_private float *result, ccl_private float *, ccl_private float *, ccl_private float *, ccl_private void *)
ccl_device_extern void osl_trace_set_maxdist(ccl_private void *, float)
ccl_device_extern void osl_texture_set_stwrap_code(ccl_private OSLTextureOptions *, const int)
ccl_device_extern void osl_trace_set_shade(ccl_private void *, int)
ccl_device_extern void osl_texture_set_swidth(ccl_private OSLTextureOptions *, const float)
ccl_device_extern bool osl_get_inverse_matrix(ccl_private ShaderGlobals *sg, ccl_private float *res, DeviceString to)
ccl_device_extern bool rs_get_texture_info_st(ccl_private ShaderGlobals *, RSDeviceString, ccl_private void *texture_handle, const float s, const float t, ccl_private void *, int, RSDeviceString dataname, TypeDesc datatype, ccl_private void *data, ccl_private void *)
ccl_device_extern bool rs_pointcloud_write(ccl_private ShaderGlobals *, RSDeviceString, const ccl_private float3 *, int, const ccl_private DeviceString *, const ccl_private TypeDesc *, const ccl_private void **)
ccl_device_extern void osl_trace_set_mindist(ccl_private void *, float)
ccl_device_extern void osl_texture_set_tblur(ccl_private OSLTextureOptions *, const float)
ccl_device_extern int rs_pointcloud_get(ccl_private ShaderGlobals *, RSDeviceString, const ccl_private int *, int, RSDeviceString, TypeDesc, ccl_private void *)
ccl_device_extern int rs_pointcloud_search(ccl_private ShaderGlobals *, RSDeviceString, const ccl_private float3 *, float, int, bool, ccl_private int *, ccl_private float *, int)
ccl_device_extern ccl_private OSLClosure * osl_allocate_weighted_closure_component(ccl_private ShaderGlobals *sg, const int id, const int size, const ccl_private float3 *weight)
ccl_device_extern void osl_texture_set_missingcolor_alpha(ccl_private OSLTextureOptions *opt, const int alphaindex, const float missingalpha)
ccl_device_extern void osl_texture_set_rwrap_code(ccl_private OSLTextureOptions *, const int)
ccl_device_extern void osl_texture_set_sblur(ccl_private OSLTextureOptions *, const float)
ccl_device_extern ccl_private OSLClosure * osl_mul_closure_float(ccl_private ShaderGlobals *sg, ccl_private OSLClosure *a, const float weight)
ccl_device_extern bool rs_trace_get(ccl_private ShaderGlobals *, RSDeviceString, TypeDesc, ccl_private void *, bool)
ccl_device_extern void osl_texture_set_stwidth(ccl_private OSLTextureOptions *, const float)
ccl_device_extern void osl_texture_set_twidth(ccl_private OSLTextureOptions *, const float)
ccl_device_extern int osl_texture_decode_wrapmode(DeviceString)
CCL_NAMESPACE_BEGIN ccl_device_extern ccl_private void * rs_allocate_closure(ccl_private ShaderGlobals *sg, const size_t size, const size_t alignment)
ccl_device_extern void osl_error(ccl_private ShaderGlobals *, DeviceString, void *)
ccl_device_extern void osl_texture_set_twrap_code(ccl_private OSLTextureOptions *, const int)
ccl_device_extern void osl_texture_set_missingcolor_arena(ccl_private OSLTextureOptions *opt, ccl_private float *missing)
ccl_device_extern bool rs_texture(ccl_private ShaderGlobals *sg, RSDeviceString, ccl_private void *texture_handle, ccl_private void *, ccl_private OSLTextureOptions *opt, const float s, const float t, const float dsdx, const float dtdx, const float dsdy, const float dtdy, const int nchannels, ccl_private float *result, ccl_private float *, ccl_private float *, ccl_private void *)
ccl_device_extern void osl_fprintf(ccl_private ShaderGlobals *, DeviceString, DeviceString, void *)
ccl_device_extern bool osl_get_attribute(ccl_private ShaderGlobals *sg, const int derivatives, DeviceString object_name, DeviceString name, const int, const int, const RSTypeDesc type_abi, ccl_private void *res)
ccl_device_extern ccl_private OSLClosure * osl_mul_closure_color(ccl_private ShaderGlobals *sg, ccl_private OSLClosure *a, const ccl_private float3 *weight)
ccl_device_extern bool rend_get_userdata(RSDeviceString name, ccl_private void *data, int data_size, const TypeDesc &type, int)
ccl_device_extern void osl_texture_set_rwidth(ccl_private OSLTextureOptions *, const float)
ccl_device_extern bool osl_get_matrix(ccl_private ShaderGlobals *sg, ccl_private float *res, DeviceString from)
ccl_device_forceinline void copy_matrix(ccl_private float *res, const Transform &tfm)
ccl_device_inline bool osl_shared_get_object_standard_attribute(KernelGlobals kg, ccl_private ShaderGlobals *sg, ccl_private ShaderData *sd, DeviceString name, const TypeDesc type, bool derivatives, ccl_private void *val)
ccl_device_inline bool osl_shared_get_named_matrix(KernelGlobals kg, DeviceString from, ccl_private float *res)
ccl_device bool osl_shared_environment(KernelGlobals kg, ccl_private ShaderGlobals *sg, ccl_private void *texture_handle, ccl_private OSLTextureOptions *opt, float3 R, float3 dRdx, float3 dRdy, int nchannels, float *result)
ccl_device bool osl_shared_get_texture_info(KernelGlobals kg, ccl_private void *texture_handle, const float2 uv, const bool use_uv, DeviceString dataname, const TypeDesc datatype, void *data)
ccl_device_inline bool osl_shared_get_camera_attribute(KernelGlobals kg, ccl_private ShaderGlobals *sg, DeviceString name, const TypeDesc type, bool derivatives, ccl_private void *val)
ccl_device_inline bool osl_shared_get_object_matrix(KernelGlobals kg, ccl_private const ShaderData *sd, ccl_private float *res)
ccl_device bool osl_shared_texture3d(KernelGlobals kg, ccl_private ShaderGlobals *sg, ccl_private void *texture_handle, float3 P, float3, float3, float3, int nchannels, float *result)
ccl_device_inline bool osl_shared_get_object_attribute(KernelGlobals kg, ccl_private ShaderData *sd, const AttributeDescriptor &desc, const TypeDesc type, bool derivatives, ccl_private void *val)
ccl_device bool osl_shared_texture(KernelGlobals kg, ccl_private ShaderGlobals *sg, ccl_private void *texture_handle, ccl_private OSLTextureOptions *opt, float s, float t, float dsdx, float dtdx, float dsdy, float dtdy, int nchannels, float *result)
ccl_device_inline bool osl_shared_get_named_inverse_matrix(KernelGlobals kg, DeviceString to, ccl_private float *res)
ccl_device_inline bool osl_shared_get_object_inverse_matrix(KernelGlobals kg, ccl_private const ShaderData *sd, ccl_private float *res)
DeviceString val