This module contains the MDL SDK API components representing the MDL compiler, its backends and the generated target code.
More...
|
typedef float | mi::neuraylib::tct_float |
| A float. More...
|
|
typedef mi::Float32_2_struct | mi::neuraylib::tct_float2 |
| A float2. More...
|
|
typedef mi::Float32_3_struct | mi::neuraylib::tct_float3 |
| A float3. More...
|
|
typedef mi::Float32_4_struct | mi::neuraylib::tct_float4 |
| A float4. More...
|
|
typedef mi::Sint32 | mi::neuraylib::tct_int |
| An int. More...
|
|
typedef mi::Uint32 | mi::neuraylib::tct_uint |
| An unsigned int. More...
|
|
typedef bool | mi::neuraylib::tct_bool |
| A bool. More...
|
|
typedef tct_traits<true>::tct_derivable_float | mi::neuraylib::tct_deriv_float |
| A float with derivatives. More...
|
|
typedef tct_traits<true>::tct_derivable_float2 | mi::neuraylib::tct_deriv_float2 |
| A float2 with derivatives. More...
|
|
typedef tct_traits<true>::tct_derivable_float3 | mi::neuraylib::tct_deriv_float3 |
| A float3 with derivatives. More...
|
|
typedef tct_traits<true>::tct_derivable_float4 | mi::neuraylib::tct_deriv_float4 |
| A float4 with derivatives. More...
|
|
typedef tct_deriv< float[2]> | mi::neuraylib::tct_deriv_arr_float_2 |
| A float[2] with derivatives (needed to avoid problems with wrong alignment). More...
|
|
typedef tct_deriv< float[3]> | mi::neuraylib::tct_deriv_arr_float_3 |
| A float[3] with derivatives (needed to avoid problems with wrong alignment). More...
|
|
typedef tct_deriv< float[4]> | mi::neuraylib::tct_deriv_arr_float_4 |
| A float[4] with derivatives (needed to avoid problems with wrong alignment). More...
|
|
typedef struct Shading_state_material_impl<false> | mi::neuraylib::Shading_state_material |
| The MDL material state structure. More...
|
|
typedef struct Shading_state_material_impl<true> | mi::neuraylib::Shading_state_material_with_derivs |
| The MDL material state structure with derivatives for the texture coordinates. More...
|
|
typedef Texture_handler_vtable_impl<false> | mi::neuraylib::Texture_handler_vtable |
| The texture handler vtable struct. More...
|
|
typedef Texture_handler_vtable_impl<true> | mi::neuraylib::Texture_handler_deriv_vtable |
| The texture handler vtable struct with derivatives for the texture coordinates. More...
|
|
typedef void() | mi::neuraylib::Environment_function(void *result, Shading_state_environment const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of environment functions created via mi::neuraylib::IMdl_backend::translate_environment() and mi::neuraylib::ILink_unit::add_function(). More...
|
|
typedef void() | mi::neuraylib::Material_expr_function(void *result, Shading_state_material const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of material expression functions created via mi::neuraylib::IMdl_backend::translate_material_expression() and mi::neuraylib::ILink_unit::add_material_expression(). More...
|
|
typedef void() | mi::neuraylib::Material_expr_function_with_derivs(void *result, Shading_state_material_with_derivs const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of material expression functions created via mi::neuraylib::IMdl_backend::translate_material_expression() and mi::neuraylib::ILink_unit::add_material_expression(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_init_function(Shading_state_material *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the initialization function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_init_function_with_derivs(Shading_state_material_with_derivs *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the initialization function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_sample_function(Bsdf_sample_data *data, Shading_state_material const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the importance sampling function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_sample_function_with_derivs(Bsdf_sample_data *data, Shading_state_material_with_derivs const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the importance sampling function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_evaluate_function(Bsdf_evaluate_data_base *data, Shading_state_material const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the evaluation function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_evaluate_function_with_derivs(Bsdf_evaluate_data_base *data, Shading_state_material_with_derivs const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the evaluation function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_pdf_function(Bsdf_pdf_data *data, Shading_state_material const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the probability density function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_pdf_function_with_derivs(Bsdf_pdf_data *data, Shading_state_material_with_derivs const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the probability density function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_auxiliary_function(Bsdf_auxiliary_data_base *data, Shading_state_material const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the auxiliary function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Bsdf_auxiliary_function_with_derivs(Bsdf_auxiliary_data_base *data, Shading_state_material_with_derivs const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the auxiliary function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_init_function(Shading_state_material *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the initialization function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_init_function_with_derivs(Shading_state_material_with_derivs *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the initialization function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_sample_function(Edf_sample_data *data, Shading_state_material const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the importance sampling function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_sample_function_with_derivs(Edf_sample_data *data, Shading_state_material_with_derivs const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the importance sampling function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_evaluate_function(Edf_evaluate_data_base *data, Shading_state_material const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the evaluation function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_evaluate_function_with_derivs(Edf_evaluate_data_base *data, Shading_state_material_with_derivs const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the evaluation function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_pdf_function(Edf_pdf_data *data, Shading_state_material const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the probability density function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_pdf_function_with_derivs(Edf_pdf_data *data, Shading_state_material_with_derivs const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the probability density function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_auxiliary_function(Edf_auxiliary_data_base *data, Shading_state_material const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the auxiliary function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
typedef void() | mi::neuraylib::Edf_auxiliary_function_with_derivs(Edf_auxiliary_data_base *data, Shading_state_material_with_derivs const *state, Resource_data const *res_data, char const *arg_block_data) |
| Signature of the auxiliary function for material distribution functions created via mi::neuraylib::IMdl_backend::translate_material_df() and mi::neuraylib::ILink_unit::add_material_df(). More...
|
|
|
enum | mi::neuraylib::ITarget_code::State_usage_property {
mi::neuraylib::ITarget_code::SU_POSITION = 0x0001u
,
mi::neuraylib::ITarget_code::SU_NORMAL = 0x0002u
,
mi::neuraylib::ITarget_code::SU_GEOMETRY_NORMAL = 0x0004u
,
mi::neuraylib::ITarget_code::SU_MOTION = 0x0008u
,
mi::neuraylib::ITarget_code::SU_TEXTURE_COORDINATE = 0x0010u
,
mi::neuraylib::ITarget_code::SU_TEXTURE_TANGENTS = 0x0020u
,
mi::neuraylib::ITarget_code::SU_TANGENT_SPACE = 0x0040u
,
mi::neuraylib::ITarget_code::SU_GEOMETRY_TANGENTS = 0x0080u
,
mi::neuraylib::ITarget_code::SU_DIRECTION = 0x0100u
,
mi::neuraylib::ITarget_code::SU_ANIMATION_TIME = 0x0200u
,
mi::neuraylib::ITarget_code::SU_ROUNDED_CORNER_NORMAL = 0x0400u
,
mi::neuraylib::ITarget_code::SU_ALL_VARYING_MASK = 0x07FFu
,
mi::neuraylib::ITarget_code::SU_TRANSFORMS = 0x0800u
,
mi::neuraylib::ITarget_code::SU_OBJECT_ID = 0x1000u
,
mi::neuraylib::ITarget_code::SU_ALL_UNIFORM_MASK = 0x1800u
,
SU_FORCE_32_BIT = 0xFFFFFFFFu
} |
| The potential state usage properties. More...
|
|
enum | mi::neuraylib::ITarget_code::Texture_shape {
mi::neuraylib::ITarget_code::Texture_shape_invalid = 0
,
mi::neuraylib::ITarget_code::Texture_shape_2d = 1
,
mi::neuraylib::ITarget_code::Texture_shape_3d = 2
,
mi::neuraylib::ITarget_code::Texture_shape_cube = 3
,
mi::neuraylib::ITarget_code::Texture_shape_ptex = 4
,
mi::neuraylib::ITarget_code::Texture_shape_bsdf_data = 5
,
Texture_shape_FORCE_32_BIT = 0xFFFFFFFFu
} |
|
enum | mi::neuraylib::ITarget_code::Prototype_language |
| Language to use for the callable function prototype. More...
|
|
enum | mi::neuraylib::ITarget_code::Distribution_kind |
| Possible kinds of distribution functions. More...
|
|
enum | mi::neuraylib::ITarget_code::Function_kind |
| Possible kinds of callable functions. More...
|
|
enum | mi::neuraylib::ITarget_code::Gamma_mode |
| Possible texture gamma modes. More...
|
|
enum | mi::neuraylib::ILink_unit::Function_execution_context {
mi::neuraylib::ILink_unit::FEC_ENVIRONMENT = 0
,
mi::neuraylib::ILink_unit::FEC_CORE = 1
,
mi::neuraylib::ILink_unit::FEC_DISPLACEMENT = 2
,
FEC_FORCE_32_BIT = 0xFFFFFFFFu
} |
| Execution context for functions. More...
|
|
enum | mi::neuraylib::Tex_wrap_mode {
mi::neuraylib::TEX_WRAP_CLAMP = 0
,
mi::neuraylib::TEX_WRAP_REPEAT = 1
,
mi::neuraylib::TEX_WRAP_MIRRORED_REPEAT = 2
,
mi::neuraylib::TEX_WRAP_CLIP = 3
} |
| The texture wrap modes as defined by tex::wrap_mode in the MDL specification. More...
|
|
enum | mi::neuraylib::Mbsdf_part {
mi::neuraylib::MBSDF_DATA_REFLECTION = 0
,
mi::neuraylib::MBSDF_DATA_TRANSMISSION = 1
} |
| MBSDFs can consist of two parts, which can be selected using this enumeration. More...
|
|
enum | mi::neuraylib::Bsdf_event_type |
| The type of events created by BSDF importance sampling. More...
|
|
enum | mi::neuraylib::Df_flags { mi::neuraylib::DF_FLAGS_NONE = 0
, DF_FLAGS_ALLOW_REFLECT = 1
, DF_FLAGS_ALLOW_TRANSMIT = 2
, DF_FLAGS_ALLOW_REFLECT_AND_TRANSMIT = DF_FLAGS_ALLOW_REFLECT | DF_FLAGS_ALLOW_TRANSMIT
, DF_FLAGS_ALLOWED_SCATTER_MODE_MASK = DF_FLAGS_ALLOW_REFLECT_AND_TRANSMIT
, DF_FLAGS_FORCE_32_BIT = 0xffffffffU
} |
| Flags controlling the calculation of DF results. More...
|
|
enum | mi::neuraylib::Df_handle_slot_mode {
mi::neuraylib::DF_HSM_POINTER = -2
,
mi::neuraylib::DF_HSM_NONE = -1
,
mi::neuraylib::DF_HSM_FIXED_1 = 1
,
mi::neuraylib::DF_HSM_FIXED_2 = 2
,
mi::neuraylib::DF_HSM_FIXED_4 = 4
,
mi::neuraylib::DF_HSM_FIXED_8 = 8
} |
| Type of Bsdf_evaluate_data variants, depending on the backend and its configuration. More...
|
|
enum | mi::neuraylib::Edf_event_type |
| The type of events created by EDF importance sampling. More...
|
|
|
virtual Sint32 | mi::neuraylib::IMdl_backend::set_option (const char *name, const char *value)=0 |
| Sets a backend option. More...
|
|
virtual Sint32 | mi::neuraylib::IMdl_backend::set_option_binary (const char *name, const char *data, Size size)=0 |
| Sets a binary backend option. More...
|
|
virtual const Uint8 * | mi::neuraylib::IMdl_backend::get_device_library (Size &size) const =0 |
| Returns the representation of a device library for this backend if one exists. More...
|
|
virtual const ITarget_code * | mi::neuraylib::IMdl_backend::translate_environment (ITransaction *transaction, const IFunction_call *call, const char *fname, IMdl_execution_context *context)=0 |
| Transforms an MDL environment function call into target code. More...
|
|
virtual const ITarget_code * | mi::neuraylib::IMdl_backend::translate_material_expression (ITransaction *transaction, const ICompiled_material *material, const char *path, const char *fname, IMdl_execution_context *context)=0 |
| Transforms an expression that is part of an MDL material instance to target code. More...
|
|
virtual const ITarget_code * | mi::neuraylib::IMdl_backend::translate_material_df (ITransaction *transaction, const ICompiled_material *material, const char *path, const char *base_fname, IMdl_execution_context *context)=0 |
| Transforms an MDL distribution function to target code. More...
|
|
virtual const ITarget_code * | mi::neuraylib::IMdl_backend::translate_material (ITransaction *transaction, const ICompiled_material *material, Target_function_description *function_descriptions, Size description_count, IMdl_execution_context *context)=0 |
| Transforms (multiple) distribution functions and expressions of a material to target code. More...
|
|
virtual ILink_unit * | mi::neuraylib::IMdl_backend::create_link_unit (ITransaction *transaction, IMdl_execution_context *context)=0 |
| Creates a new link unit. More...
|
|
virtual const ITarget_code * | mi::neuraylib::IMdl_backend::translate_link_unit (const ILink_unit *lu, IMdl_execution_context *context)=0 |
| Transforms a link unit to target code. More...
|
|
virtual const ITarget_code * | mi::neuraylib::IMdl_backend::deserialize_target_code (ITransaction *transaction, const IBuffer *buffer, IMdl_execution_context *context) const =0 |
| Restores an instance of ITarget_code from a buffer. More...
|
|
virtual const ITarget_code * | mi::neuraylib::IMdl_backend::deserialize_target_code (ITransaction *transaction, const Uint8 *buffer_data, Size buffer_size, IMdl_execution_context *context) const =0 |
| Restores an instance of ITarget_code from a buffer. More...
|
|
virtual Uint32 | mi::neuraylib::ITarget_resource_callback::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 | mi::neuraylib::ITarget_resource_callback::get_string_index (IValue_string const *s)=0 |
| Returns a string identifier for the given string value usable by the target code. More...
|
|
virtual const char * | mi::neuraylib::ITarget_argument_block::get_data () const =0 |
| Returns the target argument block data. More...
|
|
virtual char * | mi::neuraylib::ITarget_argument_block::get_data ()=0 |
| Returns the target argument block data. More...
|
|
virtual Size | mi::neuraylib::ITarget_argument_block::get_size () const =0 |
| Returns the size of the target argument block data. More...
|
|
virtual ITarget_argument_block * | mi::neuraylib::ITarget_argument_block::clone () const =0 |
| Clones the argument block (to make it writable). More...
|
|
virtual Size | mi::neuraylib::ITarget_value_layout::get_size () const =0 |
| Returns the size of the target argument block. More...
|
|
virtual Size | mi::neuraylib::ITarget_value_layout::get_num_elements (Target_value_layout_state state=Target_value_layout_state()) const =0 |
| Get the number of arguments / elements at the given layout state. More...
|
|
virtual Size | mi::neuraylib::ITarget_value_layout::get_layout (IValue::Kind &kind, Size &arg_size, Target_value_layout_state state=Target_value_layout_state()) const =0 |
| Get the offset, the size and the kind of the argument / element inside the argument block at the given layout state. More...
|
|
virtual Target_value_layout_state | mi::neuraylib::ITarget_value_layout::get_nested_state (Size i, Target_value_layout_state state=Target_value_layout_state()) const =0 |
| Get the layout state for the i'th argument / element inside the argument value block at the given layout state. More...
|
|
virtual Sint32 | mi::neuraylib::ITarget_value_layout::set_value (char *block, IValue const *value, ITarget_resource_callback *resource_callback, Target_value_layout_state state=Target_value_layout_state()) const =0 |
| Set the value inside the given block at the given layout state. More...
|
|
virtual IMdl_backend_api::Mdl_backend_kind | mi::neuraylib::ITarget_code::get_backend_kind () const =0 |
| Returns the kind of backend this information belongs to. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_code () const =0 |
| Returns the represented target code in ASCII representation. More...
|
|
virtual Size | mi::neuraylib::ITarget_code::get_code_size () const =0 |
| Returns the length of the represented target code. More...
|
|
virtual Size | mi::neuraylib::ITarget_code::get_callable_function_count () const =0 |
| Returns the number of callable functions in the target code. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_callable_function (Size index) const =0 |
| Returns the name of a callable function in the target code. More...
|
|
virtual Sint32 | mi::neuraylib::ILink_unit::add_material_expression (const ICompiled_material *inst, const char *path, const char *fname, IMdl_execution_context *context)=0 |
| Add an expression that is part of an MDL material instance as a function to this link unit. More...
|
|
virtual Sint32 | mi::neuraylib::ILink_unit::add_material_df (const ICompiled_material *material, const char *path, const char *base_fname, IMdl_execution_context *context)=0 |
| Add an MDL distribution function to this link unit. More...
|
|
virtual Sint32 | mi::neuraylib::ILink_unit::add_material (const ICompiled_material *material, Target_function_description *function_descriptions, Size description_count, IMdl_execution_context *context)=0 |
| Add (multiple) MDL distribution functions and expressions of a material to this link unit. More...
|
|
virtual Sint32 | mi::neuraylib::ILink_unit::add_function (const IFunction_call *call, Function_execution_context fexc, const char *fname, IMdl_execution_context *context=0)=0 |
| Add an MDL function call as a function to this link unit. More...
|
|
virtual Sint32 | mi::neuraylib::ILink_unit::add_function (const IFunction_definition *function, Function_execution_context fexc, const char *fname, IMdl_execution_context *context)=0 |
| Add an MDL function definition as a function to this link unit. More...
|
|
|
virtual Size | mi::neuraylib::ITarget_code::get_bsdf_measurement_count () const =0 |
| Returns the number of bsdf measurement resources used by the target code. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_bsdf_measurement (Size index) const =0 |
| Returns the name of a bsdf measurement resource used by the target code. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_bsdf_measurement_url (Size index) const =0 |
| Returns the MDL file path of a BSDF measurement resource used by the target code if no database element is associated to the resource. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_bsdf_measurement_owner_module (Size index) const =0 |
| Returns the owner module name of a relative BSDF measurement file path. More...
|
|
virtual bool | mi::neuraylib::ITarget_code::get_bsdf_measurement_is_body_resource (Size index) const =0 |
| Check whether the BSDF measurement resource is coming from the body of expressions (not solely from material arguments). More...
|
|
virtual Size | mi::neuraylib::ITarget_code::get_ro_data_segment_count () const =0 |
| Returns the number of constant data initializers. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_ro_data_segment_name (Size index) const =0 |
| Returns the name of the constant data segment at the given index. More...
|
|
virtual Size | mi::neuraylib::ITarget_code::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 * | mi::neuraylib::ITarget_code::get_ro_data_segment_data (Size index) const =0 |
| Returns the data of the constant data segment at the given index. More...
|
|
virtual Size | mi::neuraylib::ITarget_code::get_code_segment_count () const =0 |
| Returns the number of code segments of the target code. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_code_segment (Size index) const =0 |
| Returns the represented target code segment in ASCII representation. More...
|
|
virtual Size | mi::neuraylib::ITarget_code::get_code_segment_size (Size index) const =0 |
| Returns the length of the represented target code segment. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_code_segment_description (Size index) const =0 |
| Returns the description of the target code segment. More...
|
|
virtual State_usage | mi::neuraylib::ITarget_code::get_render_state_usage () const =0 |
| Returns the potential render state usage of the target code. More...
|
|
virtual Size | mi::neuraylib::ITarget_code::get_argument_block_count () const =0 |
| Returns the number of target argument blocks. More...
|
|
virtual const ITarget_argument_block * | mi::neuraylib::ITarget_code::get_argument_block (Size index) const =0 |
| Get a target argument block if available. More...
|
|
virtual ITarget_argument_block * | mi::neuraylib::ITarget_code::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 Size | mi::neuraylib::ITarget_code::get_argument_layout_count () const =0 |
| Returns the number of target argument block layouts. More...
|
|
virtual const ITarget_value_layout * | mi::neuraylib::ITarget_code::get_argument_block_layout (Size index) const =0 |
| Get a captured arguments block layout if available. More...
|
|
virtual Size | mi::neuraylib::ITarget_code::get_string_constant_count () const =0 |
| Returns the number of string constants used by the target code. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_string_constant (Size index) const =0 |
| Returns the string constant used by the target code. More...
|
|
virtual Uint32 | mi::neuraylib::ITarget_code::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 * | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::get_callable_function_kind (Size index) const =0 |
| Returns the function kind of a callable function in the target code. More...
|
|
virtual Size | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::execute_bsdf_evaluate (Size index, Bsdf_evaluate_data_base *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 | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::execute_bsdf_auxiliary (Size index, Bsdf_auxiliary_data_base *data, const Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
| Run the BSDF auxiliary calculation function for this code on the native CPU. More...
|
|
virtual Sint32 | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::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 | mi::neuraylib::ITarget_code::execute_edf_evaluate (Size index, Edf_evaluate_data_base *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 | mi::neuraylib::ITarget_code::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...
|
|
virtual Sint32 | mi::neuraylib::ITarget_code::execute_edf_auxiliary (Size index, Edf_auxiliary_data_base *data, const Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
| Run the EDF auxiliary calculation function for this code on the native CPU. More...
|
|
virtual Size | mi::neuraylib::ITarget_code::get_callable_function_df_handle_count (Size func_index) const =0 |
| Get the number of distribution function handles referenced by a callable function. More...
|
|
virtual const char * | mi::neuraylib::ITarget_code::get_callable_function_df_handle (Size func_index, Size handle_index) const =0 |
| Get the name of a distribution function handle referenced by a callable function. More...
|
|
virtual bool | mi::neuraylib::ITarget_code::supports_serialization () const =0 |
| Indicates whether the target code can be serialized. More...
|
|
virtual const IBuffer * | mi::neuraylib::ITarget_code::serialize (IMdl_execution_context *context) const =0 |
| Stores the data of this object in a buffer that can written to an external cache. More...
|
|
virtual State_usage | mi::neuraylib::ITarget_code::get_callable_function_render_state_usage (Size index) const =0 |
| Returns the potential render state usage of callable function in the target code. More...
|
|
virtual Sint32 | mi::neuraylib::ITarget_code::execute_init (Size index, Shading_state_material &state, Texture_handler_base *tex_handler, const ITarget_argument_block *cap_args) const =0 |
| Run the init function for this code on the native CPU (single-init mode). More...
|
|
virtual Size MI_NEURAYLIB_DEPRECATED_METHOD_14_0() | mi::neuraylib::ITarget_code::get_body_texture_count () const =0 |
|
virtual Size MI_NEURAYLIB_DEPRECATED_METHOD_14_0() | mi::neuraylib::ITarget_code::get_body_light_profile_count () const =0 |
|
virtual Size MI_NEURAYLIB_DEPRECATED_METHOD_14_0() | mi::neuraylib::ITarget_code::get_body_bsdf_measurement_count () const =0 |
|
This module contains the MDL SDK API components representing the MDL compiler, its backends and the generated target code.
virtual Sint32 mi::neuraylib::IMdl_backend::set_option |
( |
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
|
pure virtual |
Sets a backend option.
The following options are supported by all backends:
"compile_constants"
: If true
, compile simple constants into functions returning constants. If false
, do not compile simple constants but return error -4. Possible values: "on"
, "off"
. Default: "on"
.
"fast_math"
: Enables/disables unsafe floating point optimization. Possible values: "on"
, "off"
. Default: "on"
.
"opt_level"
: Set the optimization level. Possible values:
"0"
: no optimization
"1"
: no inlining, no expensive optimizations
"2"
: full optimizations, including inlining (default)
"num_texture_spaces"
: Set the number of supported texture spaces. Default: "32"
.
"enable_auxiliary"
: Enable code generation for auxiliary methods on distribution functions. For BSDFs, these compute albedo approximations and normals. For EDFs, the functions exist only as placeholder for future use. Possible values: "on"
, "off"
. Default: "off"
.
"enable_pdf"
: Enable code generation of PDF method on distribution functions. Possible values: "on"
, "off"
. Default: "on"
.
"df_handle_slot_mode"
: When using light path expressions, individual parts of the distribution functions can be selected using "handles". The contribution of each of those parts has to be evaluated during rendering. This option controls how many parts are evaluated with each call into the generated "evaluate" and "auxiliary" functions and how the data is passed. Possible values: "none"
, "fixed_1"
, "fixed_2"
, "fixed_4"
, "fixed_8"
, and "pointer"
, while "pointer"
is not available for all backends. Default: "none"
.
"libbsdf_flags_in_bsdf_data"
: If enabled, the generated code will use the optional "flags"
field in the BSDF data structures. Possible values: "on"
, "off"
. Default: "off"
.
The following options are supported by the NATIVE backend only:
"use_builtin_resource_handler"
: Enables/disables the built-in texture runtime. Possible values: "on"
, "off"
. Default: "on"
.
The following options are supported by the PTX, LLVM-IR, native, GLSL and HLSL backend:
"inline_aggressively"
: Enables/disables aggressive inlining. Possible values: "on"
, "off"
. Default: "off"
.
"eval_dag_ternary_strictly"
: Enables/disables strict evaluation of ternary operators on the DAG. Possible values: "on"
, "off"
. Default: "on"
.
"enable_exceptions"
: Enables/disables support for exceptions through runtime function calls on CPU. For GPU, this options is always treated as disabled. Possible values: "on"
, "off"
. Default: "off"
.
"enable_ro_segment"
: Enables/disables the creation of the read-only data segment calls. Possible values: "on"
, "off"
. Default: "off"
.
"max_const_data"
: Specifies the maximum size of a constant in bytes to be put into the generated code, if the "enable_ro_segment"
option is enabled. Bigger constants will be moved into the read-only data segment. If the "glsl_max_const_data"
option is also used, the read-only data segment has priority.
"num_texture_results"
: Set the size of the text_results array in the MDL SDK state in number of float4 elements. The array has to be provided by the renderer and must be provided per thread (for example as an array on the stack) and will be filled in the init function created for a material and used by the sample, evaluate and pdf functions, if the size is non-zero. Default: "0"
.
"texture_runtime_with_derivs"
: Enables/disables derivative support for texture lookup functions. If enabled, the user-provided texture runtime has to provide functions with derivative parameters for the texture coordinates. Possible values: "on"
, "off"
. Default: "off"
.
"visible_functions"
: Comma-separated list of function names which will be visible in the generated code (empty string means no special restriction). Can especially be used in combination with "llvm_renderer_module"
binary option to limit the number of functions for which target code will be generated. Default: ""
"use_renderer_adapt_normal"
: If enabled, the generated code expects the renderer to provide a function with the prototype "void adapt_normal(float result[3], Textue_handler_base const *self,
Shading_state_material *state, float const normal[3])"
which can adapt the normal of BSDFs. For native: The function must be set in the vtable of the Texture_handler_base
object provided to the execute functions. If the built-in texture runtime is used, only the adapt_normal
entry of the vtable needs to be set. For HLSL: The expected function is "float3 mdl_adapt_normal(Shading_state_material state, float3 normal)"
. Possible values: "on"
, "off"
. Default: "off"
.
The following options are supported by the PTX and LLVM-IR only:
"lambda_return_mode"
: Selects how generated lambda functions return their results. Possible value:
"default"
: Use the default mode for the backend, currently always sret mode
"sret"
: Write the result into a buffer provided as first argument
"value"
: Return the value directly. If the type is not supported as return type by the backend, fallback to sret mode. Currently only supports base types and vector types as return types.
The following options are supported by the LLVM-IR backend only:
"enable_simd"
: Enables/disables the use of SIMD instructions. Possible values: "on"
, "off"
. Default: "on"
.
"write_bitcode"
: Enables/disables the creation of the LLVM bitcode instead of LLVM IR. Possible values: "on"
, "off"
. Default: "off"
.
The following options are supported by the PTX backend only:
"sm_version"
: Specifies the SM target version. Possible values: "20"
, "30"
, "35"
, "37"
, "50"
, "52"
, "60"
, "61"
, "62"
. "70"
, "75"
, "80"
, and "86"
. Default: "20"
.
"enable_ro_segment"
: Enables/disables the creation of the read-only data segment calls. Possible values: "on"
, "off"
. Default: "off"
.
"link_libdevice"
: Enables/disables linking of libdevice before PTX is generated. Possible values: "on"
, "off"
. Default: "on"
.
"output_format"
: Selects the output format of the backend. Possible values: "PTX"
, "LLVM-IR"
, "LLVM-BC"
. Default: "PTX"
.
"tex_lookup_call_mode"
: Selects how tex_lookup calls will be generated. See Texture lookup call modes of the PTX backend for more details. Possible values:
"vtable"
: generate calls through a vtable call (default)
"direct_call"
: generate direct function calls
"optix_cp"
: generate calls through OptiX bindless callable programs
The following options are supported by the HLSL backend only:
"hlsl_use_resource_data"
: If enabled, an extra user defined resource data struct is passed to all resource callbacks. This option is currently not supported. Possible values: "on"
, "off"
. Default: "off"
.
"hlsl_remap_functions"
: Specifies a comma separated remap list of MDL functions. The entries must be specified as <old_name>=<new_name>. Both names have to be in mangled form. Default: ""
.
"df_handle_slot_mode"
: The option "pointer"
is not available (see above).
"use_renderer_adapt_microfacet_roughness"
: If enabled, the generated code expects the renderer to provide a function with the prototype
The MDL material state structure inside the MDL SDK is a representation of the renderer state as defi...
Definition: target_code_types.h:210
which can adapt the roughness of microfacet BSDFs. For sheen_bsdf, the same roughness will be provided in both dimensions and only the x
component of the result will be used. Possible values: "on"
, "off"
. Default: "off"
.
The following options are supported by the GLSL backend only:
"glsl_version"
: Specifies the GLSL target version. Possible values for "core" and "compatibility" profiles: "150"
, "330"
, "400"
, "410"
, "420"
, "430"
, "440"
, "450"
, "460"
. Values for the "es" profile: "100"
, "300"
, "310"
. Default: "450"
.
"glsl_profile"
: Specifies the GLSL target profile. Possible values: "core"
, "es"
, "compatibility"
. Default: "core"
.
"glsl_include_uniform_state"
: If true
, object_id will be included in the state according to the "glsl_state_object_id_mode"
option. Possible values: "on"
, "off"
. Default: "off"
"glsl_max_const_data"
: Specifies the maximum size of a constant in bytes to be put into the generated GLSL code, if the "glsl_place_uniforms_into_ssbo" option is enabled. Bigger constants will be moved into the SSBO. If the "max_const_data"
option is also used, the read-only data segment has priority. Default: "1024"
.
"glsl_place_uniforms_into_ssbo"
: If true
, all generated uniform inputs will be placed into a shader storage buffer object. This option can only be enabled, if the "GL_ARB_shader_storage_buffer_object"
extension is enabled. Possible values: "on"
, "off"
. Default: "off"
"glsl_uniform_ssbo_name"
: If non-empty, specifies a name for the SSBO buffer containing the uniform initializer if option "glsl_place_uniforms_into_ssbo"
is enabled. Possible values: Any valid GLSL identifier. Default: ""
.
"glsl_uniform_ssbo_binding"
: A GLSL binding attribute expression for the SSBO buffer. Possible values: Currently limited to unsigned literals. Default: ""
(Means no "binding" attribute)
"glsl_uniform_ssbo_set"
: A GLSL set attribute expression for the SSBO buffer. Possible values: Currently limited to unsigned literals. Default: ""
(Means no "set" attribute)
"glsl_use_resource_data"
: If enabled, an extra user defined resource data struct is passed to all resource callbacks. This option is currently not supported. Possible values: "on"
, "off"
. Default: "off"
.
"glsl_remap_functions"
: Specifies a comma separated remap list of MDL functions. The entries must be specified as <old_name>=<new_name>. Both names have to be in mangled form. Default: ""
.
"glsl_state_animation_time_mode"
: Specify the implementation mode of state::animation_time(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "zero"
.
"glsl_state_geometry_normal_mode"
: Specify the implementation mode of state::geometry_normal(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "field"
.
"glsl_state_motion_mode"
: Specify the implementation mode of state::motion(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "zero"
.
"glsl_state_normal_mode"
: Specify the implementation mode of state::normal(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "field"
.
"glsl_state_object_id_mode"
: Specify the implementation mode of state::object_id(). You have to enable "glsl_include_uniform_state"
for this mode to have any effect. Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "zero"
.
"glsl_state_position_mode"
: Specify the implementation mode of state::position(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "field"
.
"glsl_state_texture_coordinate_mode"
: Specify the implementation mode of state::texture_coordinate(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "zero"
.
"glsl_state_texture_space_max_mode"
: Specify the implementation mode of state::texture_space_max(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "zero"
.
"glsl_state_texture_tangent_u_mode"
: Specify the implementation mode of state::texture_tangent_u(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "zero"
.
"glsl_state_texture_tangent_v_mode"
: Specify the implementation mode of state::texture_tangent_v(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "zero"
.
"glsl_state_geometry_tangent_u_mode"
: Specify the implementation mode of state::geometry_tangent_u(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "zero"
.
"glsl_state_geometry_tangent_v_mode"
: Specify the implementation mode of state::geometry_tangent_v(). Possible values: "field"
, "arg"
, "func"
, "zero"
. Default: "zero"
.
"glsl_enabled_extensions"
: Specifies the enabled GLSL extensions as a comma separated list. Default: ""
.
"glsl_required_extensions"
: Specifies the required GLSL extensions as a comma separated list. Default: ""
.
The following extensions are fully supported by the GLSL backend:
"GL_ARB_gpu_shader_fp64"
"GL_ARB_shader_atomic_counters"
"GL_ARB_shading_language_420pack"
"GL_ARB_arrays_of_arrays"
The following extensions are partially supported by the GLSL backend:
"GL_OES_texture_3D"
"GL_OES_standard_derivatives"
"GL_OES_EGL_image_external"
"GL_EXT_frag_depth"
"GL_EXT_shader_texture_lod"
"GL_EXT_shader_implicit_conversions"
"GL_ARB_texture_rectangle"
"GL_ARB_texture_gather"
"GL_ARB_gpu_shader5"
"GL_ARB_separate_shader_objects"
"GL_ARB_tessellation_shader"
"GL_ARB_enhanced_layouts"
"GL_ARB_texture_cube_map_array"
"GL_ARB_shader_texture_lod"
"GL_ARB_explicit_attrib_location"
"GL_ARB_shader_image_load_store"
"GL_ARB_derivative_control"
"GL_ARB_shader_texture_image_samples"
"GL_ARB_viewport_array"
"GL_ARB_cull_distance"
"GL_ARB_shader_subroutine"
"GL_ARB_shader_storage_buffer_object"
"GL_ARB_bindless_texture"
"GL_ARB_gpu_shader_int64"
"GL_3DL_array_objects"
"GL_KHR_vulkan_glsl"
"GL_NV_shader_buffer_load"
"GL_NV_half_float"
"GL_NV_gpu_shader5"
"GL_AMD_gpu_shader_half_float"
"GL_GOOGLE_cpp_style_line_directive"
"GL_GOOGLE_include_directive"
Meaning of the state modes:
"field"
: access a field of a passed state struct
"arg"
: access an argument of the generated shader
"func"
: call a wrapper function
"zero"
: always zero
- Note
- In this version, state modes cannot be configured and are always fixed to "field"!
- Parameters
-
name | The name of the option. |
value | The value of the option. |
- Returns
- 0: Success.
- -1: Unknown option.
- -2: Unsupported value.