Blender V5.3
OSLRenderServices Class Reference

#include <services.h>

Inherits OSL::RendererServices.

Public Member Functions

 OSLRenderServices (const int device_type)
 ~OSLRenderServices () override
int supports (string_view feature) const override
bool get_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override
bool get_inverse_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override
bool get_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSLUStringHash from, float time) override
bool get_inverse_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSLUStringHash to, float time) override
bool get_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform) override
bool get_inverse_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform) override
bool get_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSLUStringHash from) override
bool get_inverse_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSLUStringHash to) override
bool get_array_attribute (OSL::ShaderGlobals *sg, bool derivatives, OSLUStringHash object, const TypeDesc type, OSLUStringHash name, const int index, void *val) override
bool get_attribute (OSL::ShaderGlobals *sg, bool derivatives, OSLUStringHash object, const TypeDesc type, OSLUStringHash name, void *val) override
bool get_userdata (bool derivatives, OSLUStringHash name, const TypeDesc type, OSL::ShaderGlobals *sg, void *val) override
int pointcloud_search (OSL::ShaderGlobals *sg, OSLUStringHash filename, const OSL::Vec3 &center, const float radius, const int max_points, bool sort, size_t *out_indices, float *out_distances, int derivs_offset) override
int pointcloud_get (OSL::ShaderGlobals *sg, OSLUStringHash filename, size_t *indices, const int count, OSLUStringHash attr_name, const TypeDesc attr_type, void *out_data) override
bool pointcloud_write (OSL::ShaderGlobals *sg, OSLUStringHash filename, const OSL::Vec3 &pos, const int nattribs, const OSLUStringRep *names, const TypeDesc *types, const void **data) override
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
bool getmessage (OSL::ShaderGlobals *sg, OSLUStringHash source, OSLUStringHash name, const TypeDesc type, void *val, bool derivatives) override
OSL::TextureSystem::TextureHandle * get_texture_handle (OSL::ustring filename, OSL::ShadingContext *context, const OSL::TextureOpt *options) override
OSL::TextureSystem::TextureHandle * get_texture_handle (OSLUStringHash filename, OSL::ShadingContext *context, const OSL::TextureOpt *options) override
bool good (OSL::TextureSystem::TextureHandle *texture_handle) override
bool is_udim (OSL::TextureSystem::TextureHandle *texture_handle) override
bool texture (OSLUStringHash filename, OSL::TextureSystem::TextureHandle *texture_handle, TexturePerthread *texture_thread_info, OSL::TextureOpt &options, OSL::ShaderGlobals *sg, const float s, const float t, const float dsdx, const float dtdx, const float dsdy, const float dtdy, const int nchannels, float *result, float *dresultds, float *dresultdt, OSLUStringHash *errormessage) override
bool texture3d (OSLUStringHash filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, OSL::TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &dPdz, const int nchannels, float *result, float *dresultds, float *dresultdt, float *dresultdr, OSLUStringHash *errormessage) override
bool environment (OSLUStringHash filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, OSL::TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy, const int nchannels, float *result, float *dresultds, float *dresultdt, OSLUStringHash *errormessage) override
bool get_texture_info (OSLUStringHash filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, OSL::ShaderGlobals *sg, const int subimage, OSLUStringHash dataname, const TypeDesc datatype, void *data, OSLUStringHash *errormessage) override
bool get_texture_info (OSLUStringHash filename, TextureHandle *texture_handle, float s, float t, TexturePerthread *texture_thread_info, OSL::ShaderGlobals *sg, const int subimage, OSLUStringHash dataname, const TypeDesc datatype, void *data, OSLUStringHash *errormessage) override
void image_manager_add (const OSL::ShadingContext *context, ImageManager *image_manager)
void image_manager_remove (const OSL::ShadingContext *context)

Static Public Member Functions

