9#if (defined(__GNUC__) && !defined(__clang__)) && defined(NDEBUG)
10# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
11# pragma GCC diagnostic ignored "-Wuninitialized"
57 memcpy((
void *)&m, &t,
sizeof(m));
63 memcpy((
void *)&m, &t,
sizeof(m));
128 : OSL::RendererServices(texture_system), device_type_(device_type)
135 VLOG_INFO <<
"OSL texture system stats:\n" << m_texturesys->getstats();
142 if (feature ==
"OptiX") {
151 OSL::Matrix44 &result,
152 OSL::TransformationPtr xform,
160 int object = sd->object;
163#ifdef __OBJECT_MOTION__
166 if (time == sd->time) {
191 OSL::Matrix44 &result,
192 OSL::TransformationPtr xform,
200 int object = sd->object;
203#ifdef __OBJECT_MOTION__
206 if (time == sd->time) {
231 OSL::Matrix44 &result,
255 result.makeIdentity();
263 OSL::Matrix44 &result,
287 result.makeIdentity();
295 OSL::Matrix44 &result,
296 OSL::TransformationPtr xform)
303 int object = sd->object;
323 OSL::Matrix44 &result,
324 OSL::TransformationPtr xform)
331 int object = sd->object;
351 OSL::Matrix44 &result,
378 OSL::Matrix44 &result,
418 float *fval = (
float *)val;
437 else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector ||
438 type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor)
440 float *fval = (
float *)val;
458 else if (type == TypeDesc::TypeFloat) {
459 float *fval = (
float *)val;
489 float *fval = (
float *)val;
508 else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector ||
509 type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor)
511 float *fval = (
float *)val;
529 else if (type == TypeDesc::TypeFloat) {
530 float *fval = (
float *)val;
565 float *fval = (
float *)val;
585 else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector ||
586 type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor)
603 else if (type == TypeDesc::TypeFloat) {
631 float *fval = (
float *)val;
650 else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector ||
651 type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor)
653 float *fval = (
float *)val;
670 else if (type == TypeDesc::TypeFloat) {
671 float *fval = (
float *)val;
698 if (type.basetype == TypeDesc::INT && type.aggregate == TypeDesc::SCALAR && type.arraylen == 0) {
699 int *ival = (
int *)val;
715 if (type.basetype == TypeDesc::STRING && type.aggregate == TypeDesc::SCALAR &&
718 ustring *sval = (ustring *)val;
734 if (type.vecsemantics == TypeDesc::POINT && type.arraylen >= 3) {
735 float *fval = (
float *)val;
749 if (type.arraylen > 3) {
750 memset(fval + 3 * 3, 0,
sizeof(
float) * 3 * (type.arraylen - 3));
753 memset(fval + type.arraylen * 3, 0,
sizeof(
float) * 2 * 3 * type.arraylen);
764 if (type == TypeDesc::TypeMatrix) {
782 if (primitive_is_volume_attribute(sd, desc)) {
783 fval[0] = primitive_volume_attribute_float3(kg, sd, desc);
788 memset(fval, 0,
sizeof(fval));
790 kg, sd, desc, (derivatives) ? &fval[1] :
NULL, (derivatives) ? &fval[2] :
NULL);
796 if (primitive_is_volume_attribute(sd, desc)) {
797 assert(!
"Float2 attribute not support for volumes");
805 kg, sd, desc, (derivatives) ? &fval[1] :
NULL, (derivatives) ? &fval[2] :
NULL);
812 if (primitive_is_volume_attribute(sd, desc)) {
813 memset(fval, 0,
sizeof(fval));
814 fval[0] = primitive_volume_attribute_float(kg, sd, desc);
820 kg, sd, desc, (derivatives) ? &fval[1] :
NULL, (derivatives) ? &fval[2] :
NULL);
827 if (primitive_is_volume_attribute(sd, desc)) {
828 memset(fval, 0,
sizeof(fval));
829 fval[0] = primitive_volume_attribute_float4(kg, sd, desc);
835 kg, sd, desc, (derivatives) ? &fval[1] :
NULL, (derivatives) ? &fval[2] :
NULL);
970 ustring object_name = kg->osl->object_names[sd->object];
984 float f = curve_thickness(kg, sd);
988 float3 f = curve_tangent_normal(kg, sd);
992 float f = curve_random(kg, sd);
1003 float f = point_radius(kg, sd);
1007 float3 f = point_position(kg, sd);
1011 float f = point_random(kg, sd);
1038 float f = sd->ray_length;
1045 int f = (
state) ?
state->path.bounce : (shadow_state) ? shadow_state->shadow_path.bounce : 0;
1052 int f = (
state) ?
state->path.diffuse_bounce :
1053 (shadow_state) ? shadow_state->shadow_path.diffuse_bounce :
1061 int f = (
state) ?
state->path.glossy_bounce :
1062 (shadow_state) ? shadow_state->shadow_path.glossy_bounce :
1070 int f = (
state) ?
state->path.transmission_bounce :
1071 (shadow_state) ? shadow_state->shadow_path.transmission_bounce :
1079 int f = (
state) ?
state->path.transparent_bounce :
1080 (shadow_state) ? shadow_state->shadow_path.transparent_bounce :
1084 else if (name ==
u_ndc) {
1086 OSLThreadData *tdata = kg->osl_tdata;
1087 OSL::ShaderGlobals *globals = &tdata->globals;
1124 if (sg ==
NULL || sg->renderstate ==
NULL) {
1129 return get_attribute(sd, derivatives, object_name, type, name, val);
1144 OSLGlobals::ObjectNameMap::iterator it = kg->osl->object_name_map.find(object_name);
1146 if (it == kg->osl->object_name_map.end()) {
1150 object = it->second;
1153 object = sd->object;
1158 kg,
object, sd->prim,
object == sd->object ? sd->type :
PRIMITIVE_NONE, name.hash());
1174#if OSL_LIBRARY_VERSION_CODE >= 11304
1176 OSL::ShadingContext *context,
1177 const TextureOpt *opt)
1183 OSL::ShadingContext *,
1185#elif OSL_LIBRARY_VERSION_CODE >= 11100
1187 OSL::ShadingContext *)
1193 OSLTextureHandleMap::iterator it = textures.find(filename);
1197 if (it != textures.end()) {
1199 return reinterpret_cast<TextureSystem::TextureHandle *
>(it->second.get());
1204 OSL::TextureSystem *ts = m_texturesys;
1205 TextureSystem::TextureHandle *handle = ts->get_texture_handle(
to_ustring(filename));
1206 if (handle ==
NULL) {
1211 if (it == textures.end()) {
1213 it = textures.find(filename);
1217 it->second->oiio_handle = handle;
1218 return reinterpret_cast<TextureSystem::TextureHandle *
>(it->second.get());
1222 if (it != textures.end()) {
1223 switch (it->second->type) {
1227 if (!it->second->handle.empty() && it->second->handle.get_manager() != image_manager) {
1232 it->second->svm_slots[0].y);
1234 if (!it->second->handle.empty() && it->second->handle.get_manager() != image_manager) {
1239 it->second->svm_slots[0].y);
1241 return reinterpret_cast<TextureSystem::TextureHandle *
>(
1244 return reinterpret_cast<TextureSystem::TextureHandle *
>(
1249 if (!image_manager) {
1255 if (handle.empty()) {
1272 if (handle->oiio_handle) {
1273 OSL::TextureSystem *ts = m_texturesys;
1274 return ts->good(handle->oiio_handle);
1282 TextureHandle *texture_handle,
1283 TexturePerthread *texture_thread_info,
1285 OSL::ShaderGlobals *sg,
1302 bool status =
false;
1304 switch (texture_type) {
1306#ifdef __SHADER_RAYTRACE__
1308 if (nchannels >= 3) {
1311 int num_samples = (
int)s;
1313 float3 N = svm_bevel(kernel_globals,
state, sd, radius, num_samples);
1324#ifdef __SHADER_RAYTRACE__
1328 int num_samples = (
int)s;
1341 result[0] = svm_ao(kernel_globals,
state, sd,
N, radius, num_samples, flags);
1349 if (handle->svm_slots[0].w == -1) {
1351 id = handle->svm_slots[0].y;
1357 int tile = 1001 + 10 * ty + tx;
1358 for (
int4 tile_node : handle->svm_slots) {
1359 if (tile_node.x ==
tile) {
1363 if (tile_node.z ==
tile) {
1381 result[0] = rgba[0];
1382 if (nchannels > 1) {
1383 result[1] = rgba[1];
1385 if (nchannels > 2) {
1386 result[2] = rgba[2];
1388 if (nchannels > 3) {
1389 result[3] = rgba[3];
1402 OSL::TextureSystem *ts = m_texturesys;
1404 if (handle && handle->oiio_handle) {
1405 if (texture_thread_info ==
NULL) {
1406 OSLThreadData *tdata = kernel_globals->osl_tdata;
1407 texture_thread_info = tdata->oiio_thread_info;
1410 status = ts->texture(handle->oiio_handle,
1411 texture_thread_info,
1444 else if (handle && handle->processor) {
1452 if (nchannels == 3 || nchannels == 4) {
1457 if (nchannels == 4) {
1467 TextureHandle *texture_handle,
1468 TexturePerthread *texture_thread_info,
1470 OSL::ShaderGlobals *sg,
1472 const OSL::Vec3 &dPdx,
1473 const OSL::Vec3 &dPdy,
1474 const OSL::Vec3 &dPdz,
1484 bool status =
false;
1486 switch (texture_type) {
1491 int slot = handle->svm_slots[0].y;
1495 result[0] = rgba[0];
1496 if (nchannels > 1) {
1497 result[1] = rgba[1];
1499 if (nchannels > 2) {
1500 result[2] = rgba[2];
1502 if (nchannels > 3) {
1503 result[3] = rgba[3];
1510 OSL::TextureSystem *ts = m_texturesys;
1512 if (handle && handle->oiio_handle) {
1513 if (texture_thread_info ==
NULL) {
1516 OSLThreadData *tdata = kernel_globals->osl_tdata;
1517 texture_thread_info = tdata->oiio_thread_info;
1520 status = ts->texture3d(handle->oiio_handle,
1521 texture_thread_info,
1552 else if (handle && handle->processor) {
1566 if (nchannels == 3 || nchannels == 4) {
1571 if (nchannels == 4) {
1581 TextureHandle *texture_handle,
1582 TexturePerthread *thread_info,
1584 OSL::ShaderGlobals *sg,
1586 const OSL::Vec3 &dRdx,
1587 const OSL::Vec3 &dRdy,
1595 OSL::TextureSystem *ts = m_texturesys;
1596 bool status =
false;
1598 if (handle && handle->oiio_handle) {
1599 if (thread_info ==
NULL) {
1602 OSLThreadData *tdata = kernel_globals->osl_tdata;
1603 thread_info = tdata->oiio_thread_info;
1606 status = ts->environment(handle->oiio_handle,
1618 status = ts->environment(
1623 if (nchannels == 3 || nchannels == 4) {
1628 if (nchannels == 4) {
1633 else if (handle && handle->processor) {
1640#if OSL_LIBRARY_VERSION_CODE >= 11304
1642 TextureHandle *texture_handle,
1643 TexturePerthread *texture_thread_info,
1644 OSL::ShaderGlobals *,
1650#elif OSL_LIBRARY_VERSION_CODE >= 11100
1652 TextureHandle *texture_handle,
1653 TexturePerthread *texture_thread_info,
1654 OSL::ShadingContext *,
1663 TextureHandle *texture_handle,
1678 OSL::TextureSystem *ts = m_texturesys;
1679#if OSL_LIBRARY_VERSION_CODE >= 11100
1680 if (handle->oiio_handle) {
1681 return ts->get_texture_info(
1682 handle->oiio_handle, texture_thread_info, subimage,
to_ustring(dataname), datatype,
data);
1687 return ts->get_texture_info(
1694 const OSL::Vec3 ¢er,
1698 size_t *out_indices,
1699 float *out_distances,
1718 const OSL::Vec3 &
pos,
1728 OSL::ShaderGlobals *sg,
1730 const OSL::Vec3 &dPdx,
1731 const OSL::Vec3 &dPdy,
1733 const OSL::Vec3 &dRdx,
1734 const OSL::Vec3 &dRdy)
1746 ray.time = sd->time;
1753 if (
options.mindist == 0.0f) {
1755 if (ray.P == sd->P) {
1756 ray.self.object = sd->object;
1757 ray.self.prim = sd->prim;
1762 ray.P +=
options.mindist * ray.D;
1776 OSLTraceData *tracedata = (OSLTraceData *)sg->tracedata;
1777 tracedata->ray = ray;
1778 tracedata->setup =
false;
1779 tracedata->init =
true;
1780 tracedata->hit =
false;
1781 tracedata->sd.osl_globals = sd->osl_globals;
1792 tracedata->hit =
scene_intersect(kg, &ray, visibility, &tracedata->isect);
1793 return tracedata->hit;
1803 OSLTraceData *tracedata = (OSLTraceData *)sg->tracedata;
1805 if (source ==
u_trace && tracedata->init) {
1806 if (name ==
u_hit) {
1809 else if (tracedata->hit) {
1811 float f[3] = {tracedata->isect.t, 0.0f, 0.0f};
1818 if (!tracedata->setup) {
1821 tracedata->setup =
true;
1827 else if (name ==
u_Ng) {
1830 else if (name ==
u_P) {
1835 else if (name ==
u_I) {
1840 else if (name ==
u_u) {
1841 float f[3] = {sd->u, sd->du.dx, sd->du.dy};
1844 else if (name ==
u_v) {
1845 float f[3] = {sd->v, sd->dv.dx, sd->dv.dy};
static void to_scene_linear(ustring colorspace, T *pixels, size_t num_pixels, bool is_rgba, bool compress_as_srgb)
static ustring u_path_transmission_depth
static ustring u_particle_location
static ImageManager * image_manager
static ustring u_object_alpha
bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override
static ustring u_curve_thickness
static ustring u_particle_index
bool get_array_attribute(OSL::ShaderGlobals *sg, bool derivatives, OSLUStringHash object, TypeDesc type, OSLUStringHash name, int index, void *val) override
static ustring u_point_position
static ustring u_point_radius
static ustring u_curve_tangent_normal
int supports(string_view feature) const override
static ustring u_path_diffuse_depth
static ustring u_normal_map_normal
bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override
static ustring u_curve_length
bool get_userdata(bool derivatives, OSLUStringHash name, TypeDesc type, OSL::ShaderGlobals *sg, void *val) override
static ustring u_material_index
static ustring u_path_ray_depth
static ustring u_point_random
bool getmessage(OSL::ShaderGlobals *sg, OSLUStringHash source, OSLUStringHash name, TypeDesc type, void *val, bool derivatives) override
static bool get_object_standard_attribute(const KernelGlobalsCPU *kg, ShaderData *sd, OSLUStringHash name, TypeDesc type, bool derivatives, void *val)
static ustring u_is_smooth
static bool get_background_attribute(const KernelGlobalsCPU *kg, ShaderData *sd, OSLUStringHash name, TypeDesc type, bool derivatives, void *val)
static ustring u_object_location
static ustring u_curve_random
bool texture3d(OSLUStringHash 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, OSLUStringHash *errormessage) override
static ustring u_particle_rotation
OSLRenderServices(OSL::TextureSystem *texture_system, int device_type)
static ustring u_particle_velocity
static ustring u_particle_angular_velocity
static ustring u_path_glossy_depth
static ustring u_geom_dupli_uv
static ustring u_geom_undisplaced
static ustring u_geom_numpolyvertices
static ustring u_object_random
static ustring u_path_ray_length
bool get_texture_info(OSL::ShaderGlobals *sg, OSLUStringHash filename, TextureHandle *texture_handle, int subimage, OSLUStringHash dataname, TypeDesc datatype, void *data) override
static ustring u_object_is_light
int pointcloud_get(OSL::ShaderGlobals *sg, OSLUStringHash filename, size_t *indices, int count, OSLUStringHash attr_name, TypeDesc attr_type, void *out_data) override
bool texture(OSLUStringHash 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, OSLUStringHash *errormessage) override
static ustring u_particle_random
static ustring u_particle_age
static ustring u_object_index
static ustring u_is_point
static ustring u_path_transparent_depth
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
static ustring u_particle_lifetime
bool environment(OSLUStringHash 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, OSLUStringHash *errormessage) override
static ustring u_is_curve
static ustring u_object_color
static ustring u_distance
static ustring u_geom_trianglevertices
int pointcloud_search(OSL::ShaderGlobals *sg, OSLUStringHash filename, const OSL::Vec3 ¢er, float radius, int max_points, bool sort, size_t *out_indices, float *out_distances, int derivs_offset) override
static ustring u_geom_polyvertices
TextureSystem::TextureHandle * get_texture_handle(OSLUStringHash filename) override
static ustring u_particle_size
bool pointcloud_write(OSL::ShaderGlobals *sg, OSLUStringHash filename, const OSL::Vec3 &pos, int nattribs, const OSLUStringRep *names, const TypeDesc *types, const void **data) override
static ustring u_geom_dupli_generated
bool good(TextureSystem::TextureHandle *texture_handle) override
bool get_attribute(OSL::ShaderGlobals *sg, bool derivatives, OSLUStringHash object, TypeDesc type, OSLUStringHash name, void *val) override
static ustring u_geom_name
ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals kg, int id, float3 P, InterpolationType interp)
ccl_device float4 kernel_tex_image_interp(KernelGlobals kg, int id, float x, float y)
CCL_NAMESPACE_BEGIN struct ProjectionTransform ProjectionTransform
ccl_device_inline ProjectionTransform projection_transpose(const ProjectionTransform &a)
CCL_NAMESPACE_BEGIN struct Options options
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define CCL_NAMESPACE_END
ccl_device_forceinline float differential_make_compact(const float dD)
ccl_device_forceinline differential3 differential_from_compact(const float3 D, const float dD)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
ccl_device_inline void triangle_vertices(KernelGlobals kg, int prim, float3 P[3])
ccl_device_inline float3 triangle_smooth_normal_unnormalized(KernelGlobals kg, ccl_private const ShaderData *sd, float3 Ng, int prim, float u, float v)
ccl_device_inline float hash_uint2_to_float(uint kx, uint ky)
ccl_device_intersect bool scene_intersect(KernelGlobals kg, ccl_private const Ray *ray, const uint visibility, ccl_private Intersection *isect)
ccl_device_inline float3 camera_world_to_ndc(KernelGlobals kg, ccl_private ShaderData *sd, float3 P)
ccl_global const KernelWorkTile * tile
ccl_device Transform primitive_attribute_matrix(KernelGlobals kg, const AttributeDescriptor desc)
ccl_device_inline float object_pass_id(KernelGlobals kg, int object)
ccl_device_inline float object_alpha(KernelGlobals kg, int object)
ccl_device float particle_age(KernelGlobals kg, int particle)
ccl_device float4 particle_rotation(KernelGlobals kg, int particle)
ccl_device_inline uint particle_index(KernelGlobals kg, int particle)
ccl_device_inline float3 object_location(KernelGlobals kg, ccl_private const ShaderData *sd)
ccl_device_inline float object_random_number(KernelGlobals kg, int object)
ccl_device float particle_lifetime(KernelGlobals kg, int particle)
ccl_device_inline void object_position_transform(KernelGlobals kg, ccl_private const ShaderData *sd, ccl_private float3 *P)
ccl_device float3 particle_angular_velocity(KernelGlobals kg, int particle)
ccl_device_inline int object_particle_id(KernelGlobals kg, int object)
ccl_device_inline float3 object_color(KernelGlobals kg, int object)
ccl_device_inline Transform object_get_transform(KernelGlobals kg, ccl_private const ShaderData *sd)
ccl_device int shader_pass_id(KernelGlobals kg, ccl_private const ShaderData *sd)
ccl_device float3 particle_velocity(KernelGlobals kg, int particle)
ccl_device float3 particle_location(KernelGlobals kg, int particle)
ccl_device float particle_size(KernelGlobals kg, int particle)
ccl_device_inline Transform lamp_fetch_transform(KernelGlobals kg, int lamp, bool inverse)
ccl_device_inline float3 object_dupli_generated(KernelGlobals kg, int object)
ccl_device_inline float3 object_dupli_uv(KernelGlobals kg, int object)
ccl_device_inline Transform object_get_inverse_transform(KernelGlobals kg, ccl_private const ShaderData *sd)
ccl_device_inline Transform object_fetch_transform_motion_test(KernelGlobals kg, int object, float time, ccl_private Transform *itfm)
#define OSL_TEXTURE_HANDLE_TYPE_SVM
#define OSL_TEXTURE_HANDLE_TYPE_IES
#define OSL_TEXTURE_HANDLE_TYPE_AO_OR_BEVEL
@ PATH_RAY_ALL_VISIBILITY
@ SD_OBJECT_TRANSFORM_APPLIED
ccl_device_inline float kernel_ies_interp(KernelGlobals kg, int slot, float h_angle, float v_angle)
ccl_device_inline float average(const float2 a)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 zero_float3()
CCL_NAMESPACE_BEGIN ccl_device_inline float4 zero_float4()
ccl_device_inline void motion_triangle_vertices(KernelGlobals kg, int object, uint3 tri_vindex, int numsteps, int numverts, int step, float t, float3 verts[3])
VecBase< float, 4 > float4
static OSL::ustring to_ustring(OSLUStringHash h)
CCL_NAMESPACE_BEGIN typedef OSL::ustring OSLUStringHash
OSL::ustring OSLUStringRep
static constexpr TypeDesc TypeFloatArray4(TypeDesc::FLOAT, TypeDesc::SCALAR, TypeDesc::NOSEMANTICS, 4)
ccl_device_forceinline float3 primitive_surface_attribute_float3(KernelGlobals kg, ccl_private const ShaderData *sd, const AttributeDescriptor desc, ccl_private float3 *dx, ccl_private float3 *dy)
ccl_device_forceinline float2 primitive_surface_attribute_float2(KernelGlobals kg, ccl_private const ShaderData *sd, const AttributeDescriptor desc, ccl_private float2 *dx, ccl_private float2 *dy)
ccl_device_forceinline float4 primitive_surface_attribute_float4(KernelGlobals kg, ccl_private const ShaderData *sd, const AttributeDescriptor desc, ccl_private float4 *dx, ccl_private float4 *dy)
CCL_NAMESPACE_BEGIN ccl_device_forceinline float primitive_surface_attribute_float(KernelGlobals kg, ccl_private const ShaderData *sd, const AttributeDescriptor desc, ccl_private float *dx, ccl_private float *dy)
static bool set_attribute_string(ustring str, TypeDesc type, bool derivatives, void *val)
static bool set_attribute_float2(float2 f[3], TypeDesc type, bool derivatives, void *val)
static bool set_attribute_float3_3(float3 P[3], TypeDesc type, bool derivatives, void *val)
static bool set_attribute_int(int i, TypeDesc type, bool derivatives, void *val)
static bool set_attribute_matrix(const Transform &tfm, TypeDesc type, void *val)
static bool set_attribute_float4(float4 f[3], TypeDesc type, bool derivatives, void *val)
static bool set_attribute_float(float f[3], TypeDesc type, bool derivatives, void *val)
static bool set_attribute_float3(float3 f[3], TypeDesc type, bool derivatives, void *val)
static CCL_NAMESPACE_BEGIN void copy_matrix(OSL::Matrix44 &m, const Transform &tfm)
static bool get_object_attribute(const KernelGlobalsCPU *kg, ShaderData *sd, const AttributeDescriptor &desc, const TypeDesc &type, bool derivatives, void *val)
ccl_device_inline void shader_setup_from_ray(KernelGlobals kg, ccl_private ShaderData *ccl_restrict sd, ccl_private const Ray *ccl_restrict ray, ccl_private const Intersection *ccl_restrict isect)
static bool find_attribute(const std::string &attributes, const char *search_attribute)
ccl_device_inline float3 float4_to_float3(const float4 a)
#define TEX_IMAGE_MISSING_R
#define TEX_IMAGE_MISSING_B
#define TEX_IMAGE_MISSING_A
#define TEX_IMAGE_MISSING_G