MDL SDK API nvidia_logo_transpbg.gif Up
mdl_generated_dag.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright 2025 NVIDIA Corporation. All rights reserved.
3 *****************************************************************************/
6#ifndef MDL_GENERATED_DAG_H
7#define MDL_GENERATED_DAG_H 1
8
9#include <cstring>
10#include <mi/mdl/mdl_iowned.h>
11#include <mi/mdl/mdl_generated_code.h>
12#include <mi/mdl/mdl_values.h>
13
14namespace mi {
15namespace mdl {
16
17class DAG_unit;
18class ICall_name_resolver;
19class IResource_modifier;
20class IValue;
21class IValue_float;
22class IValue_resource;
23class IValue_factory;
24class Messages;
25class IType_factory;
26
31class DAG_hash {
32public:
35 memset(hash, 0, sizeof(hash));
36 }
37
41 explicit DAG_hash(unsigned char const (&arr)[16])
42 {
43 memcpy(hash, arr, sizeof(hash));
44 }
45
49 bool operator==(DAG_hash const &other) const {
50 return memcmp(hash, other.hash, sizeof(hash)) == 0;
51 }
52
56 bool operator!=(DAG_hash const &other) const {
57 return memcmp(hash, other.hash, sizeof(hash)) != 0;
58 }
59
63 bool operator<(DAG_hash const &other) const {
64 return memcmp(hash, other.hash, sizeof(hash)) < 0;
65 }
66
70 bool operator<=(DAG_hash const &other) const {
71 return memcmp(hash, other.hash, sizeof(hash)) <= 0;
72 }
73
77 bool operator>(DAG_hash const &other) const {
78 return memcmp(hash, other.hash, sizeof(hash)) > 0;
79 }
80
84 bool operator>=(DAG_hash const &other) const {
85 return memcmp(hash, other.hash, sizeof(hash)) >= 0;
86 }
87
91 unsigned char operator[](size_t n) const {
92 if (n < 16)
93 return hash[n];
94 return 0;
95 }
96
100 unsigned char *data() {
101 return hash;
102 }
103
107 unsigned char const *data() const {
108 return hash;
109 }
110
112 static size_t size() { return 16; }
113
114private:
115 unsigned char hash[16];
116};
117
120public:
123 : line(0)
124 , file_column(0)
125 {
126 }
127
134 unsigned file_id,
135 unsigned line,
136 unsigned column)
137 : line(line)
138 , file_column((file_id << 20u) | (column & 0x000FFFFFu))
139 {
140 }
141
143 operator bool() const { return file_column != 0u && line != 0u; }
144
147 return file_column == other.file_column && line == other.line;
148 }
149
151 bool operator!=(DAG_DbgInfo other) { return !operator==(other); }
152
156 unsigned get_file_id() const { return (file_column >> 20u) & 0x00000FFFu; }
157
159 unsigned get_line() const { return line; }
160
162 unsigned get_column() const { return (file_column & 0x000FFFFFu); }
163
165 static const DAG_DbgInfo generated;
166
168 static const DAG_DbgInfo builtin;
169
170private:
172 unsigned line;
174 unsigned file_column;
175};
176
178class DAG_node : public Interface_owned {
179public:
181 enum Kind {
186 };
187
189 virtual Kind get_kind() const = 0;
190
192 virtual IType const *get_type() const = 0;
193
198 virtual size_t get_id() const = 0;
199
201 virtual DAG_DbgInfo get_dbg_info() const = 0;
202};
203
207class DAG_constant : public DAG_node {
208public:
210 static Kind const s_kind = EK_CONSTANT;
211
213 virtual IValue const *get_value() const = 0;
214};
215
220class DAG_temporary : public DAG_node {
221public:
223 static Kind const s_kind = EK_TEMPORARY;
224
226 virtual int get_index() const = 0;
227
229 virtual DAG_node const *get_expr() const = 0;
230};
231
236class DAG_call : public DAG_node {
237public:
242 arg = NULL;
243 param_name = NULL;
244 }
245
251 DAG_node const *arg,
252 char const *param_name)
253 : arg(arg)
255 {}
256
257 DAG_node const *arg;
258 char const *param_name;
259 };
260
261public:
263 static Kind const s_kind = EK_CALL;
264
268 virtual char const *get_name() const = 0;
269
273 virtual int get_argument_count() const = 0;
274
279 virtual char const *get_parameter_name(int index) const = 0;
280
285 virtual DAG_node const *get_argument(int index) const = 0;
286
292 virtual DAG_node const *get_argument(char const *name) const = 0;
293
295 virtual IDefinition::Semantics get_semantic() const = 0;
296
301 virtual void set_argument(
302 int index,
303 DAG_node const *arg) = 0;
304
306 virtual size_t get_name_hash() const = 0;
307};
308
313class DAG_parameter : public DAG_node {
314public:
316 static Kind const s_kind = EK_PARAMETER;
317
319 virtual int get_index() const = 0;
320};
321
323class IResource_tagger : public Interface_owned {
324public:
328 virtual int get_resource_tag(
329 IValue_resource const *res) const = 0;
330};
331
340class IDag_builder : public
342 <0x01dbe5fb,0xa13d,0x42eb,0xbe,0x3e,0x0a,0x1d,0x2c,0x53,0x11,0xdf,
343 mi::base::IInterface>
344{
345public:
347 virtual IType_factory *get_type_factory() = 0;
348
350 virtual IValue_factory *get_value_factory() = 0;
351
358 IValue const *value) = 0;
359
370 virtual DAG_node const *create_call(
371 char const *signature,
372 IDefinition::Semantics sema,
373 DAG_call::Call_argument const call_args[],
374 int num_call_args,
375 IType const *ret_type,
376 DAG_DbgInfo dbg_info) = 0;
377
386 IType const *type,
387 int index,
388 DAG_DbgInfo dbg_info) = 0;
389
394 virtual bool enable_cse(bool flag) = 0;
395
400 virtual bool enable_opt(bool flag) = 0;
401
406 virtual bool enable_unsafe_math_opt(bool flag) = 0;
407};
408
418public:
424 IDefinition::Semantics sema) const = 0;
425
434 virtual IValue const *evaluate_intrinsic_function(
435 IValue_factory *value_factory,
436 IDefinition::Semantics sema,
437 IValue const * const arguments[],
438 size_t n_arguments) const = 0;
439};
440
441// forward
443
454};
455
462 mi::base::Interface_declare<0x9dbfd12e,0x8207,0x4a47,0x8c,0x1f,0x5f,0x9a,0xc4,0x9b,0x00,0xf6,
463 IGenerated_code>
464{
465public:
470 FP_USES_TEXTURES = 2,
477 };
478
482 };
483
486 {
487 public:
494 IValue const *value) = 0;
495
503 DAG_node const *node,
504 int index) = 0;
505
516 virtual DAG_node const *create_call(
517 char const *signature,
518 IDefinition::Semantics sema,
519 DAG_call::Call_argument const call_args[],
520 size_t num_call_args,
521 IType const *ret_type,
522 DAG_DbgInfo dbg_info) = 0;
523
532 IType const *type,
533 int index,
534 DAG_DbgInfo dbg_info) = 0;
535
540 virtual bool enable_cse(bool flag) = 0;
541
546 virtual bool enable_opt(bool flag) = 0;
547
552 virtual bool enable_unsafe_math_opt(bool flag) = 0;
553
557 virtual bool get_unsafe_math_opt() const = 0;
558
562 virtual IType_factory *get_type_factory() = 0;
563
567 virtual IValue_factory *get_value_factory() = 0;
568 };
569
570 static char const MESSAGE_CLASS = 'C';
571
573
574 // -------------------------- methods --------------------------
575
576public:
578 virtual char const *get_module_name() const = 0;
579
581 virtual char const *get_module_file_name() const = 0;
582
585 virtual size_t get_import_count() const = 0;
586
591 virtual char const *get_import(size_t index) const = 0;
592
596 virtual size_t get_function_count() const = 0;
597
602 virtual IType const *get_function_return_type(size_t function_index) const = 0;
603
608 virtual IDefinition::Semantics get_function_semantics(size_t function_index) const = 0;
609
614 virtual char const *get_function_name(size_t function_index) const = 0;
615
620 virtual char const *get_simple_function_name(size_t function_index) const = 0;
621
627 virtual char const *get_original_function_name(size_t function_index) const = 0;
628
633 virtual size_t get_function_parameter_count(size_t function_index) const = 0;
634
641 virtual IType const *get_function_parameter_type(
642 size_t function_index,
643 size_t parameter_index) const = 0;
644
651 size_t function_index,
652 size_t parameter_index) const = 0;
653
660 virtual char const *get_function_parameter_name(
661 size_t function_index,
662 size_t parameter_index) const = 0;
663
670 size_t function_index,
671 char const *parameter_name) const = 0;
672
679 size_t function_index,
680 size_t parameter_index) const = 0;
681
688 size_t function_index,
689 size_t parameter_index) const = 0;
690
698 size_t function_index,
699 size_t parameter_index,
700 size_t user_index) const = 0;
701
708 size_t function_index) const = 0;
709
713 virtual size_t get_material_count() const = 0;
714
718 virtual IType const *get_material_return_type(size_t material_index) const = 0;
719
723 virtual IDefinition::Semantics get_material_semantics(size_t material_index) const = 0;
724
729 virtual char const *get_material_name(size_t material_index) const = 0;
730
735 virtual char const *get_simple_material_name(size_t material_index) const = 0;
736
741 virtual char const *get_original_material_name(size_t material_index) const = 0;
742
747 virtual size_t get_material_parameter_count(size_t material_index) const = 0;
748
755 virtual IType const *get_material_parameter_type(
756 size_t material_index,
757 size_t parameter_index) const = 0;
758
766 size_t material_index,
767 size_t parameter_index) const = 0;
768
775 virtual char const *get_material_parameter_name(
776 size_t material_index,
777 size_t parameter_index) const = 0;
778
785 size_t material_index,
786 char const *parameter_name) const = 0;
787
794 size_t material_index,
795 size_t parameter_index) const = 0;
796
803 size_t material_index,
804 size_t parameter_index) const = 0;
805
813 size_t material_index,
814 size_t parameter_index,
815 size_t user_index) const = 0;
816
823 size_t material_index) const = 0;
824
827
833 size_t function_index) const = 0;
834
841 size_t function_index,
842 size_t annotation_index) const = 0;
843
849 size_t function_index) const = 0;
850
857 size_t function_index,
858 size_t annotation_index) const = 0;
859
867 size_t function_index,
868 size_t parameter_index) const = 0;
869
877 size_t function_index,
878 size_t parameter_index) const = 0;
879
888 size_t function_index,
889 size_t parameter_index,
890 size_t annotation_index) const = 0;
891
897 size_t function_index) const = 0;
898
905 size_t function_index,
906 size_t temporary_index) const = 0;
907
913 virtual char const *get_function_temporary_name(
914 size_t function_index,
915 size_t temporary_index) const = 0;
916
922 size_t function_index) const = 0;
923
930 size_t function_index) const = 0;
931
936 virtual bool get_function_exported(size_t function_index) const = 0;
937
944 size_t function_index,
945 Function_property fp) const = 0;
946
951 virtual size_t get_function_references_count(size_t function_index) const = 0;
952
958 virtual char const *get_function_reference(
959 size_t function_index,
960 size_t callee_index) const = 0;
961
967 virtual char const *get_cloned_function_name(
968 size_t function_index) const = 0;
969
975 size_t material_index) const = 0;
976
983 size_t material_index,
984 size_t annotation_index) const = 0;
985
993 size_t material_index,
994 size_t parameter_index) const = 0;
995
1001 size_t material_index) const = 0;
1002
1009 size_t material_index,
1010 size_t annotation_index) const = 0;
1011
1019 size_t material_index,
1020 size_t parameter_index) const = 0;
1021
1030 size_t material_index,
1031 size_t parameter_index,
1032 size_t annotation_index) const = 0;
1033
1039 size_t material_index) const = 0;
1040
1047 size_t material_index,
1048 size_t temporary_index) const = 0;
1049
1055 virtual char const *get_material_temporary_name(
1056 size_t material_index,
1057 size_t temporary_index) const = 0;
1058
1064 size_t material_index) const = 0;
1065
1071 size_t material_index) const = 0;
1072
1077 virtual bool get_material_exported(size_t material_index) const = 0;
1078
1084 size_t material_index,
1085 Function_property fp) const = 0;
1086
1091 virtual size_t get_material_references_count(size_t material_index) const = 0;
1092
1098 virtual char const *get_material_reference(
1099 size_t material_index,
1100 size_t callee_index) const = 0;
1101
1107 virtual char const *get_cloned_material_name(
1108 size_t material_index) const = 0;
1109
1117 size_t index,
1118 Error_code *error_code = NULL) const = 0;
1119
1122 virtual size_t get_struct_category_count() const = 0;
1123
1128 virtual char const *get_struct_category_name(
1129 size_t index) const = 0;
1130
1135 virtual IStruct_category const *get_struct_category(
1136 size_t index) const = 0;
1137
1143 size_t index) const = 0;
1144
1152 size_t cat_index,
1153 size_t annotation_index) const = 0;
1154
1160 size_t index) const = 0;
1161
1163 virtual size_t get_type_count() const = 0;
1164
1169 virtual char const *get_type_name(
1170 size_t index) const = 0;
1171
1176 virtual char const *get_original_type_name(
1177 size_t index) const = 0;
1178
1183 virtual IType const *get_type(
1184 size_t index) const = 0;
1185
1190 virtual bool is_type_exported(
1191 size_t index) const = 0;
1192
1198 size_t index) const = 0;
1199
1206 size_t type_index,
1207 size_t annotation_index) const = 0;
1208
1214 size_t type_index) const = 0;
1215
1221 virtual char const *get_type_sub_entity_name(
1222 size_t type_index,
1223 size_t entity_index) const = 0;
1224
1230 virtual IType const *get_type_sub_entity_type(
1231 size_t type_index,
1232 size_t entity_index) const = 0;
1233
1241 size_t type_index,
1242 size_t entity_index) const = 0;
1243
1252 size_t type_index,
1253 size_t entity_index,
1254 size_t annotation_index) const = 0;
1255
1257 virtual size_t get_constant_count() const = 0;
1258
1263 virtual char const *get_constant_name(
1264 size_t index) const = 0;
1265
1271 size_t index) const = 0;
1272
1277 size_t index) const = 0;
1278
1285 size_t constant_index,
1286 size_t annotation_index) const = 0;
1287
1289 virtual Messages const &access_messages() const = 0;
1290
1292 virtual Messages &access_messages() = 0;
1293
1295 virtual size_t get_memory_size() const = 0;
1296
1300 virtual size_t get_module_annotation_count() const = 0;
1301
1307 size_t annotation_index) const = 0;
1308
1310 virtual char const *get_internal_space() const = 0;
1311
1315 virtual size_t get_annotation_count() const = 0;
1316
1321 virtual IDefinition::Semantics get_annotation_semantics(
1322 size_t annotation_index) const = 0;
1323
1328 virtual char const *get_annotation_name(
1329 size_t annotation_index) const = 0;
1330
1335 virtual char const *get_simple_annotation_name(
1336 size_t annotation_index) const = 0;
1337
1343 virtual char const *get_original_annotation_name(
1344 size_t annotation_index) const = 0;
1345
1351 size_t annotation_index) const = 0;
1352
1359 virtual IType const *get_annotation_parameter_type(
1360 size_t annotation_index,
1361 size_t parameter_index) const = 0;
1362
1369 size_t annotation_index,
1370 size_t parameter_index) const = 0;
1371
1379 size_t annotation_index,
1380 size_t parameter_index) const = 0;
1381
1388 size_t annotation_index,
1389 char const *parameter_name) const = 0;
1390
1398 size_t annotation_index,
1399 size_t parameter_index) const = 0;
1400
1407 size_t annotation_index,
1408 Annotation_property ap) const = 0;
1409
1415 size_t annotation_index) const = 0;
1416
1423 size_t anno_decl_index,
1424 size_t annotation_index) const = 0;
1425
1429 virtual int get_resource_tag(
1430 IValue_resource const *res) const = 0;
1431
1436 virtual void set_resource_tag(
1437 IValue_resource const *res,
1438 int tag) = 0;
1439
1441 virtual size_t get_resource_tag_map_entries_count() const = 0;
1442
1446 virtual Resource_tag_tuple const *get_resource_tag_map_entry(size_t index) const = 0;
1447
1450};
1451
1452
1465 <0x29c36255,0x7558,0x4865,0xa7,0x7e,0xaa,0x3a,0x50,0x4f,0x70,0xbc,
1466 IDag_builder>
1467{
1468public:
1469 typedef Dag_error_code Error_code;
1470
1472 enum Flags {
1490
1497
1499 enum Slot {
1501
1506
1511
1513
1518
1522
1524
1525 MS_LAST = MS_HAIR
1526 };
1527
1539 };
1540
1542 enum Opacity {
1548
1549 typedef unsigned Properties;
1550
1551public:
1552 // ----------------- from IDAG_builder -----------------
1553
1557 virtual IType_factory *get_type_factory() = 0;
1558
1562 virtual IValue_factory *get_value_factory() = 0;
1563
1571 IValue const *value) = 0;
1572
1585 virtual DAG_node const *create_call(
1586 char const *signature,
1587 IDefinition::Semantics sema,
1588 DAG_call::Call_argument const call_args[],
1589 int num_call_args,
1590 IType const *ret_type,
1591 DAG_DbgInfo dbg_info) = 0;
1592
1601 IType const *type,
1602 int index,
1603 DAG_DbgInfo dbg_info) = 0;
1604
1605 // ----------------- own methods -----------------
1606
1608 virtual DAG_unit &get_dag_unit() = 0;
1609
1611 virtual DAG_unit const &get_dag_unit() const = 0;
1612
1647 ICall_name_resolver *resolver,
1648 IResource_modifier *resource_modifier,
1649 IGenerated_code_dag const *code_dag,
1650 size_t argc,
1651 DAG_node const *argv[],
1652 bool use_temporaries,
1653 unsigned flags,
1654 ICall_evaluator *evaluator,
1655 bool fold_meters_per_scene_unit,
1656 float mdl_meters_per_scene_unit,
1657 float wavelength_min,
1658 float wavelength_max,
1659 char const * const fold_params[],
1660 size_t num_fold_params,
1661 IType const *target_type) = 0;
1662
1667 virtual DAG_call const *get_constructor() const = 0;
1668
1670 virtual size_t get_temporary_count() const = 0;
1671
1675 virtual DAG_node const *get_temporary_value(size_t index) const = 0;
1676
1680 virtual size_t get_parameter_count() const = 0;
1681
1685 virtual IValue const *get_parameter_default(size_t index) const = 0;
1686
1700 char const *path,
1701 DAG_node const *&node_result,
1702 IValue const *&value_result) const = 0;
1703
1714 virtual DAG_hash get_sub_expression_hash(char const *path) const = 0;
1715
1722 virtual DAG_hash const *get_hash() const = 0;
1723
1732 virtual DAG_hash const *get_slot_hash(Slot slot) const = 0;
1733
1737 virtual char const *get_parameter_name(size_t index) const = 0;
1738
1743 virtual bool depends_on_transform() const = 0;
1744
1749 virtual bool depends_on_object_id() const = 0;
1750
1755 virtual bool depends_on_global_distribution() const = 0;
1756
1758 virtual bool depends_on_uniform_scene_data() const = 0;
1759
1761 virtual size_t get_referenced_scene_data_count() const = 0;
1762
1766 virtual char const *get_referenced_scene_data_name(size_t index) const = 0;
1767
1769 virtual Opacity get_opacity() const = 0;
1770
1772 virtual Opacity get_surface_opacity() const = 0;
1773
1778 virtual IValue_float const *get_cutout_opacity() const = 0;
1779
1781 virtual Messages const &access_messages() const = 0;
1782
1784 virtual size_t get_memory_size() const = 0;
1785
1787 virtual Properties get_properties() const = 0;
1788
1790 virtual char const *get_internal_space() const = 0;
1791
1797 virtual void set_resource_tag(
1798 IValue_resource const *res,
1799 int tag) = 0;
1800
1802 virtual size_t get_resource_tag_map_entries_count() const = 0;
1803
1807 virtual Resource_tag_tuple const *get_resource_tag_map_entry(size_t index) const = 0;
1808
1811};
1812
1814template<typename T>
1815bool is(DAG_node const *node)
1816{
1817 return node->get_kind() == T::s_kind;
1818}
1819
1821template<typename T>
1822T *as(DAG_node *type) {
1823 return (type->get_kind() == T::s_kind) ? static_cast<T *>(type) : NULL;
1824}
1825
1827template<typename T>
1828T const *as(DAG_node const *type) {
1829 return (type->get_kind() == T::s_kind) ? static_cast<const T *>(type) : NULL;
1830}
1831
1894} // mdl
1895} // mi
1896
1897#endif
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
The debug info type for DAG nodes.
Definition: mdl_generated_dag.h:119
unsigned get_file_id() const
Get the file id.
Definition: mdl_generated_dag.h:156
unsigned get_column() const
Get the column.
Definition: mdl_generated_dag.h:162
unsigned get_line() const
Get the line.
Definition: mdl_generated_dag.h:159
bool operator!=(DAG_DbgInfo other)
Check if two debug info entries are not equal.
Definition: mdl_generated_dag.h:151
static const DAG_DbgInfo builtin
The "builtin" debug info.
Definition: mdl_generated_dag.h:168
static const DAG_DbgInfo generated
The "generated" debug info.
Definition: mdl_generated_dag.h:165
bool operator==(DAG_DbgInfo other)
Check if two debug info entries are equal.
Definition: mdl_generated_dag.h:146
DAG_DbgInfo()
Default Constructor of the invalid debug info.
Definition: mdl_generated_dag.h:122
DAG_DbgInfo(unsigned file_id, unsigned line, unsigned column)
Constructor.
Definition: mdl_generated_dag.h:133
A DAG IR call.
Definition: mdl_generated_dag.h:236
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:263
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:207
static Kind const s_kind
The kind of this subclass.
Definition: mdl_generated_dag.h:210
virtual IValue const * get_value() const =0
Get the value of the constant.
A hash value.
Definition: mdl_generated_dag.h:31
unsigned char operator[](size_t n) const
Read hash bytes.
Definition: mdl_generated_dag.h:91
unsigned char * data()
Access raw data.
Definition: mdl_generated_dag.h:100
DAG_hash()
Default constructor.
Definition: mdl_generated_dag.h:34
bool operator<=(DAG_hash const &other) const
Compare two hashes for less-than or equal.
Definition: mdl_generated_dag.h:70
bool operator<(DAG_hash const &other) const
Compare two hashes for less-than.
Definition: mdl_generated_dag.h:63
bool operator>=(DAG_hash const &other) const
Compare two hashes for greater-than or equal.
Definition: mdl_generated_dag.h:84
bool operator==(DAG_hash const &other) const
Compare two hashes for equality.
Definition: mdl_generated_dag.h:49
DAG_hash(unsigned char const (&arr)[16])
Constructor from an array of 16 bytes.
Definition: mdl_generated_dag.h:41
bool operator!=(DAG_hash const &other) const
Compare two hashes for non-equality.
Definition: mdl_generated_dag.h:56
bool operator>(DAG_hash const &other) const
Compare two hashes for greater-than.
Definition: mdl_generated_dag.h:77
static size_t size()
Get the size of the raw data.
Definition: mdl_generated_dag.h:112
unsigned char const * data() const
Read-only access raw data.
Definition: mdl_generated_dag.h:107
A node inside the DAG Intermediate Representation.
Definition: mdl_generated_dag.h:178
virtual Kind get_kind() const =0
Get the kind of this DAG IR node.
virtual DAG_DbgInfo get_dbg_info() const =0
Get the Debug info for this node.
Kind
The possible kinds of DAG IR nodes.
Definition: mdl_generated_dag.h:181
@ EK_TEMPORARY
A temporary.
Definition: mdl_generated_dag.h:183
@ EK_PARAMETER
A parameter.
Definition: mdl_generated_dag.h:185
@ EK_CONSTANT
A constant.
Definition: mdl_generated_dag.h:182
@ EK_CALL
A call.
Definition: mdl_generated_dag.h:184
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:313
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:316
A DAG IR temporary reference.
Definition: mdl_generated_dag.h:220
static Kind const s_kind
The kind of this subclass.
Definition: mdl_generated_dag.h:223
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:417
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:344
virtual DAG_parameter const * create_parameter(IType const *type, int index, DAG_DbgInfo dbg_info)=0
Create a parameter reference.
virtual IType_factory * get_type_factory()=0
Get the type factory of this instance.
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, DAG_DbgInfo dbg_info)=0
Create a call.
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:486
virtual bool get_unsafe_math_opt() const =0
Return unsafe math optimization setting.
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 DAG_parameter const * create_parameter(IType const *type, int index, DAG_DbgInfo dbg_info)=0
Create a parameter reference.
virtual DAG_node const * create_call(char const *signature, IDefinition::Semantics sema, DAG_call::Call_argument const call_args[], size_t num_call_args, IType const *ret_type, DAG_DbgInfo dbg_info)=0
Create a call.
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:464
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:467
@ FP_IS_NATIVE
True, if this function was declared native.
Definition: mdl_generated_dag.h:475
@ FP_CAN_THROW_BOUNDS
True, if this function can throw a out-of-bounds exception.
Definition: mdl_generated_dag.h:472
@ FP_CAN_THROW_DIVZERO
True, if this function can throw a div-by-zero exception.
Definition: mdl_generated_dag.h:473
@ FP_USES_TEXTURES
True, if this function uses the texture functions (either directly or by calling another function tha...
Definition: mdl_generated_dag.h:470
@ FP_IS_UNIFORM
True, if this function is uniform.
Definition: mdl_generated_dag.h:474
@ FP_ALLOW_INLINE
True, if it is legal to inline this function.
Definition: mdl_generated_dag.h:468
@ FP_IS_DECLARATIVE
True, if this function is declarative.
Definition: mdl_generated_dag.h:476
@ FP_IS_EXPORTED
True, if this function is exported.
Definition: mdl_generated_dag.h:469
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:480
@ AP_IS_EXPORTED
True, if this annotation is exported.
Definition: mdl_generated_dag.h:481
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:1467
Property
Property flags of an instance.
Definition: mdl_generated_dag.h:1529
@ IP_DEPENDS_ON_TRANSFORM
depends on object transforms
Definition: mdl_generated_dag.h:1530
@ IP_DEPENDS_ON_OBJECT_ID
depends of the object id
Definition: mdl_generated_dag.h:1531
@ IP_USES_TERNARY_OPERATOR_ON_DF
uses the ternary operator '?:' on *df
Definition: mdl_generated_dag.h:1534
@ IP_DISTILLED
was created by the distiller
Definition: mdl_generated_dag.h:1536
@ IP_USES_TERNARY_OPERATOR
uses the ternary operator '?:'
Definition: mdl_generated_dag.h:1533
@ IP_CLASS_COMPILED
was class compiled
Definition: mdl_generated_dag.h:1535
@ IP_TARGET_MATERIAL_MODEL
instance is in target material mode
Definition: mdl_generated_dag.h:1538
@ IP_DEPENDS_ON_UNIFORM_SCENE_DATA
depends on uniform scene data
Definition: mdl_generated_dag.h:1537
@ IP_DEPENDS_ON_GLOBAL_DISTRIBUTION
depends on global distribution (edf)
Definition: mdl_generated_dag.h:1532
virtual size_t get_resource_tag_map_entries_count() const =0
Get the number of resource tag map entries.
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, DAG_DbgInfo dbg_info)=0
Create a call node.
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:1472
@ NO_ENUM_PARAMS
CLASS_COMPILATION: Do not create enum parameters.
Definition: mdl_generated_dag.h:1481
@ NO_DEAD_PARAMS
CLASS_COMPILATION: Remove dead parameters.
Definition: mdl_generated_dag.h:1478
@ NO_BOOL_PARAMS
CLASS_COMPILATION: Do not create bool parameters.
Definition: mdl_generated_dag.h:1480
@ NO_RESOURCE_SHARING
CLASS_COMPILATION: Do not share resource arguments.
Definition: mdl_generated_dag.h:1476
@ IGNORE_NOINLINE
Ignore anno::noinline() annotations.
Definition: mdl_generated_dag.h:1488
@ TARGET_MATERIAL_MODEL
Target material model mode.
Definition: mdl_generated_dag.h:1489
@ NO_STRING_PARAMS
CLASS_COMPILATION: Do not create string parameters.
Definition: mdl_generated_dag.h:1479
@ NO_TRANSPARENT_LAYERS
CLASS_COMPILATION: Do not create layering calls for transparent layers, i.e., with weight 0....
Definition: mdl_generated_dag.h:1487
@ DEFAULT_CLASS_COMPILATION
Do class compilation with default flags.
Definition: mdl_generated_dag.h:1491
@ NO_TERNARY_ON_DF
CLASS_COMPILATION: Do not allow ?: on df.
Definition: mdl_generated_dag.h:1477
@ NO_ARGUMENT_INLINE
CLASS_COMPILATION: Do not inline any arguments.
Definition: mdl_generated_dag.h:1475
@ 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:1484
@ INSTANCE_COMPILATION
Do an instance compilation, default.
Definition: mdl_generated_dag.h:1473
@ CLASS_COMPILATION
Do a class compilation.
Definition: mdl_generated_dag.h:1474
virtual DAG_unit const & get_dag_unit() const =0
Get the DAG_unit of this instance.
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:1542
@ OPACITY_OPAQUE
opaque for sure
Definition: mdl_generated_dag.h:1543
@ OPACITY_TRANSPARENT
transparent for sure
Definition: mdl_generated_dag.h:1544
@ OPACITY_UNKNOWN
opacity unknown (depends on parameter or complex user expression)
Definition: mdl_generated_dag.h:1545
virtual DAG_parameter const * create_parameter(IType const *type, int index, DAG_DbgInfo dbg_info)=0
Create a parameter reference node.
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 DAG_unit & get_dag_unit()=0
Get the DAG_unit of 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:1499
@ MS_VOLUME_SCATTERING_COEFFICIENT
.volume.scattering_coefficient
Definition: mdl_generated_dag.h:1516
@ MS_GEOMETRY_NORMAL
.geometry.normal
Definition: mdl_generated_dag.h:1521
@ MS_THIN_WALLED
.thin_walled
Definition: mdl_generated_dag.h:1500
@ MS_SURFACE_EMISSION_EDF_EMISSION
.surface.emission.emission
Definition: mdl_generated_dag.h:1503
@ MS_SURFACE_BSDF_SCATTERING
.surface.scattering
Definition: mdl_generated_dag.h:1502
@ MS_VOLUME_EMISSION_INTENSITY
.volume.emission_intensity
Definition: mdl_generated_dag.h:1517
@ MS_VOLUME_VDF_SCATTERING
.volume.scattering
Definition: mdl_generated_dag.h:1514
@ MS_GEOMETRY_DISPLACEMENT
.geometry.displacement
Definition: mdl_generated_dag.h:1519
@ MS_IOR
.ior
Definition: mdl_generated_dag.h:1512
@ MS_SURFACE_EMISSION_MODE
.surface.emission.mode
Definition: mdl_generated_dag.h:1505
@ MS_BACKFACE_EMISSION_MODE
.backface.emission.mode
Definition: mdl_generated_dag.h:1510
@ MS_SURFACE_EMISSION_INTENSITY
.surface.emission.intensity
Definition: mdl_generated_dag.h:1504
@ MS_BACKFACE_EMISSION_INTENSITY
.backface.emission.intensity
Definition: mdl_generated_dag.h:1509
@ MS_BACKFACE_BSDF_SCATTERING
.backface.scattering
Definition: mdl_generated_dag.h:1507
@ MS_HAIR
.hair
Definition: mdl_generated_dag.h:1523
@ MS_BACKFACE_EMISSION_EDF_EMISSION
.backface.emission.emission
Definition: mdl_generated_dag.h:1508
@ MS_VOLUME_ABSORPTION_COEFFICIENT
.volume.absorption_coefficient
Definition: mdl_generated_dag.h:1515
@ MS_GEOMETRY_CUTOUT_OPACITY
.geometry.cutout_opacity
Definition: mdl_generated_dag.h:1520
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:323
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:1822
bool is(DAG_node const *node)
Check if a DAG node is of a certain type.
Definition: mdl_generated_dag.h:1815
Dag_error_code
The possible error codes on DAG.
Definition: mdl_generated_dag.h:445
@ EC_INSTANTIATION_ERROR
An error occurred during instantiation.
Definition: mdl_generated_dag.h:451
@ EC_TOO_FEW_ARGUMENTS
Not enough arguments were supplied for the material.
Definition: mdl_generated_dag.h:449
@ EC_ARGUMENT_TYPE_MISMATCH
An instance argument is of wrong type.
Definition: mdl_generated_dag.h:452
@ EC_INVALID_INDEX
The given index is invalid.
Definition: mdl_generated_dag.h:447
@ EC_WRONG_TRANSMISSION_ON_THIN_WALLED
Different transmission on thin_walled material.
Definition: mdl_generated_dag.h:453
@ EC_TOO_MANY_ARGUMENTS
Too many arguments were supplied for the material.
Definition: mdl_generated_dag.h:450
@ EC_NONE
No error has occurred.
Definition: mdl_generated_dag.h:446
@ EC_MATERIAL_HAS_ERROR
The material cannot be instantiated because it has errors.
Definition: mdl_generated_dag.h:448
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:239
DAG_node const * arg
The call argument expression.
Definition: mdl_generated_dag.h:257
Call_argument()
Default constructor.
Definition: mdl_generated_dag.h:241
Call_argument(DAG_node const *arg, char const *param_name)
Constructor.
Definition: mdl_generated_dag.h:250
char const * param_name
The name of the parameter.
Definition: mdl_generated_dag.h:258