static void register_closures (OSL::ShadingSystem *ss)
static bool get_attribute (ShaderGlobals *globals, ShaderData *sd, bool derivatives, OSLUStringHash object_name, TypeDesc type, OSLUStringHash name, void *val)
static bool get_background_attribute (ShaderGlobals *globals, ShaderData *sd, OSLUStringHash name, TypeDesc type, bool derivatives, void *val)
static bool get_camera_attribute (ShaderGlobals *globals, OSLUStringHash name, TypeDesc type, bool derivatives, void *val)
static bool get_object_standard_attribute (ShaderGlobals *globals, ShaderData *sd, OSLUStringHash name, TypeDesc type, bool derivatives, void *val)

Public Attributes

OSLTextureHandleMap textures

Detailed Description

Definition at line 88 of file services.h.

Constructor & Destructor Documentation

◆ OSLRenderServices()

CCL_NAMESPACE_BEGIN OSLRenderServices::OSLRenderServices ( const int device_type)

Definition at line 32 of file services.cpp.

◆ ~OSLRenderServices()

Member Function Documentation

◆ environment()

bool OSLRenderServices::environment ( OSLUStringHash filename,
TextureHandle * texture_handle,
TexturePerthread * texture_thread_info,
OSL::TextureOpt & options,
OSL::ShaderGlobals * sg,
const OSL::Vec3 & R,
const OSL::Vec3 & dRdx,
const OSL::Vec3 & dRdy,
const int nchannels,
float * result,
float * dresultds,
float * dresultdt,
OSLUStringHash * errormessage )
override

Definition at line 395 of file services.cpp.

References ShaderGlobals::kg, LOG_WARNING, make_float3(), options, osl_shared_environment(), and R.

Referenced by ~OSLRenderServices().

◆ get_array_attribute()

bool OSLRenderServices::get_array_attribute ( OSL::ShaderGlobals * sg,
bool derivatives,
OSLUStringHash object,
const TypeDesc type,
OSLUStringHash name,
const int index,
void * val )
override

Definition at line 139 of file services.cpp.

Referenced by ~OSLRenderServices().

◆ get_attribute() [1/2]

bool OSLRenderServices::get_attribute ( OSL::ShaderGlobals * sg,
bool derivatives,
OSLUStringHash object,
const TypeDesc type,
OSLUStringHash name,
void * val )
override

Definition at line 178 of file services.cpp.

References get_attribute(), and ShaderGlobals::sd.

Referenced by get_attribute(), getmessage(), and ~OSLRenderServices().

◆ get_attribute() [2/2]

bool OSLRenderServices::get_attribute ( ShaderGlobals * globals,
ShaderData * sd,
bool derivatives,
OSLUStringHash object_name,
TypeDesc type,
OSLUStringHash name,
void * val )
static

◆ get_background_attribute()

bool OSLRenderServices::get_background_attribute ( ShaderGlobals * globals,
ShaderData * sd,
OSLUStringHash name,
TypeDesc type,
bool derivatives,
void * val )
static

Definition at line 161 of file services.cpp.

References ShaderGlobals::kg, and osl_shared_get_background_attribute().

Referenced by ~OSLRenderServices().

◆ get_camera_attribute()

bool OSLRenderServices::get_camera_attribute ( ShaderGlobals * globals,
OSLUStringHash name,
TypeDesc type,
bool derivatives,
void * val )
static

Definition at line 172 of file services.cpp.

References ShaderGlobals::kg, and osl_shared_get_camera_attribute().

Referenced by ~OSLRenderServices().

◆ get_inverse_matrix() [1/4]

bool OSLRenderServices::get_inverse_matrix ( OSL::ShaderGlobals * sg,
OSL::Matrix44 & result,
OSL::TransformationPtr xform )
override

◆ get_inverse_matrix() [2/4]

bool OSLRenderServices::get_inverse_matrix ( OSL::ShaderGlobals * sg,
OSL::Matrix44 & result,
OSL::TransformationPtr xform,
float time )
override

◆ get_inverse_matrix() [3/4]

bool OSLRenderServices::get_inverse_matrix ( OSL::ShaderGlobals * sg,
OSL::Matrix44 & result,
OSLUStringHash to )
override

Definition at line 131 of file services.cpp.

References ShaderGlobals::kg, and osl_shared_get_named_inverse_matrix().

