mi::neuraylib::ITarget_resource_callback Class Reference
[MDL compiler]
Description
A callback interface to allow the user to handle resources when creating new mi::neuraylib::ITarget_argument_block objects for class-compiled materials when the arguments contain textures not known during compilation.
Public Member Functions
- virtual Uint32 get_resource_index( const IValue_resource* resource) =0
- Returns a resource index for the given resource value usable by the target code resource handler for the corresponding resource type. More...
- virtual Uint32 get_string_index( const IValue_string* s) =0
- Returns a string identifier for the given string value usable by the target code. More...
Member Functions
- virtual Uint32 mi::neuraylib::ITarget_resource_callback::get_resource_index( const IValue_resource* resource) [pure virtual]
-
Returns a resource index for the given resource value usable by the target code resource handler for the corresponding resource type. The index 0 is always an invalid resource reference. For mi::neuraylib::IValue_texture values, the first indices correspond to the indices used with mi::neuraylib::ITarget_code::get_texture(). For mi::mdl::IValue_light_profile values, the first indices correspond to the indices used with mi::neuraylib::ITarget_code::get_light_profile(). For mi::mdl::IValue_bsdf_measurement values, the first indices correspond to the indices used with mi::neuraylib::ITarget_code::get_bsdf_measurement().
You can use mi::neuraylib::ITarget_code::get_known_resource_index() to handle resources which were known during compilation of the target code object.
See mi_neuray_ptx_texture_lookup_call_modes for more details about texture handlers for the PTX backend.
Parameters
- resource
- the resource value
Returns
a resource index or 0 if no resource index can be returned
- virtual Uint32 mi::neuraylib::ITarget_resource_callback::get_string_index( const IValue_string* s) [pure virtual]
-
Returns a string identifier for the given string value usable by the target code. The value 0 is always the "not known string".
Parameters
- s
- the string value