Skip to content

Commit b4c3c5b

Browse files
MDL SDK 2023.0.6 (367100.5773)
1 parent 0bcb415 commit b4c3c5b

File tree

97 files changed

+4219
-1323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+4219
-1323
lines changed

CHANGELOG.md

+49-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,57 @@
11
Change Log
22
==========
3-
MDL SDK 2023.0.4 (367100.4957): 05 Oct 2023
3+
MDL SDK 2023.0.6 (367100.5773): 03 Nov 2023
44
-----------------------------------------------
55

66

7+
ABI compatible with the MDL SDK 2023.0.6 (367100.5773) binary release
8+
(see [https://developer.nvidia.com/mdl-sdk](https://developer.nvidia.com/mdl-sdk))
9+
10+
**Added and Changed Features**
11+
12+
- General
13+
- Various performance improvements, in particular with a focus on creation of
14+
compiled materials.
15+
- Python Bindings:
16+
- Added `get` and `set` value functions to the bindings of types in `mi::data` and
17+
added corresponding tests.
18+
- Removed the `IAttribute_set` interface from the bindings of the `IScene_element` types.
19+
20+
- MDL Compiler and Backends
21+
- Optimized high-level (GLSL/HLSL) code generator to reduce code size.
22+
- Added new backend option "`hlsl_remap_functions`": This allows to remap MDL functions
23+
(including state functions) to user implemented Native HLSL implementations.
24+
25+
- MDL Distiller and Baker
26+
- Renamed `mdl_distiller` command line tool to `mdl_distiller_cli` to more
27+
clearly separate it from the distiller plugin of the same name.
28+
29+
**Fixed Bugs**
30+
31+
- General
32+
- Fixed `IFactory::compare()` for `IString` and `IRef` on Linux on ARM.
33+
- Python Bindings:
34+
- Fixed the binding for the `ITile::get_pixel()` and
35+
`ITile::set_pixel()` functions.
36+
- Mapped `mi::Size` to `signed integer` in python to allow for
37+
comparing against `-1`.
38+
- Deprecated the tuple return of functions that have an `float*` out parameter in C++.
39+
Now an `ReturnCode` object is passed in and out as Python parameter.
40+
- Removed unused classes and functions from the bindings.
41+
42+
- MDL Distiller and Baker
43+
- mdltlc: Fixed matching on nested attribute expressions.
44+
- Fixed missing `enum` to `int` conversion operator an auto-imports,
45+
which caused compilation errors in rare cases.
46+
- Fixed context information when compiling entities in the DAG-backend
47+
(fixes only some asserts in debug mode).
48+
- Fixed HLSL/GLSL code generation for access to single element compound types,
49+
like arrays of length `1` or structs with only one field.
50+
51+
52+
MDL SDK 2023.0.4 (367100.4957): 05 Oct 2023
53+
-----------------------------------------------
54+
755
ABI compatible with the MDL SDK 2023.0.4 (367100.4957) binary release
856
(see [https://developer.nvidia.com/mdl-sdk](https://developer.nvidia.com/mdl-sdk))
957

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ add_subdirectory(${MDL_SRC_FOLDER}/prod/bin/i18n)
178178
add_subdirectory(${MDL_SRC_FOLDER}/prod/bin/mdlc)
179179
add_subdirectory(${MDL_SRC_FOLDER}/prod/bin/mdlm)
180180
add_subdirectory(${MDL_SRC_FOLDER}/prod/bin/mdltlc)
181-
add_subdirectory(${MDL_SRC_FOLDER}/prod/bin/mdl_distiller)
181+
add_subdirectory(${MDL_SRC_FOLDER}/prod/bin/mdl_distiller_cli)
182182

183183
# PLUGINS
184184
#--------------------------------------------------------------------------------------------------

cmake/utilities.cmake

+13-2
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ endfunction()
641641
function(CREATE_FROM_BASE_PRESET)
642642
# the options DYNAMIC_MSVC_RUNTIME and STATIC_MSVC_RUNTIME override the
643643
# general option MDL_MSVC_DYNAMIC_RUNTIME_EXAMPLES
644-
set(options WIN32 WINDOWS_UNICODE EXAMPLE DYNAMIC_MSVC_RUNTIME STATIC_MSVC_RUNTIME)
644+
set(options WIN32 WINDOWS_UNICODE EXAMPLE DYNAMIC_MSVC_RUNTIME STATIC_MSVC_RUNTIME SKIP_UNDEFINED_SYMBOL_CHECK)
645645
set(oneValueArgs TARGET VERSION TYPE NAMESPACE EXPORT_NAME OUTPUT_NAME VS_PROJECT_NAME EMBED_RC)
646646
set(multiValueArgs SOURCES ADDITIONAL_INCLUDE_DIRS)
647647
cmake_parse_arguments(CREATE_FROM_BASE_PRESET "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
@@ -686,7 +686,7 @@ function(CREATE_FROM_BASE_PRESET)
686686

687687
# default namespace is mdl
688688
if(NOT CREATE_FROM_BASE_PRESET_NAMESPACE)
689-
set( CREATE_FROM_BASE_PRESET_NAMESPACE mdl)
689+
set(CREATE_FROM_BASE_PRESET_NAMESPACE mdl)
690690
endif()
691691

692692
# add empty pch
@@ -780,6 +780,17 @@ function(CREATE_FROM_BASE_PRESET)
780780
# compiler flags and defines
781781
target_build_setup(TARGET ${CREATE_FROM_BASE_PRESET_TARGET} ${BUILD_SETUP_OPTIONS})
782782

783+
# undefined symbol check
784+
if(NOT CREATE_FROM_BASE_PRESET_SKIP_UNDEFINED_SYMBOL_CHECK)
785+
if(LINUX AND NOT (${CREATE_FROM_BASE_PRESET_TYPE} STREQUAL "STATIC"))
786+
add_custom_command(
787+
TARGET ${CREATE_FROM_BASE_PRESET_TARGET}
788+
POST_BUILD
789+
COMMAND ! ldd -r $<TARGET_FILE:${CREATE_FROM_BASE_PRESET_TARGET}> | grep "undefined symbol:"
790+
)
791+
endif()
792+
endif()
793+
783794
# configure visual studio and maybe other IDEs
784795
setup_ide(TARGET ${CREATE_FROM_BASE_PRESET_TARGET}
785796
SOURCES ${CREATE_FROM_BASE_PRESET_SOURCES}

doc/base_module/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ <h3>Edge</h3>
169169

170170
</div><div id="blackfooter">
171171
<span class="footeritem">
172-
26&#160;September&#160;2023,&#160;20:08,&#160;r367100.4957, v1.3
172+
1&#160;November&#160;2023,&#160;20:10,&#160;r367100.5773, v1.3
173173
</span>
174174
<span class="footeritem">
175175
<a href="https://www.nvidia.com/en-us/about-nvidia/legal-info/">&copy; 2023 NVIDIA&nbsp;Corporation.</a> All rights reserved.

doc/build/doxygen_footer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!-- start footer part -->
33
<!--BEGIN GENERATE_TREEVIEW-->
44
<div id="nav-path">
5-
<span class="footeritem">MDL SDK 2023.0.4 (367100.4957): $datetime</span>
5+
<span class="footeritem">MDL SDK 2023.0.6 (367100.5773): $datetime</span>
66
<span class="footeritem">
77
<a href="http://www.nvidia.com/">
88
&copy;&#160;2023&#160;NVIDIA&#160;Corporation.</a>

doc/core_definitions/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ <h2>Page cannot be loaded</h2>
202202
bottom of the page or from the following links:</p>
203203

204204
<div style="padding-left:2em;">
205-
<a href="mdl_core_definitions.230926.A4.pdf">View documentation in A4 format</a><br>
206-
<a href="mdl_core_definitions.230926.LTR.pdf">View documentation in US Letter format</a><br>
205+
<a href="mdl_core_definitions.231101.A4.pdf">View documentation in A4 format</a><br>
206+
<a href="mdl_core_definitions.231101.LTR.pdf">View documentation in US Letter format</a><br>
207207
</div>
208208
<h3>Overriding security settings</h3>
209209

@@ -277,7 +277,7 @@ <h3>Edge</h3>
277277
<span class="footeritem">
278278
</span>
279279
<span class="footeritem">
280-
26&#160;September&#160;2023,&#160;20:09,&#160;r367100.4957, v1.4
280+
1&#160;November&#160;2023,&#160;20:11,&#160;r367100.5773, v1.4
281281
</span>
282282
<span class="footeritem">
283283
<a href="https://www.nvidia.com/en-us/about-nvidia/legal-info/">&copy; 2023 NVIDIA&nbsp;Corporation.</a> All rights reserved.

doc/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
</div>
6262
<div id="blackfooter">
6363
<span class="footeritem">
64-
MDL SDK 2023.0.4 (367100.4957): 05 Oct 2023
64+
MDL SDK 2023.0.6 (367100.5773): 03 Nov 2023
6565
</span>
6666
<span class="footeritem">
6767
<a href="http://www.nvidia.com/">&copy;&#160;2023&#160;NVIDIA&#160;Corporation.</a> &#160;All&#160;rights&#160;reserved.

examples/mdl_python/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,39 @@ elseif ("MDL_SOURCE_RELEASE" IN_LIST MDL_ADDITIONAL_COMPILER_DEFINES)
6767
set(ENV_MDLDISTILLER_PATH_BAT ${MDLDISTILLER_PATH})
6868
# for running the shell scripts on windows (e.g. using git bash or mingw)
6969
# we need to adjust the strings that go into the PATH to use a unix-like format
70-
if(${MDL_SDK_PATH})
70+
if(MDL_SDK_PATH)
7171
string(SUBSTRING ${MDL_SDK_PATH} 1 1 _CHAR_AT_1)
7272
if(_CHAR_AT_1 STREQUAL ":")
7373
string(SUBSTRING ${MDL_SDK_PATH} 0 1 _CHAR_AT_0)
7474
string(SUBSTRING ${MDL_SDK_PATH} 2 -1 ENV_MDL_SDK_PATH)
7575
set(ENV_MDL_SDK_PATH "/${_CHAR_AT_0}${ENV_MDL_SDK_PATH}")
7676
endif()
7777
endif()
78-
if(${FREEIMAGE_PATH})
78+
if(FREEIMAGE_PATH)
7979
string(SUBSTRING ${FREEIMAGE_PATH} 1 1 _CHAR_AT_1)
8080
if(_CHAR_AT_1 STREQUAL ":")
8181
string(SUBSTRING ${FREEIMAGE_PATH} 0 1 _CHAR_AT_0)
8282
string(SUBSTRING ${FREEIMAGE_PATH} 2 -1 ENV_FREEIMAGE_PATH)
8383
set(ENV_FREEIMAGE_PATH "/${_CHAR_AT_0}${ENV_FREEIMAGE_PATH}")
8484
endif()
8585
endif()
86-
if(${OPENIMAGEIO_PATH})
86+
if(OPENIMAGEIO_PATH)
8787
string(SUBSTRING ${OPENIMAGEIO_PATH} 1 1 _CHAR_AT_1)
8888
if(_CHAR_AT_1 STREQUAL ":")
8989
string(SUBSTRING ${OPENIMAGEIO_PATH} 0 1 _CHAR_AT_0)
9090
string(SUBSTRING ${OPENIMAGEIO_PATH} 2 -1 ENV_OPENIMAGEIO_PATH)
9191
set(ENV_OPENIMAGEIO_PATH "/${_CHAR_AT_0}${ENV_OPENIMAGEIO_PATH}")
9292
endif()
9393
endif()
94-
if(${DDS_PATH})
94+
if(DDS_PATH)
9595
string(SUBSTRING ${DDS_PATH} 1 1 _CHAR_AT_1)
9696
if(_CHAR_AT_1 STREQUAL ":")
9797
string(SUBSTRING ${DDS_PATH} 0 1 _CHAR_AT_0)
9898
string(SUBSTRING ${DDS_PATH} 2 -1 ENV_DDS_PATH)
9999
set(ENV_DDS_PATH "/${_CHAR_AT_0}${ENV_DDS_PATH}")
100100
endif()
101101
endif()
102-
if(${MDLDISTILLER_PATH})
102+
if(MDLDISTILLER_PATH)
103103
string(SUBSTRING ${MDLDISTILLER_PATH} 1 1 _CHAR_AT_1)
104104
if(_CHAR_AT_1 STREQUAL ":")
105105
string(SUBSTRING ${MDLDISTILLER_PATH} 0 1 _CHAR_AT_0)

examples/mdl_python/tests/__init__.py

+30-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
import unittest
22
import os
33

4-
# run all tests
5-
if __name__ == '__main__':
4+
report_coverage: bool = True
5+
6+
if report_coverage:
7+
try:
8+
import coverage
9+
except Exception:
10+
print("Unittest Coverage can not be recorded. The 'coverage' python module needs to be installed.")
11+
report_coverage = False
12+
13+
14+
def run():
615
loader = unittest.TestLoader()
7-
suite = loader.discover(os.path.dirname(os.path.abspath(__file__)))
16+
suite = loader.discover(os.path.dirname(os.path.abspath(__file__)), pattern="test_*.py")
817
runner = unittest.TextTestRunner()
918
runner.run(suite)
19+
print("Done: Running Tests")
20+
21+
22+
# run all tests
23+
# independent of the cmake option we generate a report here in case the coverage module is installed
24+
if __name__ == '__main__':
25+
if report_coverage:
26+
folder: str = 'coverage_report'
27+
cov = coverage.Coverage(data_file=folder + '/.coverage')
28+
cov.exclude('.*No constructor defined - class is abstract.*')
29+
cov.start()
30+
run()
31+
cov.stop()
32+
cov.save()
33+
cov.html_report(directory=folder)
34+
print("Done: Creating Coverage Report")
35+
else:
36+
run()

examples/mdl_python/tests/setup.py

+12-45
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
import pymdlsdk
1+
import unittest
22
import os
33

4+
# local testing only
5+
import pymdlsdk
6+
BindingModuleName: str = 'pymdlsdk'
7+
BindingModule = pymdlsdk
8+
9+
# the unittest base class, in case testing system already needs a specializing
10+
UnittestFrameworkBase = unittest.TestCase
11+
12+
413
class SDK():
514
neuray: pymdlsdk.INeuray = None
615
transaction: pymdlsdk.ITransaction = None
716
mdlFactory: pymdlsdk.IMdl_factory = None
817

9-
1018
def _get_examples_search_path(self):
1119
"""Try to get the example search path or returns 'mdl' sub folder of the current directory if it failed."""
1220

@@ -28,7 +36,6 @@ def _get_examples_search_path(self):
2836

2937
return os.path.abspath(example_sp)
3038

31-
3239
def load(self, addExampleSearchPath: bool = True, loadImagePlugins: bool = True, loadDistillerPlugin: bool = False):
3340
"""Initialize the SDK and get some common interface for basic testing"""
3441

@@ -61,6 +68,7 @@ def load(self, addExampleSearchPath: bool = True, loadImagePlugins: bool = True,
6168
raise Exception('Failed to load the \'mdl_distiller\' plugin.')
6269

6370
# start neuray
71+
print(f"Starting neuray of version: {self.neuray.get_version()}")
6472
resultCode = self.neuray.start()
6573
if resultCode != 0:
6674
raise Exception('Failed to initialize the SDK. Result code: ' + resultCode)
@@ -79,51 +87,10 @@ def unload(self, commitTransaction: bool = True):
7987
self.transaction.commit()
8088
self.transaction = None
8189
self.mdlFactory = None
90+
self.neuray.shutdown()
8291
self.neuray = None
8392
pymdlsdk._print_open_handle_statistic()
8493

8594
# Unload the MDL SDK
8695
if not pymdlsdk.unload():
8796
raise Exception('Failed to unload the SDK.')
88-
89-
def log_context_messages(self, context: pymdlsdk.IMdl_execution_context) -> bool:
90-
"""print all messages from the context. Return false if there have been errors"""
91-
if context.get_messages_count() == 0:
92-
return True
93-
hasErrors: bool = context.get_error_messages_count() > 0
94-
for i in range(context.get_messages_count()):
95-
message: pymdlsdk.IMessage = context.get_message(i)
96-
level: str = " "
97-
if message.get_severity() == 0: # pymdlsdk.MESSAGE_SEVERITY_FATAL
98-
level = "fatal: "
99-
hasErrors = True
100-
elif message.get_severity() == 1: # pymdlsdk.MESSAGE_SEVERITY_ERROR
101-
level = "error: "
102-
hasErrors = True
103-
elif message.get_severity() == 2: # pymdlsdk.MESSAGE_SEVERITY_WARNING
104-
level = "warning: "
105-
elif message.get_severity() == 3: # pymdlsdk.MESSAGE_SEVERITY_INFO
106-
level = "info: "
107-
elif message.get_severity() == 4: # pymdlsdk.MESSAGE_SEVERITY_VERBOSE
108-
level = "verbose: "
109-
elif message.get_severity() == 5: # pymdlsdk.MESSAGE_SEVERITY_DEBUG
110-
level = "debug: "
111-
print(f"{level} {message.get_string()}")
112-
return not hasErrors
113-
114-
115-
def load_module(self, qualifiedModuleName: str):
116-
"""Load the module given its name.
117-
Returns the database name if loaded successfully otherwise empty string"""
118-
119-
impExp: pymdlsdk.IMdl_impexp_api
120-
context: pymdlsdk.IMdl_execution_context
121-
with self.neuray.get_api_component(pymdlsdk.IMdl_impexp_api) as impExp, \
122-
self.mdlFactory.create_execution_context() as context:
123-
res = impExp.load_module(self.transaction, qualifiedModuleName, context)
124-
if not self.log_context_messages(context) or res < 0:
125-
return ""
126-
dbName: pymdlsdk.IString = self.mdlFactory.get_db_module_name(qualifiedModuleName)
127-
if dbName.is_valid_interface():
128-
return dbName.get_c_str()
129-
return ""

0 commit comments

Comments
 (0)