◆ get_inverse_matrix() [4/4]

bool OSLRenderServices::get_inverse_matrix ( OSL::ShaderGlobals * sg,
OSL::Matrix44 & result,
OSLUStringHash to,
float time )
override

Definition at line 90 of file services.cpp.

References ShaderGlobals::kg, and osl_shared_get_named_inverse_matrix().

◆ get_matrix() [1/4]

bool OSLRenderServices::get_matrix ( OSL::ShaderGlobals * sg,
OSL::Matrix44 & result,
OSL::TransformationPtr xform )
override

Definition at line 99 of file services.cpp.

References ShaderGlobals::kg, osl_shared_get_object_matrix(), and ShaderGlobals::sd.

◆ get_matrix() [2/4]

bool OSLRenderServices::get_matrix ( OSL::ShaderGlobals * sg,
OSL::Matrix44 & result,
OSL::TransformationPtr xform,
float time )
override

◆ get_matrix() [3/4]

bool OSLRenderServices::get_matrix ( OSL::ShaderGlobals * sg,
OSL::Matrix44 & result,
OSLUStringHash from )
override

Definition at line 123 of file services.cpp.

References ShaderGlobals::kg, and osl_shared_get_named_matrix().

◆ get_matrix() [4/4]

bool OSLRenderServices::get_matrix ( OSL::ShaderGlobals * sg,
OSL::Matrix44 & result,
OSLUStringHash from,
float time )
override

Definition at line 81 of file services.cpp.

References ShaderGlobals::kg, and osl_shared_get_named_matrix().

◆ get_object_standard_attribute()

bool OSLRenderServices::get_object_standard_attribute ( ShaderGlobals * globals,
ShaderData * sd,
OSLUStringHash name,
TypeDesc type,
bool derivatives,
void * val )
static

Definition at line 150 of file services.cpp.

References ShaderGlobals::kg, and osl_shared_get_object_standard_attribute().

Referenced by ~OSLRenderServices().

◆ get_texture_handle() [1/2]

OSL::TextureSystem::TextureHandle * OSLRenderServices::get_texture_handle ( OSL::ustring filename,
OSL::ShadingContext * context,
const OSL::TextureOpt * options )
override

◆ get_texture_handle() [2/2]

OSL::TextureSystem::TextureHandle * OSLRenderServices::get_texture_handle ( OSLUStringHash filename,
OSL::ShadingContext * context,
const OSL::TextureOpt * options )
override

Definition at line 247 of file services.cpp.

References get_texture_handle().

◆ get_texture_info() [1/2]

bool OSLRenderServices::get_texture_info ( OSLUStringHash filename,
TextureHandle * texture_handle,
float s,
float t,
TexturePerthread * texture_thread_info,
OSL::ShaderGlobals * sg,
const int subimage,
OSLUStringHash dataname,
const TypeDesc datatype,
void * data,
OSLUStringHash * errormessage )
override

◆ get_texture_info() [2/2]

bool OSLRenderServices::get_texture_info ( OSLUStringHash filename,
TextureHandle * texture_handle,
TexturePerthread * texture_thread_info,
OSL::ShaderGlobals * sg,
const int subimage,
OSLUStringHash dataname,
const TypeDesc datatype,
void * data,
OSLUStringHash * errormessage )
override

Definition at line 430 of file services.cpp.

References ShaderGlobals::kg, LOG_WARNING, make_float2, and osl_shared_get_texture_info().

Referenced by ~OSLRenderServices().

◆ get_userdata()

bool OSLRenderServices::get_userdata ( bool derivatives,
OSLUStringHash name,
const TypeDesc type,
OSL::ShaderGlobals * sg,
void * val )
override

Definition at line 238 of file services.cpp.

Referenced by ~OSLRenderServices().

◆ getmessage()

bool OSLRenderServices::getmessage ( OSL::ShaderGlobals * sg,
OSLUStringHash source,
OSLUStringHash name,
const TypeDesc type,
void * val,
bool derivatives )
override

◆ good()

