MDL SDK API nvidia_logo_transpbg.gif Up
imdl_compiler.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2022 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IMDL_COMPILER_H
8#define MI_NEURAYLIB_IMDL_COMPILER_H
9
13
14namespace mi {
15
16namespace base { class ILogger; }
17
18class IString;
19
20namespace neuraylib {
21
22class IBsdf_isotropic_data;
23class ICanvas;
24class ILightprofile;
25class IMdl_backend;
26class IMdl_execution_context;
27class ITransaction;
28
34class IMdl_compiler : public
35 mi::base::Interface_declare<0x8fff0a2d,0x7df7,0x4552,0x92,0xf7,0x36,0x1d,0x31,0xc6,0x30,0x08>
36{
37public:
38
39 virtual void MI_NEURAYLIB_DEPRECATED_METHOD_11_1(set_logger)( base::ILogger* logger) = 0;
40
41 virtual base::ILogger* MI_NEURAYLIB_DEPRECATED_METHOD_11_1(get_logger)() = 0;
42
43 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(add_module_path)( const char* path) = 0;
44
45 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(remove_module_path)( const char* path) = 0;
46
47
48 virtual void MI_NEURAYLIB_DEPRECATED_METHOD_11_1(clear_module_paths)() = 0;
49
50 virtual Size MI_NEURAYLIB_DEPRECATED_METHOD_11_1(get_module_paths_length)() const = 0;
51
52 virtual const IString* MI_NEURAYLIB_DEPRECATED_METHOD_11_1(get_module_path)( Size index) const = 0;
53
54
55 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(add_resource_path)( const char* path) = 0;
56
57 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(remove_resource_path)( const char* path) = 0;
58
59 virtual void MI_NEURAYLIB_DEPRECATED_METHOD_11_1(clear_resource_paths)() = 0;
60
61 virtual Size MI_NEURAYLIB_DEPRECATED_METHOD_11_1(get_resource_paths_length)() const = 0;
62
63 virtual const IString* MI_NEURAYLIB_DEPRECATED_METHOD_11_1(get_resource_path)( Size index) const = 0;
64
65 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(load_plugin_library)( const char* path) = 0;
66
67 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(load_module)(
68 ITransaction* transaction, const char* module_name, IMdl_execution_context* context = 0) = 0;
69
70 virtual const char* MI_NEURAYLIB_DEPRECATED_METHOD_11_1(get_module_db_name)(
71 ITransaction* transaction, const char* module_name, IMdl_execution_context* context = 0) = 0;
72
73 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(load_module_from_string)(
74 ITransaction* transaction,
75 const char* module_name,
76 const char* module_source,
77 IMdl_execution_context* context = 0) = 0;
78
94 virtual Sint32 add_builtin_module( const char* module_name, const char* module_source) = 0;
95
96 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(export_module)(
97 ITransaction* transaction,
98 const char* module_name,
99 const char* filename,
100 IMdl_execution_context* context = 0) = 0;
101
102 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(export_module_to_string)(
103 ITransaction* transaction,
104 const char* module_name,
105 IString* exported_module,
106 IMdl_execution_context* context = 0) = 0;
107
108 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(export_canvas)(
109 const char* filename, const ICanvas* canvas, Uint32 quality = 100) const = 0;
110
111 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(export_lightprofile)(
112 const char* filename, const ILightprofile* lightprofile) const = 0;
113
114 virtual Sint32 MI_NEURAYLIB_DEPRECATED_METHOD_11_1(export_bsdf_data)(
115 const char* filename,
116 const IBsdf_isotropic_data* reflection,
117 const IBsdf_isotropic_data* transmission) const = 0;
118
119 virtual const IString* MI_NEURAYLIB_DEPRECATED_METHOD_11_1(uvtile_marker_to_string)(
120 const char* marker,
121 Sint32 u,
122 Sint32 v) const = 0;
123
124 virtual const IString* MI_NEURAYLIB_DEPRECATED_METHOD_11_1(uvtile_string_to_marker)(
125 const char* str, const char* marker) const = 0;
126
127 enum Mdl_backend_kind {
128 MB_CUDA_PTX,
129 MB_LLVM_IR,
130 MB_GLSL,
131 MB_NATIVE,
132 MB_HLSL,
133 MB_FORCE_32_BIT = 0xffffffffU // Undocumented, for alignment only
134 };
135
136 virtual IMdl_backend* MI_NEURAYLIB_DEPRECATED_METHOD_11_1(get_backend)( Mdl_backend_kind kind) = 0;
137
138 virtual const Float32* MI_NEURAYLIB_DEPRECATED_METHOD_11_1(get_df_data_texture)(
139 Df_data_kind kind,
140 Size &rx,
141 Size &ry,
142 Size &rz) const = 0;
143};
144
145mi_static_assert( sizeof( IMdl_compiler::Mdl_backend_kind)== sizeof( Uint32));
146 // end group mi_neuray_mdl_compiler
148
149} // namespace neuraylib
150
151} // namespace mi
152
153#endif // MI_NEURAYLIB_IMDL_COMPILER_H
A simple string class.
Definition: istring.h:22
The ILogger interface class supports logging of messages.
Definition: ilogger.h:194
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Abstract interface for isotropic BSDF data.
Definition: ibsdf_isotropic_data.h:44
Abstract interface for a canvas represented by a rectangular array of tiles.
Definition: icanvas.h:85
This interface represents light profiles.
Definition: ilightprofile.h:73
MDL backends allow to transform compiled material instances or function calls into target code.
Definition: imdl_backend.h:37
The MDL compiler allows to register builtin modules.
Definition: imdl_compiler.h:36
virtual Sint32 add_builtin_module(const char *module_name, const char *module_source)=0
Adds a builtin MDL module.
The execution context can be used to query status information like error and warning messages concern...
Definition: imdl_execution_context.h:126
A transaction provides a consistent view on the database.
Definition: itransaction.h:84
#define mi_static_assert(expr)
Compile time assertion that raises a compilation error if the constant expression expr evaluates to f...
Definition: assert.h:65
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:47
Uint64 Size
Unsigned integral type that is large enough to hold the size of all types.
Definition: types.h:110
float Float32
32-bit float.
Definition: types.h:49
signed int Sint32
32-bit signed integer.
Definition: types.h:44
Df_data_kind
Possible kinds of distribution function data.
Definition: imdl_backend_api.h:37
Interfaces related to MDL compiler backends.
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5
Major and minor version number and an optional qualifier.