Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::ITarget_resource_callback Class Referenceabstract

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. More...

Inheritance diagram for mi::neuraylib::ITarget_resource_callback:
mi::base::Interface_declare< 0xe7559a88, 0x9a9a, 0x41d8, 0xa1, 0x9c, 0x4a, 0x52, 0x4e, 0x4b, 0x7b, 0x66 > mi::base::IInterface

Public Member Functions

virtual Uint32 get_resource_index (IValue_resource const *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 (IValue_string const *s)=0
 Returns a string identifier for the given string value usable by the target code. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xe7559a88, 0x9a9a, 0x41d8, 0xa1, 0x9c, 0x4a, 0x52, 0x4e, 0x4b, 0x7b, 0x66 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
 Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xe7559a88, 0x9a9a, 0x41d8, 0xa1, 0x9c, 0x4a, 0x52, 0x4e, 0x4b, 0x7b, 0x66 >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed 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.

Member Function Documentation

virtual Uint32 mi::neuraylib::ITarget_resource_callback::get_resource_index ( IValue_resource const *  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 Texture lookup call modes of the PTX backend for more details about texture handlers for the PTX backend. See Example for Execution of Compiled MDL Materials (GLSL) for more details about texture handlers for the GLSL backend.

Parameters
resourcethe 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 ( IValue_string const *  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
sthe string value