bool OSLRenderServices::good ( OSL::TextureSystem::TextureHandle * texture_handle)
override

Definition at line 305 of file services.cpp.

References IMAGE, KERNEL_IMAGE_NONE, OSL_TEXTURE_HANDLE_ID, and OSL_TEXTURE_HANDLE_TYPE.

Referenced by ~OSLRenderServices().

◆ image_manager_add()

void OSLRenderServices::image_manager_add ( const OSL::ShadingContext * context,
ImageManager * image_manager )

Definition at line 253 of file services.cpp.

References lock.

◆ image_manager_remove()

void OSLRenderServices::image_manager_remove ( const OSL::ShadingContext * context)

Definition at line 260 of file services.cpp.

References lock.

◆ is_udim()

bool OSLRenderServices::is_udim ( OSL::TextureSystem::TextureHandle * texture_handle)
override

Definition at line 311 of file services.cpp.

References IMAGE, OSL_TEXTURE_HANDLE_ID, and OSL_TEXTURE_HANDLE_TYPE.

Referenced by ~OSLRenderServices().

◆ pointcloud_get()

int OSLRenderServices::pointcloud_get ( OSL::ShaderGlobals * sg,
OSLUStringHash filename,
size_t * indices,
const int count,
OSLUStringHash attr_name,
const TypeDesc attr_type,
void * out_data )
override

Definition at line 499 of file services.cpp.

Referenced by ~OSLRenderServices().

◆ pointcloud_search()

int OSLRenderServices::pointcloud_search ( OSL::ShaderGlobals * sg,
OSLUStringHash filename,
const OSL::Vec3 & center,
const float radius,
const int max_points,
bool sort,
size_t * out_indices,
float * out_distances,
int derivs_offset )
override

Definition at line 482 of file services.cpp.

Referenced by ~OSLRenderServices().

◆ pointcloud_write()

bool OSLRenderServices::pointcloud_write ( OSL::ShaderGlobals * sg,
OSLUStringHash filename,
const OSL::Vec3 & pos,
const int nattribs,
const OSLUStringRep * names,
const TypeDesc * types,
const void ** data )
override

Definition at line 515 of file services.cpp.

Referenced by ~OSLRenderServices().

◆ register_closures()

void OSLRenderServices::register_closures ( OSL::ShadingSystem * ss)
static

Definition at line 68 of file closures.cpp.

References osl_closure_layer_params().

Referenced by ~OSLRenderServices().

◆ supports()

int OSLRenderServices::supports ( string_view feature) const
override

Definition at line 42 of file services.cpp.

References DEVICE_OPTIX.

Referenced by ~OSLRenderServices().

◆ texture()

bool OSLRenderServices::texture ( OSLUStringHash filename,
OSL::TextureSystem::TextureHandle * texture_handle,
TexturePerthread * texture_thread_info,
OSL::TextureOpt & options,
OSL::ShaderGlobals * sg,
const float s,
const float t,
const float dsdx,
const float dtdx,
const float dsdy,
const float dtdy,
const int nchannels,
float * result,
float * dresultds,
float * dresultdt,
OSLUStringHash * errormessage )
override

Definition at line 317 of file services.cpp.

References ShaderGlobals::kg, LOG_WARNING, options, and osl_shared_texture().

Referenced by ~OSLRenderServices().

◆ texture3d()

bool OSLRenderServices::texture3d ( OSLUStringHash filename,
TextureHandle * texture_handle,
TexturePerthread * texture_thread_info,
OSL::TextureOpt & options,
OSL::ShaderGlobals * sg,
const OSL::Vec3 & P,
const OSL::Vec3 & dPdx,
const OSL::Vec3 & dPdy,
const OSL::Vec3 & dPdz,
const int nchannels,
float * result,
float * dresultds,
float * dresultdt,
float * dresultdr,
OSLUStringHash * errormessage )
override

◆ trace()

Member Data Documentation

◆ textures

OSLTextureHandleMap OSLRenderServices::textures

Definition at line 304 of file services.h.

Referenced by get_texture_handle().


The documentation for this class was generated from the following files: