Represents target code of an MDL backend. More...
Public Types | |
enum | State_usage_property { SU_POSITION = 0x0001u, SU_NORMAL = 0x0002u, SU_GEOMETRY_NORMAL = 0x0004u, SU_MOTION = 0x0008u, SU_TEXTURE_COORDINATE = 0x0010u, SU_TEXTURE_TANGENTS = 0x0020u, SU_TANGENT_SPACE = 0x0040u, SU_GEOMETRY_TANGENTS = 0x0080u, SU_DIRECTION = 0x0100u, SU_ANIMATION_TIME = 0x0200u, SU_ROUNDED_CORNER_NORMAL = 0x0400u, SU_ALL_VARYING_MASK = 0x07FFu, SU_TRANSFORMS = 0x0800u, SU_OBJECT_ID = 0x1000u, SU_ALL_UNIFORM_MASK = 0x1800u } |
The potential state usage properties. More... | |
enum | Texture_shape |
Possible texture shapes. More... | |
enum | Prototype_language |
Language to use for the callable function prototype. More... | |
enum | Distribution_kind |
Possible kinds of distribution functions. More... | |
enum | Function_kind |
Possible kinds of callable functions. More... | |
![]() | |
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... | |
![]() | |
typedef Uuid_t< 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Member Functions | |
virtual const char * | get_code () const =0 |
Returns the represented target code in ASCII representation. More... | |
virtual Size | get_code_size () const =0 |
Returns the length of the represented target code. More... | |
virtual Size | get_callable_function_count () const =0 |
Returns the number of callable functions in the target code. More... | |
virtual const char * | get_callable_function (Size index) const =0 |
Returns the name of a callable function in the target code. More... | |
virtual Size | get_texture_count () const =0 |
Returns the number of texture resources used by the target code. More... | |
virtual const char * | get_texture (Size index) const =0 |
Returns the name of a texture resource used by the target code. More... | |
virtual Texture_shape | get_texture_shape (Size index) const =0 |
Returns the texture shape of a given texture resource used by the target code. More... | |
virtual Size | get_ro_data_segment_count () const =0 |
Returns the number of constant data initializers. More... | |
virtual const char * | get_ro_data_segment_name (Size index) const =0 |
Returns the name of the constant data segment at the given index. More... | |
virtual Size | get_ro_data_segment_size (Size index) const =0 |
Returns the size of the constant data segment at the given index. More... | |
virtual const char * | get_ro_data_segment_data (Size index) const =0 |
Returns the data of the constant data segment at the given index. More... | |
virtual Size | get_code_segment_count () const =0 |
Returns the number of code segments of the target code. More... | |
virtual const char * | get_code_segment (Size index) const =0 |
Returns the represented target code segment in ASCII representation. More... | |
virtual Size | get_code_segment_size (Size index) const =0 |
Returns the length of the represented target code segment. More... | |
virtual const char * | get_code_segment_description (Size index) const =0 |
Returns the description of the target code segment. More... | |
virtual State_usage | get_render_state_usage () const =0 |
Returns the potential render state usage of the target code. More... | |
virtual Size | get_argument_block_count () const =0 |
Returns the number of target argument blocks / block layouts. More... | |
virtual const ITarget_argument_block * | get_argument_block (Size index) const =0 |
Get a target argument block if available. More... | |
virtual ITarget_argument_block * | create_argument_block (Size index, const ICompiled_material *material, ITarget_resource_callback *resource_callback) const =0 |
Create a new target argument block of the class-compiled material for this target code. More... | |
virtual const ITarget_value_layout * | get_argument_block_layout (Size index) const =0 |
Get a captured arguments block layout if available. More... | |
virtual Size | get_light_profile_count () const =0 |
Returns the number of light profile resources used by the target code. More... | |
virtual const char * | get_light_profile (Size index) const =0 |
Returns the name of a light profile resource used by the target code. More... | |
virtual Size | get_bsdf_measurement_count () const =0 |
Returns the number of bsdf measurement resources used by the target code. More... | |
virtual const char * | get_bsdf_measurement (Size index) const =0 |
Returns the name of a bsdf measurement resource used by the target code. More... | |
virtual Size | get_string_constant_count () const =0 |
Returns the number of string constants used by the target code. More... | |
virtual const char * | get_string_constant (Size index) const =0 |
Returns the string constant used by the target code. More... | |
virtual Uint32 | get_known_resource_index (ITransaction *transaction, IValue_resource const *resource) const =0 |
Returns the resource index for use in an ITarget_argument_block of resources already known when this ITarget_code object was generated. More... | |
virtual const char * | get_callable_function_prototype (Size index, Prototype_language lang) const =0 |
Returns the prototype of a callable function in the target code. More... | |
virtual Distribution_kind | get_callable_function_distribution_kind (Size index) const =0 |
Returns the distribution kind of a callable function in the target code. More... | |
virtual Function_kind | get_callable_function_kind (Size index) const =0 |
Returns the function kind of a callable function in the target code. More... | |
virtual Size | get_callable_function_argument_block_index (Size index) const =0 |
Get the index of the target argument block to use with a callable function. More... | |
virtual Sint32 | execute_environment (Size index, const Shading_state_environment &state, Texture_handler_base *tex_handler, Spectrum_struct *result) const =0 |
Run this code on the native CPU. More... | |
virtual Sint32 | execute (Size index, const Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args, void *result) const =0 |
Run this code on the native CPU with the given captured arguments block. More... | |
virtual Sint32 | execute_bsdf_init (Size index, Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
Run the BSDF init function for this code on the native CPU. More... | |
virtual Sint32 | execute_bsdf_sample (Size index, Bsdf_sample_data *data, const Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
Run the BSDF sample function for this code on the native CPU. More... | |
virtual Sint32 | execute_bsdf_evaluate (Size index, Bsdf_evaluate_data *data, const Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
Run the BSDF evaluation function for this code on the native CPU. More... | |
virtual Sint32 | execute_bsdf_pdf (Size index, Bsdf_pdf_data *data, const Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
Run the BSDF PDF calculation function for this code on the native CPU. More... | |
virtual Sint32 | execute_edf_init (Size index, Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
Run the EDF init function for this code on the native CPU. More... | |
virtual Sint32 | execute_edf_sample (Size index, Edf_sample_data *data, const Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
Run the EDF sample function for this code on the native CPU. More... | |
virtual Sint32 | execute_edf_evaluate (Size index, Edf_evaluate_data *data, const Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
Run the EDF evaluation function for this code on the native CPU. More... | |
virtual Sint32 | execute_edf_pdf (Size index, Edf_pdf_data *data, const Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
Run the EDF PDF calculation function for this code on the native CPU. More... | |
Additional Inherited Members | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Represents target code of an MDL backend.
Possible kinds of distribution functions.
Possible kinds of callable functions.
Language to use for the callable function prototype.
The potential state usage properties.
Possible texture shapes.
|
pure virtual |
Create a new target argument block of the class-compiled material for this target code.
index | The index of the base target argument block of this target code. |
material | The class-compiled MDL material which has to fit to this ITarget_code , i.e. the hash of the compiled material must be identical to the one used to generate this ITarget_code . |
resource_callback | Callback for retrieving resource indices for resource values. |
NULL
if no arguments were captured or the index was invalid.
|
pure virtual |
Run this code on the native CPU with the given captured arguments block.
[in] | index | The index of the callable function. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[in] | cap_args | The captured arguments to use for the execution. If cap_args is NULL , the captured arguments of this ITarget_code object will be used, if any. |
[out] | result | The result will be written to. |
|
pure virtual |
Run the BSDF evaluation function for this code on the native CPU.
[in] | index | The index of the callable function. |
[in,out] | data | The input and output fields for the BSDF evaluation. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[in] | cap_args | The captured arguments to use for the execution. If cap_args is NULL , the captured arguments of this ITarget_code object for the given callable function will be used, if any. |
|
pure virtual |
Run the BSDF init function for this code on the native CPU.
This function updates the normal field of the shading state with the result of "geometry.normal"
and, if the "num_texture_results"
backend option has been set to non-zero, fills the text_results fields of the state.
[in] | index | The index of the callable function. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[in] | cap_args | The captured arguments to use for the execution. If cap_args is NULL , the captured arguments of this ITarget_code object for the given callable function will be used, if any. |
|
pure virtual |
Run the BSDF PDF calculation function for this code on the native CPU.
[in] | index | The index of the callable function. |
[in,out] | data | The input and output fields for the BSDF PDF calculation. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[in] | cap_args | The captured arguments to use for the execution. If cap_args is NULL , the captured arguments of this ITarget_code object for the given callable function will be used, if any. |
|
pure virtual |
Run the BSDF sample function for this code on the native CPU.
[in] | index | The index of the callable function. |
[in,out] | data | The input and output fields for the BSDF sampling. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[in] | cap_args | The captured arguments to use for the execution. If cap_args is NULL , the captured arguments of this ITarget_code object for the given callable function will be used, if any. |
|
pure virtual |
Run the EDF evaluation function for this code on the native CPU.
[in] | index | The index of the callable function. |
[in,out] | data | The input and output fields for the EDF evaluation. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[in] | cap_args | The captured arguments to use for the execution. If cap_args is NULL , the captured arguments of this ITarget_code object for the given callable function will be used, if any. |
|
pure virtual |
Run the EDF init function for this code on the native CPU.
This function updates the normal field of the shading state with the result of "geometry.normal"
and, if the "num_texture_results"
backend option has been set to non-zero, fills the text_results fields of the state.
[in] | index | The index of the callable function. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[in] | cap_args | The captured arguments to use for the execution. If cap_args is NULL , the captured arguments of this ITarget_code object for the given callable function will be used, if any. |
|
pure virtual |
Run the EDF PDF calculation function for this code on the native CPU.
[in] | index | The index of the callable function. |
[in,out] | data | The input and output fields for the EDF PDF calculation. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[in] | cap_args | The captured arguments to use for the execution. If cap_args is NULL , the captured arguments of this ITarget_code object for the given callable function will be used, if any. |
|
pure virtual |
Run the EDF sample function for this code on the native CPU.
[in] | index | The index of the callable function. |
[in,out] | data | The input and output fields for the EDF sampling. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[in] | cap_args | The captured arguments to use for the execution. If cap_args is NULL , the captured arguments of this ITarget_code object for the given callable function will be used, if any. |
|
pure virtual |
Run this code on the native CPU.
[in] | index | The index of the callable function. |
[in] | state | The core state. |
[in] | tex_handler | Texture handler containing the vtable for the user-defined texture lookup functions. Can be NULL if the built-in resource handler is used. |
[out] | result | The result will be written to. |
|
pure virtual |
Get a target argument block if available.
index | The index of the target argument block. |
NULL
if no arguments were captured or the index was invalid.
|
pure virtual |
Returns the number of target argument blocks / block layouts.
|
pure virtual |
Get a captured arguments block layout if available.
index | The index of the target argument block. |
NULL
if no arguments were captured or the index was invalid.
|
pure virtual |
Returns the name of a bsdf measurement resource used by the target code.
index | The index of the texture resource. |
NULL
if index
is out of range.
|
pure virtual |
Returns the number of bsdf measurement resources used by the target code.
|
pure virtual |
Returns the name of a callable function in the target code.
The name of a callable function is specified via the fname
parameter of mi::neuraylib::IMdl_backend::translate_environment() and mi::neuraylib::IMdl_backend::translate_material_expression().
index | The index of the callable function. |
index
-th callable function, or NULL
if index
is out of bounds.
|
pure virtual |
Get the index of the target argument block to use with a callable function.
index | The index of the callable function. |
|
pure virtual |
Returns the number of callable functions in the target code.
|
pure virtual |
Returns the distribution kind of a callable function in the target code.
index | The index of the callable function. |
DK_INVALID
if index
was invalid.
|
pure virtual |
Returns the function kind of a callable function in the target code.
index | The index of the callable function. |
FK_INVALID
if index
was invalid.
|
pure virtual |
Returns the prototype of a callable function in the target code.
index | The index of the callable function. |
lang | The language to use for the prototype. |
index
is out of bounds or lang
cannot be used for this target code.
|
pure virtual |
Returns the represented target code in ASCII representation.
|
pure virtual |
Returns the represented target code segment in ASCII representation.
index | The index of the code segment. |
NULL
if the index is out of bounds.
|
pure virtual |
Returns the number of code segments of the target code.
|
pure virtual |
Returns the description of the target code segment.
index | The index of the code segment. |
NULL
if the index is out of bounds. Returns the length of the represented target code segment.
index | The index of the code segment. |
0
if the index is out of bounds.
|
pure virtual |
Returns the length of the represented target code.
|
pure virtual |
Returns the resource index for use in an ITarget_argument_block
of resources already known when this ITarget_code
object was generated.
transaction | Transaction to retrieve resource names from tags. |
resource | The resource value. |
|
pure virtual |
Returns the name of a light profile resource used by the target code.
index | The index of the texture resource. |
NULL
if index
is out of range.
|
pure virtual |
Returns the number of light profile resources used by the target code.
|
pure virtual |
Returns the potential render state usage of the target code.
If the corresponding property bit is not set, it is guaranteed that the code does not use the associated render state property.
|
pure virtual |
Returns the number of constant data initializers.
|
pure virtual |
Returns the data of the constant data segment at the given index.
index | The index of the data segment. |
NULL
if the index is out of bounds.
|
pure virtual |
Returns the name of the constant data segment at the given index.
index | The index of the data segment. |
NULL
if the index is out of bounds. Returns the size of the constant data segment at the given index.
index | The index of the data segment. |
|
pure virtual |
Returns the string constant used by the target code.
index | The index of the string constant. |
NULL
if index
is out of range.
|
pure virtual |
Returns the number of string constants used by the target code.
|
pure virtual |
Returns the name of a texture resource used by the target code.
index | The index of the texture resource. |
NULL
if index
is out of range.
|
pure virtual |
Returns the number of texture resources used by the target code.
|
pure virtual |
Returns the texture shape of a given texture resource used by the target code.
index | The index of the texture resource. |
Texture_shape_invalid
if index
is out of range.