6#ifndef MDL_GENERATED_DAG_H
7#define MDL_GENERATED_DAG_H 1
10#include <mi/mdl/mdl_iowned.h>
11#include <mi/mdl/mdl_generated_code.h>
12#include <mi/mdl/mdl_values.h>
17class ICall_name_resolver;
18class IResource_modifier;
34 memset(hash, 0,
sizeof(hash));
40 explicit DAG_hash(
unsigned char const (&arr)[16])
42 memcpy(hash, arr,
sizeof(hash));
49 return memcmp(hash, other.hash,
sizeof(hash)) == 0;
56 return memcmp(hash, other.hash,
sizeof(hash)) != 0;
63 return memcmp(hash, other.hash,
sizeof(hash)) < 0;
70 return memcmp(hash, other.hash,
sizeof(hash)) <= 0;
77 return memcmp(hash, other.hash,
sizeof(hash)) > 0;
84 return memcmp(hash, other.hash,
sizeof(hash)) >= 0;
106 unsigned char const *
data()
const {
111 static size_t size() {
return 16; }
114 unsigned char hash[16];
266 IValue_resource
const *res)
const = 0;
279 <0x01dbe5fb,0xa13d,0x42eb,0xbe,0x3e,0x0a,0x1d,0x2c,0x53,0x11,0xdf,
280 mi::base::IInterface>
304 char const *signature,
305 IDefinition::Semantics sema,
308 IType
const *ret_type) = 0;
353 IDefinition::Semantics sema)
const = 0;
364 IValue_factory *value_factory,
365 IDefinition::Semantics sema,
366 IValue
const *
const arguments[],
367 size_t n_arguments)
const = 0;
391 mi::base::Interface_declare<0x9dbfd12e,0x8207,0x4a47,0x8c,0x1f,0x5f,0x9a,0xc4,0x9b,0x00,0xf6,
439 char const *signature,
440 IDefinition::Semantics sema,
443 IType
const *ret_type) = 0;
486 static char const MESSAGE_CLASS =
'C';
558 size_t function_index,
559 size_t parameter_index)
const = 0;
567 size_t function_index,
568 size_t parameter_index)
const = 0;
577 size_t function_index,
578 size_t parameter_index)
const = 0;
586 size_t function_index,
587 char const *parameter_name)
const = 0;
595 size_t function_index,
596 size_t parameter_index)
const = 0;
604 size_t function_index,
605 size_t parameter_index)
const = 0;
614 size_t function_index,
615 size_t parameter_index,
616 size_t user_index)
const = 0;
624 size_t function_index)
const = 0;
672 size_t material_index,
673 size_t parameter_index)
const = 0;
682 size_t material_index,
683 size_t parameter_index)
const = 0;
692 size_t material_index,
693 size_t parameter_index)
const = 0;
701 size_t material_index,
702 char const *parameter_name)
const = 0;
710 size_t material_index,
711 size_t parameter_index)
const = 0;
719 size_t material_index,
720 size_t parameter_index)
const = 0;
729 size_t material_index,
730 size_t parameter_index,
731 size_t user_index)
const = 0;
739 size_t material_index)
const = 0;
749 size_t function_index)
const = 0;
757 size_t function_index,
758 size_t annotation_index)
const = 0;
765 size_t function_index)
const = 0;
773 size_t function_index,
774 size_t annotation_index)
const = 0;
783 size_t function_index,
784 size_t parameter_index)
const = 0;
793 size_t function_index,
794 size_t parameter_index)
const = 0;
804 size_t function_index,
805 size_t parameter_index,
806 size_t annotation_index)
const = 0;
813 size_t function_index)
const = 0;
821 size_t function_index,
822 size_t temporary_index)
const = 0;
830 size_t function_index,
831 size_t temporary_index)
const = 0;
838 size_t function_index)
const = 0;
846 size_t function_index)
const = 0;
860 size_t function_index,
875 size_t function_index,
876 size_t callee_index)
const = 0;
884 size_t function_index)
const = 0;
891 size_t material_index)
const = 0;
899 size_t material_index,
900 size_t annotation_index)
const = 0;
909 size_t material_index,
910 size_t parameter_index)
const = 0;
917 size_t material_index)
const = 0;
925 size_t material_index,
926 size_t annotation_index)
const = 0;
935 size_t material_index,
936 size_t parameter_index)
const = 0;
946 size_t material_index,
947 size_t parameter_index,
948 size_t annotation_index)
const = 0;
955 size_t material_index)
const = 0;
963 size_t material_index,
964 size_t temporary_index)
const = 0;
972 size_t material_index,
973 size_t temporary_index)
const = 0;
980 size_t material_index)
const = 0;
987 size_t material_index)
const = 0;
1000 size_t material_index,
1015 size_t material_index,
1016 size_t callee_index)
const = 0;
1024 size_t material_index)
const = 0;
1045 size_t index)
const = 0;
1052 size_t index)
const = 0;
1059 size_t index)
const = 0;
1069 size_t annotation_index)
const = 0;
1076 size_t index)
const = 0;
1086 size_t index)
const = 0;
1093 size_t index)
const = 0;
1100 size_t index)
const = 0;
1107 size_t index)
const = 0;
1114 size_t index)
const = 0;
1123 size_t annotation_index)
const = 0;
1130 size_t type_index)
const = 0;
1139 size_t entity_index)
const = 0;
1148 size_t entity_index)
const = 0;
1158 size_t entity_index)
const = 0;
1169 size_t entity_index,
1170 size_t annotation_index)
const = 0;
1180 size_t index)
const = 0;
1187 size_t index)
const = 0;
1193 size_t index)
const = 0;
1201 size_t constant_index,
1202 size_t annotation_index)
const = 0;
1223 size_t annotation_index)
const = 0;
1238 size_t annotation_index)
const = 0;
1245 size_t annotation_index)
const = 0;
1252 size_t annotation_index)
const = 0;
1260 size_t annotation_index)
const = 0;
1267 size_t annotation_index)
const = 0;
1276 size_t annotation_index,
1277 size_t parameter_index)
const = 0;
1285 size_t annotation_index,
1286 size_t parameter_index)
const = 0;
1295 size_t annotation_index,
1296 size_t parameter_index)
const = 0;
1304 size_t annotation_index,
1305 char const *parameter_name)
const = 0;
1314 size_t annotation_index,
1315 size_t parameter_index)
const = 0;
1323 size_t annotation_index,
1331 size_t annotation_index)
const = 0;
1339 size_t anno_decl_index,
1340 size_t annotation_index)
const = 0;
1346 IValue_resource
const *res)
const = 0;
1353 IValue_resource
const *res,
1381 <0x29c36255,0x7558,0x4865,0xa7,0x7e,0xaa,0x3a,0x50,0x4f,0x70,0xbc,
1465 typedef unsigned Properties;
1499 char const *signature,
1500 IDefinition::Semantics sema,
1503 IType
const *ret_type) = 0;
1550 ICall_name_resolver *resolver,
1551 IResource_modifier *resource_modifier,
1555 bool use_temporaries,
1558 bool fold_meters_per_scene_unit,
1559 float mdl_meters_per_scene_unit,
1560 float wavelength_min,
1561 float wavelength_max,
1562 char const *
const fold_params[],
1563 size_t num_fold_params,
1564 IType
const *target_type) = 0;
1605 IValue
const *&value_result)
const = 0;
1701 IValue_resource
const *res,
1720 return node->
get_kind() == T::s_kind;
1726 return (type->
get_kind() == T::s_kind) ?
static_cast<T *
>(type) : NULL;
1732 return (type->
get_kind() == T::s_kind) ?
static_cast<const T *
>(type) : NULL;
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
A DAG IR call.
Definition: mdl_generated_dag.h:173
virtual char const * get_name() const =0
Get the signature of the called function.
virtual size_t get_name_hash() const =0
Get the name hash.
virtual DAG_node const * get_argument(char const *name) const =0
Get the argument for parameter name.
virtual char const * get_parameter_name(int index) const =0
Get the name of the parameter corresponding to the argument at position index.
virtual int get_argument_count() const =0
Get the number of arguments.
static Kind const s_kind
The kind of this subclass.
Definition: mdl_generated_dag.h:200
virtual IDefinition::Semantics get_semantic() const =0
Get the semantic of the called function if known.
virtual void set_argument(int index, DAG_node const *arg)=0
Set the argument expression of a call.
virtual DAG_node const * get_argument(int index) const =0
Get the argument at position index.
A DAG IR constant.
Definition: mdl_generated_dag.h:144
static Kind const s_kind
The kind of this subclass.
Definition: mdl_generated_dag.h:147
virtual IValue const * get_value() const =0
Get the value of the constant.
A hash value.
Definition: mdl_generated_dag.h:30
unsigned char operator[](size_t n) const
Read hash bytes.
Definition: mdl_generated_dag.h:90
unsigned char * data()
Access raw data.
Definition: mdl_generated_dag.h:99
DAG_hash()
Default constructor.
Definition: mdl_generated_dag.h:33
bool operator<=(DAG_hash const &other) const
Compare two hashes for less-than or equal.
Definition: mdl_generated_dag.h:69
bool operator<(DAG_hash const &other) const
Compare two hashes for less-than.
Definition: mdl_generated_dag.h:62
bool operator>=(DAG_hash const &other) const
Compare two hashes for greater-than or equal.
Definition: mdl_generated_dag.h:83
bool operator==(DAG_hash const &other) const
Compare two hashes for equality.
Definition: mdl_generated_dag.h:48
DAG_hash(unsigned char const (&arr)[16])
Constructor from an array of 16 bytes.
Definition: mdl_generated_dag.h:40
bool operator!=(DAG_hash const &other) const
Compare two hashes for non-equality.
Definition: mdl_generated_dag.h:55
bool operator>(DAG_hash const &other) const
Compare two hashes for greater-than.
Definition: mdl_generated_dag.h:76
static size_t size()
Get the size of the raw data.
Definition: mdl_generated_dag.h:111
unsigned char const * data() const
Read-only access raw data.
Definition: mdl_generated_dag.h:106
A node inside the DAG Intermediate Representation.
Definition: mdl_generated_dag.h:118
virtual Kind get_kind() const =0
Get the kind of this DAG IR node.
Kind
The possible kinds of DAG IR nodes.
Definition: mdl_generated_dag.h:121
@ EK_TEMPORARY
A temporary.
Definition: mdl_generated_dag.h:123
@ EK_PARAMETER
A parameter.
Definition: mdl_generated_dag.h:125
@ EK_CONSTANT
A constant.
Definition: mdl_generated_dag.h:122
@ EK_CALL
A call.
Definition: mdl_generated_dag.h:124
virtual size_t get_id() const =0
Get the unique ID of this DAG IR node.
virtual IType const * get_type() const =0
Get the type of this DAG IR node.
A DAG IR parameter reference.
Definition: mdl_generated_dag.h:250
virtual int get_index() const =0
Get the index of the referenced parameter.
static Kind const s_kind
The kind of this subclass.
Definition: mdl_generated_dag.h:253
A DAG IR temporary reference.
Definition: mdl_generated_dag.h:157
static Kind const s_kind
The kind of this subclass.
Definition: mdl_generated_dag.h:160
virtual DAG_node const * get_expr() const =0
Get the node of the temporary.
virtual int get_index() const =0
Get the index (the "name") of the referenced temporary.
A Helper interface to do renderer specific constant folding.
Definition: mdl_generated_dag.h:346
virtual IValue const * evaluate_intrinsic_function(IValue_factory *value_factory, IDefinition::Semantics sema, IValue const *const arguments[], size_t n_arguments) const =0
Evaluate an intrinsic function.
virtual bool is_evaluate_intrinsic_function_enabled(IDefinition::Semantics sema) const =0
Check whether evaluate_intrinsic_function() should be called for an unhandled intrinsic functions wit...
A Builder for DAG graphs.
Definition: mdl_generated_dag.h:281
virtual DAG_node const * create_call(char const *signature, IDefinition::Semantics sema, DAG_call::Call_argument const call_args[], int num_call_args, IType const *ret_type)=0
Create a call.
virtual DAG_parameter const * create_parameter(IType const *type, int index)=0
Create a parameter reference.
virtual IType_factory * get_type_factory()=0
Get the type factory of this instance.
virtual bool enable_cse(bool flag)=0
Enable common subexpression elimination.
virtual IValue_factory * get_value_factory()=0
Get the value factory of this instance.
virtual DAG_constant const * create_constant(IValue const *value)=0
Create a constant.
virtual bool enable_opt(bool flag)=0
Enable optimization.
virtual bool enable_unsafe_math_opt(bool flag)=0
Enable unsafe math optimizations.
The node factory for DAG IR nodes.
Definition: mdl_generated_dag.h:415
virtual DAG_node const * create_call(char const *signature, IDefinition::Semantics sema, DAG_call::Call_argument const call_args[], int num_call_args, IType const *ret_type)=0
Create a call.
virtual bool get_unsafe_math_opt() const =0
Return unsafe math optimization setting.
virtual DAG_parameter const * create_parameter(IType const *type, int index)=0
Create a parameter reference.
virtual bool enable_opt(bool flag)=0
Enable optimization.
virtual DAG_temporary const * create_temporary(DAG_node const *node, int index)=0
Create a temporary reference.
virtual IType_factory * get_type_factory()=0
Get the type factory associated with this expression factory.
virtual IValue_factory * get_value_factory()=0
Get the value factory associated with this expression factory.
virtual DAG_constant const * create_constant(IValue const *value)=0
Create a constant.
virtual bool enable_cse(bool flag)=0
Enable common subexpression elimination.
virtual bool enable_unsafe_math_opt(bool flag)=0
Enable unsafe math optimizations.
A container of DAG representations of a module containing materials, functions, constants,...
Definition: mdl_generated_dag.h:393
virtual size_t get_import_count() const =0
Get the number of modules directly imported by the module from which this code was generated.
virtual size_t get_material_count() const =0
Get the number of materials in the generated code.
virtual char const * get_original_type_name(size_t index) const =0
Get the original name of the user defined type at index if the type is an alias.
virtual IType const * get_type(size_t index) const =0
Get the user defined type at index.
virtual DAG_node const * get_material_body(size_t material_index) const =0
Get the body expression of the material at material_index.
virtual char const * get_cloned_function_name(size_t function_index) const =0
Return the original function name of a cloned function or "" if the function is not a clone.
virtual size_t get_annotation_annotation_count(size_t annotation_index) const =0
Get the number of annotations of the annotation at annotation_index.
virtual size_t get_material_parameter_enable_if_condition_users(size_t material_index, size_t parameter_index) const =0
Get the number of parameters whose enable_if condition depends on this parameter.
virtual size_t get_type_annotation_count(size_t index) const =0
Get the number of annotations of the user defined type at index.
virtual char const * get_function_parameter_type_name(size_t function_index, size_t parameter_index) const =0
Get the parameter type name of the parameter at parameter_index of the function at function_index.
virtual DAG_node const * get_function_annotation(size_t function_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the function at function_index.
virtual DAG_node const * get_annotation_annotation(size_t anno_decl_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the annotation (declaration) at anno_decl_index.
virtual DAG_node const * get_struct_category_annotation(size_t cat_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the user defined struct category at cat_index.
virtual char const * get_function_name(size_t function_index) const =0
Get the name of the function at function_index.
virtual char const * get_type_name(size_t index) const =0
Get the name of the user type at index.
virtual bool get_material_property(size_t material_index, Function_property fp) const =0
Get the property flag of the material at material_index.
virtual bool is_type_exported(size_t index) const =0
Returns true if the user defined type at index is exported.
virtual IDefinition::Semantics get_annotation_semantics(size_t annotation_index) const =0
Get the semantics of the annotation at annotation_index.
virtual void set_resource_tag(IValue_resource const *res, int tag)=0
Set a tag, version pair for a resource constant that might be reachable from this DAG.
virtual size_t get_annotation_parameter_index(size_t annotation_index, char const *parameter_name) const =0
Get the index of the parameter parameter_name.
virtual DAG_node const * get_function_body(size_t function_index) const =0
Get the body of the function at function_index.
virtual DAG_node const * get_material_annotation(size_t material_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the material at material_index.
virtual char const * get_material_name(size_t material_index) const =0
Get the name of the material at material_index.
virtual IType const * get_type_sub_entity_type(size_t type_index, size_t entity_index) const =0
Get the type of an user defined type sub-entity (field or enum constant).
virtual size_t get_function_parameter_enable_if_condition_users(size_t function_index, size_t parameter_index) const =0
Get the number of parameters whose enable_if condition depends on this parameter.
Function_property
Properties of DAG functions.
Definition: mdl_generated_dag.h:396
@ FP_IS_NATIVE
True, if this function was declared native.
Definition: mdl_generated_dag.h:404
@ FP_CAN_THROW_BOUNDS
True, if this function can throw a out-of-bounds exception.
Definition: mdl_generated_dag.h:401
@ FP_CAN_THROW_DIVZERO
True, if this function can throw a div-by-zero exception.
Definition: mdl_generated_dag.h:402
@ FP_USES_TEXTURES
True, if this function uses the texture functions (either directly or by calling another function tha...
Definition: mdl_generated_dag.h:399
@ FP_IS_UNIFORM
True, if this function is uniform.
Definition: mdl_generated_dag.h:403
@ FP_ALLOW_INLINE
True, if it is legal to inline this function.
Definition: mdl_generated_dag.h:397
@ FP_IS_DECLARATIVE
True, if this function is declarative.
Definition: mdl_generated_dag.h:405
@ FP_IS_EXPORTED
True, if this function is exported.
Definition: mdl_generated_dag.h:398
virtual char const * get_function_parameter_name(size_t function_index, size_t parameter_index) const =0
Get the parameter name of the parameter at parameter_index of the function at function_index.
virtual DAG_node const * get_function_return_annotation(size_t function_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the function return type at function_index.
virtual char const * get_original_material_name(size_t material_index) const =0
Get the original name of the material at material_index if the material name is an alias.
virtual size_t get_material_annotation_count(size_t material_index) const =0
Get the number of annotations of the material at material_index.
virtual size_t get_function_references_count(size_t function_index) const =0
Get the number of entities referenced by a function.
virtual size_t get_annotation_parameter_count(size_t annotation_index) const =0
Get the parameter count of the annotation at annotation_index.
virtual IType const * get_material_return_type(size_t material_index) const =0
Get the return type of the material at material_index.
virtual char const * get_material_parameter_type_name(size_t material_index, size_t parameter_index) const =0
Get the parameter type name of the parameter at parameter_index of the material at material_index.
virtual char const * get_struct_category_name(size_t index) const =0
Get the name of the user-defined struct category at index.
virtual DAG_node const * get_module_annotation(size_t annotation_index) const =0
Get the annotation at annotation_index of the module.
virtual char const * get_import(size_t index) const =0
Get the name of module at index imported from the module from which this code was generated.
virtual size_t get_struct_category_count() const =0
Get the number of (exported and non-exported) user defined struct categories of this compiled module.
virtual size_t get_resource_tag_map_entries_count() const =0
Get the number of resource tag map entries.
virtual DAG_node const * get_material_parameter_enable_if_condition(size_t material_index, size_t parameter_index) const =0
Get the enable_if condition for the given material parameter if one was specified.
virtual size_t get_material_references_count(size_t material_index) const =0
Get the number of entities referenced by a material.
virtual DAG_node const * get_constant_annotation(size_t constant_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the constant at constant_index.
virtual size_t get_type_sub_entity_count(size_t type_index) const =0
Get the number of user defined type sub-entities (fields or enum constants).
virtual size_t get_function_parameter_count(size_t function_index) const =0
Get the parameter count of the function at function_index.
virtual char const * get_internal_space() const =0
Get the internal space.
virtual size_t get_material_return_annotation_count(size_t material_index) const =0
Get the number of annotations of the material return type at material_index.
virtual size_t get_function_return_annotation_count(size_t function_index) const =0
Get the number of annotations of the function return type at function_index.
virtual size_t get_function_parameter_enable_if_condition_user(size_t function_index, size_t parameter_index, size_t user_index) const =0
Get a parameter index whose enable_if condition depends on this parameter.
virtual IType const * get_material_parameter_type(size_t material_index, size_t parameter_index) const =0
Get the parameter type of the parameter at parameter_index of the material at material_index.
virtual DAG_constant const * get_constant_value(size_t index) const =0
Get the value of the constant at index.
virtual Resource_tag_tuple const * get_resource_tag_map_entry(size_t index) const =0
Get the i'th resource tag map entry or NULL if the index is out of bounds;.
virtual char const * get_material_temporary_name(size_t material_index, size_t temporary_index) const =0
Get the temporary name at temporary_index used by the material at material_index.
virtual size_t get_material_parameter_annotation_count(size_t material_index, size_t parameter_index) const =0
Get the number of annotations of the parameter at parameter_index of the material at material_index.
virtual char const * get_module_name() const =0
Get the absolute module name of the module from which this code was generated.
virtual DAG_node const * get_type_sub_entity_annotation(size_t type_index, size_t entity_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the user defined type sub-entity at (type_index,...
virtual char const * get_module_file_name() const =0
Get the module file name of the module from which this code was generated.
virtual DAG_node const * get_annotation_parameter_default(size_t annotation_index, size_t parameter_index) const =0
Get the default initializer of the parameter at parameter_index of the annotation at annotation_index...
virtual DAG_node const * get_function_temporary(size_t function_index, size_t temporary_index) const =0
Get the temporary at temporary_index used by the function at function_index.
virtual size_t get_material_parameter_enable_if_condition_user(size_t material_index, size_t parameter_index, size_t user_index) const =0
Get a parameter index whose enable_if condition depends on this parameter.
virtual DAG_hash const * get_function_hash(size_t function_index) const =0
Get the function hash value for the given function index if available.
virtual DAG_node const * get_material_temporary(size_t material_index, size_t temporary_index) const =0
Get the temporary at temporary_index used by the material at material_index.
virtual int get_resource_tag(IValue_resource const *res) const =0
Get a tag,for a resource constant that might be reachable from this DAG.
Annotation_property
Properties of DAG annotations.
Definition: mdl_generated_dag.h:409
@ AP_IS_EXPORTED
True, if this annotation is exported.
Definition: mdl_generated_dag.h:410
virtual size_t get_function_parameter_annotation_count(size_t function_index, size_t parameter_index) const =0
Get the number of annotations of the parameter at parameter_index of the function at function_index.
virtual char const * get_annotation_parameter_name(size_t annotation_index, size_t parameter_index) const =0
Get the parameter name of the parameter at parameter_index of the annotation at annotation_index.
virtual bool is_struct_category_exported(size_t index) const =0
Returns true if the user defined struct category at index is exported.
virtual bool get_annotation_property(size_t annotation_index, Annotation_property ap) const =0
Get the property flag of the annotation at annotation_index.
virtual bool get_function_exported(size_t function_index) const =0
Get the export flags of the function at function_index.
virtual DAG_node const * get_function_parameter_default(size_t function_index, size_t parameter_index) const =0
Get the default initializer of the parameter at parameter_index of the function at function_index.
virtual size_t get_constant_count() const =0
Get the number of exported constants.
virtual DAG_node const * get_function_value(size_t function_index) const =0
Get the body of the function at function_index.
virtual IDefinition::Semantics get_function_semantics(size_t function_index) const =0
Get the semantics of the function at function_index.
virtual char const * get_original_annotation_name(size_t annotation_index) const =0
Get the original name of the annotation at annotation_index if the annotation name is an alias,...
virtual size_t get_type_count() const =0
Get the number of (exported and non-exported) user defined types of this compiled module.
virtual size_t get_module_annotation_count() const =0
Get the number of annotations of the module.
virtual DAG_node const * get_type_annotation(size_t type_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the user defined type at type_index.
virtual size_t get_struct_category_annotation_count(size_t index) const =0
Get the number of annotations of the user defined struct category at index.
virtual size_t get_function_parameter_index(size_t function_index, char const *parameter_name) const =0
Get the index of the parameter parameter_name.
virtual char const * get_type_sub_entity_name(size_t type_index, size_t entity_index) const =0
Get the name of an user defined type sub-entity (field or enum constant).
virtual bool get_material_exported(size_t material_index) const =0
Get the export flags of the material at material_index.
virtual char const * get_annotation_name(size_t annotation_index) const =0
Get the name of the annotation at annotation_index.
virtual size_t get_function_count() const =0
Get the number of functions in the generated code.
virtual IStruct_category const * get_struct_category(size_t index) const =0
Get the user defined struct category at index.
virtual char const * get_original_function_name(size_t function_index) const =0
Get the original name of the function at function_index if the function name is an alias,...
virtual char const * get_simple_annotation_name(size_t annotation_index) const =0
Get the simple name of the annotation at annotation_index.
virtual Messages const & access_messages() const =0
Access messages.
virtual IMaterial_instance * create_material_instance(size_t index, Error_code *error_code=NULL) const =0
Create a new material instance.
virtual char const * get_simple_function_name(size_t function_index) const =0
Get the simple name of the function at function_index.
virtual DAG_node const * get_function_parameter_annotation(size_t function_index, size_t parameter_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the parameter at parameter_index of the function at functio...
virtual Messages & access_messages()=0
Access messages (writable).
virtual char const * get_simple_material_name(size_t material_index) const =0
Get the simple name of the material at material_index.
virtual IType const * get_annotation_parameter_type(size_t annotation_index, size_t parameter_index) const =0
Get the parameter type of the parameter at parameter_index of the annotation at annotation_index.
virtual IType const * get_function_return_type(size_t function_index) const =0
Get the return type of the function at function_index.
virtual bool get_function_property(size_t function_index, Function_property fp) const =0
Get the property flag of the function at function_index.
virtual DAG_node const * get_material_parameter_annotation(size_t material_index, size_t parameter_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the parameter at parameter_index of the material at materia...
virtual char const * get_annotation_parameter_type_name(size_t annotation_index, size_t parameter_index) const =0
Get the parameter type name of the parameter at parameter_index of the annotation at annotation_index...
virtual size_t get_material_temporary_count(size_t material_index) const =0
Get the number of temporaries used by the material at material_index.
virtual size_t get_memory_size() const =0
Returns the amount of used memory by this code DAG.
virtual char const * get_material_reference(size_t material_index, size_t callee_index) const =0
Get the signature of the i'th reference of a material.
virtual size_t get_constant_annotation_count(size_t index) const =0
Get the number of annotations of the constant at index.
virtual size_t get_material_parameter_count(size_t material_index) const =0
Get the parameter count of the material at material_index.
virtual DAG_node_factory * get_node_factory()=0
Get the node factory.
virtual size_t get_function_temporary_count(size_t function_index) const =0
Get the number of temporaries used by the function at function_index.
virtual char const * get_function_temporary_name(size_t function_index, size_t temporary_index) const =0
Get the temporary name at temporary_index used by the function at function_index.
virtual DAG_node const * get_material_value(size_t material_index) const =0
Get the value of the material at material_index.
virtual size_t get_annotation_count() const =0
Get the number of annotations in the generated code.
virtual DAG_node const * get_material_parameter_default(size_t material_index, size_t parameter_index) const =0
Get the default initializer of the parameter at parameter_index of the material at material_index.
virtual char const * get_cloned_material_name(size_t material_index) const =0
Return the original material name of a cloned material or "" if the material is not a clone.
virtual DAG_node const * get_material_return_annotation(size_t material_index, size_t annotation_index) const =0
Get the annotation at annotation_index of the material return type at material_index.
virtual size_t get_function_annotation_count(size_t function_index) const =0
Get the number of annotations of the function at function_index.
virtual DAG_node const * get_function_parameter_enable_if_condition(size_t function_index, size_t parameter_index) const =0
Get the enable_if condition for the given function parameter if one was specified.
virtual IResource_tagger * get_resource_tagger() const =0
Get the resource tagger for this code DAG.
virtual char const * get_material_parameter_name(size_t material_index, size_t parameter_index) const =0
Get the parameter name of the parameter at parameter_index of the material at material_index.
virtual char const * get_constant_name(size_t index) const =0
Get the name of the constant at index.
virtual size_t get_material_parameter_index(size_t material_index, char const *parameter_name) const =0
Get the index of the parameter parameter_name.
virtual DAG_hash const * get_material_hash(size_t material_index) const =0
Get the material hash value for the given material index if available.
virtual IDefinition::Semantics get_material_semantics(size_t material_index) const =0
Get the semantics of the material at material_index.
virtual IType const * get_function_parameter_type(size_t function_index, size_t parameter_index) const =0
Get the parameter type of the parameter at parameter_index of the function at function_index.
virtual size_t get_type_sub_entity_annotation_count(size_t type_index, size_t entity_index) const =0
Get the number of annotations of an user defined type sub-entity (field or enum constant) at index.
virtual char const * get_function_reference(size_t function_index, size_t callee_index) const =0
Get the signature of the i'th reference of a function.
An instantiated material.
Definition: mdl_generated_dag.h:1383
virtual DAG_node const * create_call(char const *signature, IDefinition::Semantics sema, DAG_call::Call_argument const call_args[], int num_call_args, IType const *ret_type)=0
Create a call node.
virtual DAG_parameter const * create_parameter(IType const *type, int index)=0
Create a parameter reference node.
Property
Property flags of an instance.
Definition: mdl_generated_dag.h:1445
@ IP_DEPENDS_ON_TRANSFORM
depends on object transforms
Definition: mdl_generated_dag.h:1446
@ IP_DEPENDS_ON_OBJECT_ID
depends of the object id
Definition: mdl_generated_dag.h:1447
@ IP_USES_TERNARY_OPERATOR_ON_DF
uses the ternary operator '?:' on *df
Definition: mdl_generated_dag.h:1450
@ IP_DISTILLED
was created by the distiller
Definition: mdl_generated_dag.h:1452
@ IP_USES_TERNARY_OPERATOR
uses the ternary operator '?:'
Definition: mdl_generated_dag.h:1449
@ IP_CLASS_COMPILED
was class compiled
Definition: mdl_generated_dag.h:1451
@ IP_TARGET_MATERIAL_MODEL
instance is in target material mode
Definition: mdl_generated_dag.h:1454
@ IP_DEPENDS_ON_UNIFORM_SCENE_DATA
depends on uniform scene data
Definition: mdl_generated_dag.h:1453
@ IP_DEPENDS_ON_GLOBAL_DISTRIBUTION
depends on global distribution (edf)
Definition: mdl_generated_dag.h:1448
virtual size_t get_resource_tag_map_entries_count() const =0
Get the number of resource tag map entries.
virtual IType_factory * get_type_factory()=0
Get the type factory of this instance.
virtual DAG_constant const * create_constant(IValue const *value)=0
Create a constant node.
virtual size_t get_temporary_count() const =0
Return the number of temporaries of this instance.
virtual size_t get_memory_size() const =0
Returns the amount of used memory by this code material instance.
virtual DAG_call const * get_constructor() const =0
Return the material constructor of this instance.
virtual bool depends_on_transform() const =0
Returns true if this instance depends on object transforms.
virtual IValue_factory * get_value_factory()=0
Get the value factory of this instance.
virtual IValue const * get_parameter_default(size_t index) const =0
Return the default value of a parameter of this instance.
virtual size_t get_parameter_count() const =0
Return the number of parameters of this instance.
virtual void lookup_sub_expression(char const *path, DAG_node const *&node_result, IValue const *&value_result) const =0
Return the node determined by the path, starting from the root expression of the material instance.
Flags
Instantiation flags.
Definition: mdl_generated_dag.h:1388
@ NO_ENUM_PARAMS
CLASS_COMPILATION: Do not create enum parameters.
Definition: mdl_generated_dag.h:1397
@ NO_DEAD_PARAMS
CLASS_COMPILATION: Remove dead parameters.
Definition: mdl_generated_dag.h:1394
@ NO_BOOL_PARAMS
CLASS_COMPILATION: Do not create bool parameters.
Definition: mdl_generated_dag.h:1396
@ NO_RESOURCE_SHARING
CLASS_COMPILATION: Do not share resource arguments.
Definition: mdl_generated_dag.h:1392
@ IGNORE_NOINLINE
Ignore anno::noinline() annotations.
Definition: mdl_generated_dag.h:1404
@ TARGET_MATERIAL_MODEL
Target material model mode.
Definition: mdl_generated_dag.h:1405
@ NO_STRING_PARAMS
CLASS_COMPILATION: Do not create string parameters.
Definition: mdl_generated_dag.h:1395
@ NO_TRANSPARENT_LAYERS
CLASS_COMPILATION: Do not create layering calls for transparent layers, i.e., with weight 0....
Definition: mdl_generated_dag.h:1403
@ DEFAULT_CLASS_COMPILATION
Do class compilation with default flags.
Definition: mdl_generated_dag.h:1407
@ NO_TERNARY_ON_DF
CLASS_COMPILATION: Do not allow ?: on df.
Definition: mdl_generated_dag.h:1393
@ NO_ARGUMENT_INLINE
CLASS_COMPILATION: Do not inline any arguments.
Definition: mdl_generated_dag.h:1391
@ NO_TRIVIAL_CUTOUT_OPACITY
CLASS_COMPILATION: Do not create a parameter for geometry.cutout_opacity if its value is constant 0....
Definition: mdl_generated_dag.h:1400
@ INSTANCE_COMPILATION
Do an instance compilation, default.
Definition: mdl_generated_dag.h:1389
@ CLASS_COMPILATION
Do a class compilation.
Definition: mdl_generated_dag.h:1390
virtual bool depends_on_uniform_scene_data() const =0
Returns true if this instance depends on uniform scene data.
Opacity
Opacity of an instance.
Definition: mdl_generated_dag.h:1458
@ OPACITY_OPAQUE
opaque for sure
Definition: mdl_generated_dag.h:1459
@ OPACITY_TRANSPARENT
transparent for sure
Definition: mdl_generated_dag.h:1460
@ OPACITY_UNKNOWN
opacity unknown (depends on parameter or complex user expression)
Definition: mdl_generated_dag.h:1461
virtual Messages const & access_messages() const =0
Access messages.
virtual IValue_float const * get_cutout_opacity() const =0
Returns the cutout opacity of this instance if it is constant.
virtual Properties get_properties() const =0
Get the instance properties.
virtual DAG_hash const * get_slot_hash(Slot slot) const =0
Return the hash value of one material slot of this material instance.
virtual Opacity get_opacity() const =0
Returns the opacity of this instance.
virtual Error_code initialize(ICall_name_resolver *resolver, IResource_modifier *resource_modifier, IGenerated_code_dag const *code_dag, size_t argc, DAG_node const *argv[], bool use_temporaries, unsigned flags, ICall_evaluator *evaluator, bool fold_meters_per_scene_unit, float mdl_meters_per_scene_unit, float wavelength_min, float wavelength_max, char const *const fold_params[], size_t num_fold_params, IType const *target_type)=0
Initialize this material instance.
virtual Resource_tag_tuple const * get_resource_tag_map_entry(size_t index) const =0
Get the i'th resource tag map entry or NULL if the index is out of bounds;.
virtual char const * get_internal_space() const =0
Get the internal space.
virtual DAG_node const * get_temporary_value(size_t index) const =0
Return the value of the temporary at index.
virtual DAG_hash const * get_hash() const =0
Return the hash value of this material instance.
virtual char const * get_parameter_name(size_t index) const =0
Return the canonical parameter name of the given parameter.
virtual Opacity get_surface_opacity() const =0
Returns the surface opacity of this instance.
virtual IResource_tagger * get_resource_tagger() const =0
Get the resource tagger for this material instance.
virtual size_t get_referenced_scene_data_count() const =0
Returns the number of scene data attributes referenced by this instance.
virtual bool depends_on_global_distribution() const =0
Returns true if this instance depends on the global distribution (edf).
Slot
Material slots on which hashes are calculated.
Definition: mdl_generated_dag.h:1415
@ MS_VOLUME_SCATTERING_COEFFICIENT
.volume.scattering_coefficient
Definition: mdl_generated_dag.h:1432
@ MS_GEOMETRY_NORMAL
.geometry.normal
Definition: mdl_generated_dag.h:1437
@ MS_THIN_WALLED
.thin_walled
Definition: mdl_generated_dag.h:1416
@ MS_SURFACE_EMISSION_EDF_EMISSION
.surface.emission.emission
Definition: mdl_generated_dag.h:1419
@ MS_SURFACE_BSDF_SCATTERING
.surface.scattering
Definition: mdl_generated_dag.h:1418
@ MS_VOLUME_EMISSION_INTENSITY
.volume.emission_intensity
Definition: mdl_generated_dag.h:1433
@ MS_VOLUME_VDF_SCATTERING
.volume.scattering
Definition: mdl_generated_dag.h:1430
@ MS_GEOMETRY_DISPLACEMENT
.geometry.displacement
Definition: mdl_generated_dag.h:1435
@ MS_IOR
.ior
Definition: mdl_generated_dag.h:1428
@ MS_SURFACE_EMISSION_MODE
.surface.emission.mode
Definition: mdl_generated_dag.h:1421
@ MS_BACKFACE_EMISSION_MODE
.backface.emission.mode
Definition: mdl_generated_dag.h:1426
@ MS_SURFACE_EMISSION_INTENSITY
.surface.emission.intensity
Definition: mdl_generated_dag.h:1420
@ MS_BACKFACE_EMISSION_INTENSITY
.backface.emission.intensity
Definition: mdl_generated_dag.h:1425
@ MS_BACKFACE_BSDF_SCATTERING
.backface.scattering
Definition: mdl_generated_dag.h:1423
@ MS_HAIR
.hair
Definition: mdl_generated_dag.h:1439
@ MS_BACKFACE_EMISSION_EDF_EMISSION
.backface.emission.emission
Definition: mdl_generated_dag.h:1424
@ MS_VOLUME_ABSORPTION_COEFFICIENT
.volume.absorption_coefficient
Definition: mdl_generated_dag.h:1431
@ MS_GEOMETRY_CUTOUT_OPACITY
.geometry.cutout_opacity
Definition: mdl_generated_dag.h:1436
virtual void set_resource_tag(IValue_resource const *res, int tag)=0
Set a tag, version pair for a resource constant that might be reachable from this instance.
virtual DAG_hash get_sub_expression_hash(char const *path) const =0
Calculate the hash for the node determined by the path, starting from the root expression of the mate...
virtual bool depends_on_object_id() const =0
Returns true if this instance depends on the object id.
virtual char const * get_referenced_scene_data_name(size_t index) const =0
Return the name of a scene data attribute referenced by this instance.
An interface to interrogate tag values for resource values.
Definition: mdl_generated_dag.h:260
virtual int get_resource_tag(IValue_resource const *res) const =0
Get a tag,for a resource constant that might be reachable from this DAG.
T * as(DAG_node *type)
Cast to subtype or return NULL if types do not match.
Definition: mdl_generated_dag.h:1725
bool is(DAG_node const *node)
Check if a DAG node is of a certain type.
Definition: mdl_generated_dag.h:1718
Dag_error_code
The possible error codes on DAG.
Definition: mdl_generated_dag.h:374
@ EC_INSTANTIATION_ERROR
An error occurred during instantiation.
Definition: mdl_generated_dag.h:380
@ EC_TOO_FEW_ARGUMENTS
Not enough arguments were supplied for the material.
Definition: mdl_generated_dag.h:378
@ EC_ARGUMENT_TYPE_MISMATCH
An instance argument is of wrong type.
Definition: mdl_generated_dag.h:381
@ EC_INVALID_INDEX
The given index is invalid.
Definition: mdl_generated_dag.h:376
@ EC_WRONG_TRANSMISSION_ON_THIN_WALLED
Different transmission on thin_walled material.
Definition: mdl_generated_dag.h:382
@ EC_TOO_MANY_ARGUMENTS
Too many arguments were supplied for the material.
Definition: mdl_generated_dag.h:379
@ EC_NONE
No error has occurred.
Definition: mdl_generated_dag.h:375
@ EC_MATERIAL_HAS_ERROR
The material cannot be instantiated because it has errors.
Definition: mdl_generated_dag.h:377
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5
A simple value helper class, a pair of an argument expression and a parameter name.
Definition: mdl_generated_dag.h:176
DAG_node const * arg
The call argument expression.
Definition: mdl_generated_dag.h:194
Call_argument()
Default constructor.
Definition: mdl_generated_dag.h:178
Call_argument(DAG_node const *arg, char const *param_name)
Constructor.
Definition: mdl_generated_dag.h:187
char const * param_name
The name of the parameter.
Definition: mdl_generated_dag.h:195