Blender  V3.3
services.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #ifndef __OSL_SERVICES_H__
5 #define __OSL_SERVICES_H__
6 
7 /* OSL Render Services
8  *
9  * Implementation of OSL render services, to retriever matrices, attributes,
10  * textures and point clouds. In principle this should only be accessing
11  * kernel data, but currently we also reach back into the Scene to retrieve
12  * attributes.
13  */
14 
15 #include <OSL/oslclosure.h>
16 #include <OSL/oslexec.h>
17 #include <OSL/rendererservices.h>
18 
19 #ifdef WITH_PTEX
20 class PtexCache;
21 #endif
22 
24 
25 class Object;
26 class Scene;
27 class Shader;
28 struct ShaderData;
29 struct float3;
30 struct KernelGlobalsCPU;
31 
32 /* OSL Texture Handle
33  *
34  * OSL texture lookups are string based. If those strings are known at compile
35  * time, the OSL compiler can cache a texture handle to use instead of a string.
36  *
37  * By default it uses TextureSystem::TextureHandle. But since we want to support
38  * different kinds of textures and color space conversions, this is our own handle
39  * with additional data.
40  *
41  * These are stored in a concurrent hash map, because OSL can compile multiple
42  * shaders in parallel.
43  *
44  * NOTE: The svm_slots array contains a compressed mapping of tile to svm_slot pairs
45  * stored as follows: x:tile_a, y:svm_slot_a, z:tile_b, w:svm_slot_b etc. */
46 
47 struct OSLTextureHandle : public OIIO::RefCnt {
48  enum Type { OIIO, SVM, IES, BEVEL, AO };
49 
52  {
53  }
54 
55  OSLTextureHandle(Type type = OIIO, int svm_slot = -1)
56  : OSLTextureHandle(type, {make_int4(0, svm_slot, -1, -1)})
57  {
58  }
59 
62  OSL::TextureSystem::TextureHandle *oiio_handle;
63  ColorSpaceProcessor *processor;
64 };
65 
66 typedef OIIO::intrusive_ptr<OSLTextureHandle> OSLTextureHandleRef;
67 typedef OIIO::unordered_map_concurrent<ustring, OSLTextureHandleRef, ustringHash>
69 
70 /* OSL Render Services
71  *
72  * Interface for OSL to access attributes, textures and other scene data. */
73 
74 class OSLRenderServices : public OSL::RendererServices {
75  public:
76  OSLRenderServices(OSL::TextureSystem *texture_system);
78 
79  bool get_matrix(OSL::ShaderGlobals *sg,
80  OSL::Matrix44 &result,
81  OSL::TransformationPtr xform,
82  float time) override;
83  bool get_inverse_matrix(OSL::ShaderGlobals *sg,
84  OSL::Matrix44 &result,
85  OSL::TransformationPtr xform,
86  float time) override;
87 
88  bool get_matrix(OSL::ShaderGlobals *sg,
89  OSL::Matrix44 &result,
90  ustring from,
91  float time) override;
92  bool get_inverse_matrix(OSL::ShaderGlobals *sg,
93  OSL::Matrix44 &result,
94  ustring to,
95  float time) override;
96 
97  bool get_matrix(OSL::ShaderGlobals *sg,
98  OSL::Matrix44 &result,
99  OSL::TransformationPtr xform) override;
100  bool get_inverse_matrix(OSL::ShaderGlobals *sg,
101  OSL::Matrix44 &result,
102  OSL::TransformationPtr xform) override;
103 
104  bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from) override;
105  bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, ustring from) override;
106 
107  bool get_array_attribute(OSL::ShaderGlobals *sg,
108  bool derivatives,
109  ustring object,
110  TypeDesc type,
111  ustring name,
112  int index,
113  void *val) override;
114  bool get_attribute(OSL::ShaderGlobals *sg,
115  bool derivatives,
116  ustring object,
117  TypeDesc type,
118  ustring name,
119  void *val) override;
120  bool get_attribute(ShaderData *sd,
121  bool derivatives,
122  ustring object_name,
123  TypeDesc type,
124  ustring name,
125  void *val);
126 
127  bool get_userdata(
128  bool derivatives, ustring name, TypeDesc type, OSL::ShaderGlobals *sg, void *val) override;
129 
130  int pointcloud_search(OSL::ShaderGlobals *sg,
131  ustring filename,
132  const OSL::Vec3 &center,
133  float radius,
134  int max_points,
135  bool sort,
136  size_t *out_indices,
137  float *out_distances,
138  int derivs_offset) override;
139 
140  int pointcloud_get(OSL::ShaderGlobals *sg,
141  ustring filename,
142  size_t *indices,
143  int count,
144  ustring attr_name,
145  TypeDesc attr_type,
146  void *out_data) override;
147 
148  bool pointcloud_write(OSL::ShaderGlobals *sg,
149  ustring filename,
150  const OSL::Vec3 &pos,
151  int nattribs,
152  const ustring *names,
153  const TypeDesc *types,
154  const void **data) override;
155 
156  bool trace(TraceOpt &options,
157  OSL::ShaderGlobals *sg,
158  const OSL::Vec3 &P,
159  const OSL::Vec3 &dPdx,
160  const OSL::Vec3 &dPdy,
161  const OSL::Vec3 &R,
162  const OSL::Vec3 &dRdx,
163  const OSL::Vec3 &dRdy) override;
164 
165  bool getmessage(OSL::ShaderGlobals *sg,
166  ustring source,
167  ustring name,
168  TypeDesc type,
169  void *val,
170  bool derivatives) override;
171 
172 #if OSL_LIBRARY_VERSION_CODE >= 11100
173  TextureSystem::TextureHandle *get_texture_handle(ustring filename,
174  OSL::ShadingContext *context) override;
175 #else
176  TextureSystem::TextureHandle *get_texture_handle(ustring filename) override;
177 #endif
178 
179  bool good(TextureSystem::TextureHandle *texture_handle) override;
180 
181  bool texture(ustring filename,
182  TextureSystem::TextureHandle *texture_handle,
183  TexturePerthread *texture_thread_info,
184  TextureOpt &options,
185  OSL::ShaderGlobals *sg,
186  float s,
187  float t,
188  float dsdx,
189  float dtdx,
190  float dsdy,
191  float dtdy,
192  int nchannels,
193  float *result,
194  float *dresultds,
195  float *dresultdt,
196  ustring *errormessage) override;
197 
198  bool texture3d(ustring filename,
199  TextureHandle *texture_handle,
200  TexturePerthread *texture_thread_info,
201  TextureOpt &options,
202  OSL::ShaderGlobals *sg,
203  const OSL::Vec3 &P,
204  const OSL::Vec3 &dPdx,
205  const OSL::Vec3 &dPdy,
206  const OSL::Vec3 &dPdz,
207  int nchannels,
208  float *result,
209  float *dresultds,
210  float *dresultdt,
211  float *dresultdr,
212  ustring *errormessage) override;
213 
214  bool environment(ustring filename,
215  TextureHandle *texture_handle,
216  TexturePerthread *texture_thread_info,
217  TextureOpt &options,
218  OSL::ShaderGlobals *sg,
219  const OSL::Vec3 &R,
220  const OSL::Vec3 &dRdx,
221  const OSL::Vec3 &dRdy,
222  int nchannels,
223  float *result,
224  float *dresultds,
225  float *dresultdt,
226  ustring *errormessage) override;
227 
228 #if OSL_LIBRARY_VERSION_CODE >= 11100
229  bool get_texture_info(ustring filename,
230  TextureHandle *texture_handle,
231  TexturePerthread *texture_thread_info,
232  OSL::ShadingContext *shading_context,
233  int subimage,
234  ustring dataname,
235  TypeDesc datatype,
236  void *data,
237  ustring *errormessage) override;
238 #else
239  bool get_texture_info(OSL::ShaderGlobals *sg,
240  ustring filename,
241  TextureHandle *texture_handle,
242  int subimage,
243  ustring dataname,
244  TypeDesc datatype,
245  void *data) override;
246 #endif
247 
248  static bool get_background_attribute(const KernelGlobalsCPU *kg,
249  ShaderData *sd,
250  ustring name,
251  TypeDesc type,
252  bool derivatives,
253  void *val);
254  static bool get_object_standard_attribute(const KernelGlobalsCPU *kg,
255  ShaderData *sd,
256  ustring name,
257  TypeDesc type,
258  bool derivatives,
259  void *val);
260 
261  static ustring u_distance;
262  static ustring u_index;
263  static ustring u_world;
264  static ustring u_camera;
265  static ustring u_screen;
266  static ustring u_raster;
267  static ustring u_ndc;
268  static ustring u_object_location;
269  static ustring u_object_color;
270  static ustring u_object_alpha;
271  static ustring u_object_index;
272  static ustring u_geom_dupli_generated;
273  static ustring u_geom_dupli_uv;
274  static ustring u_material_index;
275  static ustring u_object_random;
276  static ustring u_particle_index;
277  static ustring u_particle_random;
278  static ustring u_particle_age;
279  static ustring u_particle_lifetime;
280  static ustring u_particle_location;
281  static ustring u_particle_rotation;
282  static ustring u_particle_size;
283  static ustring u_particle_velocity;
285  static ustring u_geom_numpolyvertices;
286  static ustring u_geom_trianglevertices;
287  static ustring u_geom_polyvertices;
288  static ustring u_geom_name;
289  static ustring u_geom_undisplaced;
290  static ustring u_is_smooth;
291  static ustring u_is_curve;
292  static ustring u_curve_thickness;
293  static ustring u_curve_length;
294  static ustring u_curve_tangent_normal;
295  static ustring u_curve_random;
296  static ustring u_is_point;
297  static ustring u_point_position;
298  static ustring u_point_radius;
299  static ustring u_point_random;
300  static ustring u_normal_map_normal;
301  static ustring u_path_ray_length;
302  static ustring u_path_ray_depth;
303  static ustring u_path_diffuse_depth;
304  static ustring u_path_glossy_depth;
305  static ustring u_path_transparent_depth;
307  static ustring u_trace;
308  static ustring u_hit;
309  static ustring u_hitdist;
310  static ustring u_N;
311  static ustring u_Ng;
312  static ustring u_P;
313  static ustring u_I;
314  static ustring u_u;
315  static ustring u_v;
316  static ustring u_empty;
317  static ustring u_at_bevel;
318  static ustring u_at_ao;
319 
320  /* Texture system and texture handle map are part of the services instead of
321  * globals to be shared between different render sessions. This saves memory,
322  * and is required because texture handles are cached as part of the shared
323  * shading system. */
324  OSL::TextureSystem *texture_system;
326 };
327 
329 
330 #endif /* __OSL_SERVICES_H__ */
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
static ustring u_path_transmission_depth
Definition: services.h:306
static ustring u_particle_location
Definition: services.h:280
bool pointcloud_write(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 &pos, int nattribs, const ustring *names, const TypeDesc *types, const void **data) override
Definition: services.cpp:1644
static ustring u_object_alpha
Definition: services.h:270
static ustring u_u
Definition: services.h:314
bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override
Definition: services.cpp:177
static ustring u_raster
Definition: services.h:266
static ustring u_empty
Definition: services.h:316
static ustring u_curve_thickness
Definition: services.h:292
static ustring u_ndc
Definition: services.h:267
static ustring u_particle_index
Definition: services.h:276
static ustring u_point_position
Definition: services.h:297
static ustring u_point_radius
Definition: services.h:298
static bool get_object_standard_attribute(const KernelGlobalsCPU *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val)
Definition: services.cpp:859
static ustring u_curve_tangent_normal
Definition: services.h:294
static ustring u_path_diffuse_depth
Definition: services.h:303
static ustring u_normal_map_normal
Definition: services.h:300
static ustring u_index
Definition: services.h:262
bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override
Definition: services.cpp:139
static ustring u_curve_length
Definition: services.h:293
static ustring u_hit
Definition: services.h:308
static ustring u_material_index
Definition: services.h:274
static ustring u_path_ray_depth
Definition: services.h:302
static ustring u_point_random
Definition: services.h:299
static ustring u_is_smooth
Definition: services.h:290
static ustring u_object_location
Definition: services.h:268
static ustring u_curve_random
Definition: services.h:295
int pointcloud_get(OSL::ShaderGlobals *sg, ustring filename, size_t *indices, int count, ustring attr_name, TypeDesc attr_type, void *out_data) override
Definition: services.cpp:1633
static ustring u_particle_rotation
Definition: services.h:281
OSL::TextureSystem * texture_system
Definition: services.h:324
static ustring u_particle_velocity
Definition: services.h:283
static ustring u_particle_angular_velocity
Definition: services.h:284
static ustring u_N
Definition: services.h:310
static ustring u_path_glossy_depth
Definition: services.h:304
static ustring u_hitdist
Definition: services.h:309
static bool get_background_attribute(const KernelGlobalsCPU *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val)
Definition: services.cpp:1031
static ustring u_geom_dupli_uv
Definition: services.h:273
static ustring u_I
Definition: services.h:313
static ustring u_geom_undisplaced
Definition: services.h:289
OSLTextureHandleMap textures
Definition: services.h:325
static ustring u_geom_numpolyvertices
Definition: services.h:285
static ustring u_v
Definition: services.h:315
static ustring u_world
Definition: services.h:263
static ustring u_object_random
Definition: services.h:275
static ustring u_at_bevel
Definition: services.h:317
static ustring u_path_ray_length
Definition: services.h:301
bool getmessage(OSL::ShaderGlobals *sg, ustring source, ustring name, TypeDesc type, void *val, bool derivatives) override
Definition: services.cpp:1723
static ustring u_screen
Definition: services.h:265
bool environment(ustring filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy, int nchannels, float *result, float *dresultds, float *dresultdt, ustring *errormessage) override
Definition: services.cpp:1529
bool get_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object, TypeDesc type, ustring name, void *val) override
Definition: services.cpp:1116
static ustring u_particle_random
Definition: services.h:277
static ustring u_camera
Definition: services.h:264
static ustring u_particle_age
Definition: services.h:278
static ustring u_P
Definition: services.h:312
OSLRenderServices(OSL::TextureSystem *texture_system)
Definition: services.cpp:127
bool texture(ustring filename, TextureSystem::TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, float s, float t, float dsdx, float dtdx, float dsdy, float dtdy, int nchannels, float *result, float *dresultds, float *dresultdt, ustring *errormessage) override
Definition: services.cpp:1242
bool get_texture_info(OSL::ShaderGlobals *sg, ustring filename, TextureHandle *texture_handle, int subimage, ustring dataname, TypeDesc datatype, void *data) override
Definition: services.cpp:1599
static ustring u_object_index
Definition: services.h:271
static ustring u_is_point
Definition: services.h:296
static ustring u_path_transparent_depth
Definition: services.h:305
TextureSystem::TextureHandle * get_texture_handle(ustring filename) override
Definition: services.cpp:1199
bool trace(TraceOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy) override
Definition: services.cpp:1655
static ustring u_particle_lifetime
Definition: services.h:279
bool texture3d(ustring filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &dPdz, int nchannels, float *result, float *dresultds, float *dresultdt, float *dresultdr, ustring *errormessage) override
Definition: services.cpp:1419
static ustring u_is_curve
Definition: services.h:291
static ustring u_object_color
Definition: services.h:269
static ustring u_distance
Definition: services.h:261
static ustring u_Ng
Definition: services.h:311
static ustring u_at_ao
Definition: services.h:318
static ustring u_trace
Definition: services.h:307
bool get_userdata(bool derivatives, ustring name, TypeDesc type, OSL::ShaderGlobals *sg, void *val) override
Definition: services.cpp:1188
static ustring u_geom_trianglevertices
Definition: services.h:286
bool get_array_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object, TypeDesc type, ustring name, int index, void *val) override
Definition: services.cpp:387
static ustring u_geom_polyvertices
Definition: services.h:287
static ustring u_particle_size
Definition: services.h:282
int pointcloud_search(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 &center, float radius, int max_points, bool sort, size_t *out_indices, float *out_distances, int derivs_offset) override
Definition: services.cpp:1620
static ustring u_geom_dupli_generated
Definition: services.h:272
bool good(TextureSystem::TextureHandle *texture_handle) override
Definition: services.cpp:1229
static ustring u_geom_name
Definition: services.h:288
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
CCL_NAMESPACE_BEGIN struct Options options
StackEntry * from
double time
uint pos
int count
ccl_gpu_kernel_postfix int ccl_global int * indices
ShaderData
Definition: kernel/types.h:925
static char ** names
Definition: makesdna.c:65
static char ** types
Definition: makesdna.c:67
static float P(float k)
Definition: math_interp.c:25
#define R
#define make_int4(x, y, z, w)
Definition: metal/compat.h:208
Eigen::Vector3d Vec3
Definition: numeric.h:106
static const char * dataname(short id_code)
Definition: readfile.c:3021
OIIO::unordered_map_concurrent< ustring, OSLTextureHandleRef, ustringHash > OSLTextureHandleMap
Definition: services.h:68
OIIO::intrusive_ptr< OSLTextureHandle > OSLTextureHandleRef
Definition: services.h:66
OSLTextureHandle(Type type=OIIO, int svm_slot=-1)
Definition: services.h:55
ColorSpaceProcessor * processor
Definition: services.h:63
OSLTextureHandle(Type type, const vector< int4 > &svm_slots)
Definition: services.h:50
OSL::TextureSystem::TextureHandle * oiio_handle
Definition: services.h:62
vector< int4 > svm_slots
Definition: services.h:61