Skip to content

Commit 08830ab

Browse files
committed
MDL SDK 2023.1.3 (373000.2208)
1 parent 41100f4 commit 08830ab

Some content is hidden

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

43 files changed

+336
-212
lines changed

CHANGELOG.md

+36-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
11
Change Log
22
==========
3-
MDL SDK 2023.1.2 (373000.1755): 23 Jan 2024
3+
MDL SDK 2023.1.3 (373000.2208): 14 Feb 2024
44
-----------------------------------------------
55

6+
ABI compatible with the MDL SDK 2023.1.3 (373000.2208) binary release
7+
(see [https://developer.nvidia.com/mdl-sdk](https://developer.nvidia.com/mdl-sdk))
8+
9+
**Added and Changed Features**
10+
11+
- General
12+
- Update to zlib 1.3.1.
13+
14+
- MDL SDK examples
15+
- Example AXF to MDL
16+
- Simplified the code that constructs an instance of the spectral color constructor. This
17+
also demonstrates how to use the `Argument_editor` to set array arguments.
18+
19+
**Fixed Bugs**
20+
21+
- General
22+
- Fixed `IMdl_factory_impl::get_db_definition_name()` for entities from the `::<builtins>`
23+
module.
24+
- Fixed export of MDL modules with uvtile and/or animated textures, where under certain
25+
conditions the first tile/frame was repeated for all tiles/frames of a particular resource
26+
set.
27+
- Fixed a bug that caused DB changes to become visible in concurrent transactions.
28+
- Fixed missing dependencies on `libdl` on Linux that triggered the recently added undefined
29+
symbol check on Ubuntu 20.04.
30+
31+
- MDL Compiler and Backends
32+
- Fixed indeterministic generation of `rmem*` variables for HLSL/GLSL.
33+
- Fixed invalid HLSL/GLSL code generation.
34+
35+
- MDL SDK examples
36+
- Example Distilling Target
37+
- Visual Studio project names for the executable and library use now different names.
38+
39+
MDL SDK 2023.1.2 (373000.1755): 23 Jan 2024
40+
-----------------------------------------------
641

742
ABI compatible with the MDL SDK 2023.1.2 (373000.1755) binary release
843
(see [https://developer.nvidia.com/mdl-sdk](https://developer.nvidia.com/mdl-sdk))

INSTALL.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ dependencies are required:
8686

8787
- **SWIG** *(4.0.2)*
8888
Follow the instructions for downloading or building on
89-
[python.org](http://www.swig.org/download.html).
89+
[swig.org](http://www.swig.org/download.html).
9090

9191
The following third-party dependencies are used by several and/or major
9292
examples. Installation is strongly recommended unless the corresponding group

cmake/dependencies/add_llvm.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ if(NOT __TARGET_ADD_DEPENDENCY_NO_LINKING)
129129
${LINKER_START_GROUP}
130130
${_STATIC_LIB_FILE_LIST}
131131
${LINKER_END_GROUP}
132+
# LLVMSupport uses dlopen()
133+
${CMAKE_DL_LIBS}
132134
)
133135

134136
add_dependencies(${__TARGET_ADD_DEPENDENCY_TARGET} mdl-jit-llvm) # add dependency manually

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-
23&#160;January&#160;2024,&#160;11:22,&#160;rev374755, v1.3
172+
12&#160;February&#160;2024,&#160;20:26,&#160;rev375208, v1.3
173173
</span>
174174
<span class="footeritem">
175175
<a href="https://www.nvidia.com/en-us/about-nvidia/legal-info/">&copy; 2024 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.1.2 (373000.1755): $datetime</span>
5+
<span class="footeritem">MDL SDK 2023.1.3 (373000.2208): $datetime</span>
66
<span class="footeritem">
77
<a href="http://www.nvidia.com/">
88
&copy;&#160;2024&#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.240123.A4.pdf">View documentation in A4 format</a><br>
206-
<a href="mdl_core_definitions.240123.LTR.pdf">View documentation in US Letter format</a><br>
205+
<a href="mdl_core_definitions.240212.A4.pdf">View documentation in A4 format</a><br>
206+
<a href="mdl_core_definitions.240212.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-
23&#160;January&#160;2024,&#160;11:24,&#160;rev374755, v1.4
280+
12&#160;February&#160;2024,&#160;20:27,&#160;rev375208, v1.4
281281
</span>
282282
<span class="footeritem">
283283
<a href="https://www.nvidia.com/en-us/about-nvidia/legal-info/">&copy; 2024 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.1.2 (373000.1755): 23 Jan 2024
64+
MDL SDK 2023.1.3 (373000.2208): 14 Feb 2024
6565
</span>
6666
<span class="footeritem">
6767
<a href="http://www.nvidia.com/">&copy;&#160;2024&#160;NVIDIA&#160;Corporation.</a> &#160;All&#160;rights&#160;reserved.

examples/mdl_sdk/axf_to_mdl/axf_importer_reader.cpp

+25-48
Original file line numberDiff line numberDiff line change
@@ -2487,8 +2487,7 @@ bool set_bsdf_param(
24872487
void set_spectral_param(
24882488
Axf_impexp_state* impexp_state,
24892489
mi::neuraylib::IExpression_list* default_parameters,
2490-
mi::neuraylib::IType_factory* type_factory,
2491-
mi::neuraylib::IValue_factory* val_factory,
2490+
mi::neuraylib::IMdl_factory* mdl_factory,
24922491
mi::neuraylib::IExpression_factory* expr_factory,
24932492
const mi::neuraylib::IFunction_definition* material,
24942493
const char* material_name,
@@ -2508,54 +2507,32 @@ void set_spectral_param(
25082507
return;
25092508
}
25102509

2511-
assert(wavelengths.size() == values.size());
2512-
const size_t num_wavelengths = wavelengths.size();
2513-
25142510
//
25152511
// create a spectral color constructor call
25162512
//
25172513

2518-
mi::base::Handle<const mi::neuraylib::IFunction_definition> function_definition(
2519-
transaction->access<mi::neuraylib::IFunction_definition>(
2520-
"mdl::color(float[N],float[N])"));
2521-
mi::base::Handle<mi::neuraylib::IExpression_list> arguments(
2522-
expr_factory->create_expression_list());
2523-
mi::base::Handle<const mi::neuraylib::IType> elem_type(type_factory->create_float());
2524-
mi::base::Handle<const mi::neuraylib::IType_array> array_type(
2525-
type_factory->create_immediate_sized_array(elem_type.get(), num_wavelengths));
2526-
2527-
// attach wavelengths and values arrays
2528-
for (unsigned int i = 0; i < 2; ++i)
2529-
{
2530-
const char *array_name = function_definition->get_parameter_name(i);
2531-
2532-
const float *f = (i == 0) ? wavelengths.data() : values.data();
2533-
2534-
// create and fill the array
2535-
mi::base::Handle<mi::neuraylib::IValue_array> ar(
2536-
val_factory->create_array(array_type.get()));
2537-
for (mi::Size j = 0; j < num_wavelengths; ++j)
2538-
{
2539-
mi::base::Handle<mi::neuraylib::IValue> val(
2540-
val_factory->create_float(f[j]));
2541-
ar->set_value(j, val.get());
2542-
}
2543-
2544-
mi::base::Handle<mi::neuraylib::IExpression> array_expr(
2545-
expr_factory->create_constant(ar.get()));
2546-
arguments->add_expression(array_name, array_expr.get());
2547-
}
2548-
2549-
mi::Sint32 res;
2550-
mi::base::Handle<mi::neuraylib::IFunction_call> function_call(
2551-
function_definition->create_function_call(arguments.get(), &res));
2552-
const string color_constructor_name =
2553-
get_axf_spectrum_prefix() +
2554-
impexp_state->get_module_prefix() + string("_") +
2555-
material_name + string("_") + param_name;
2556-
transaction->store(function_call.get(), color_constructor_name.c_str());
2557-
2558-
2514+
assert(wavelengths.size() == values.size());
2515+
2516+
mi::neuraylib::Definition_wrapper dw(transaction, "mdl::color(float[N],float[N])", mdl_factory);
2517+
assert(dw.is_valid());
2518+
2519+
mi::Sint32 result = 0;
2520+
mi::base::Handle<mi::neuraylib::IFunction_call> fc(dw.create_instance(nullptr, &result));
2521+
assert(result == 0);
2522+
2523+
string color_constructor_name
2524+
= get_axf_spectrum_prefix()
2525+
+ impexp_state->get_module_prefix() + string("_")
2526+
+ material_name + string("_")
2527+
+ param_name;
2528+
transaction->store(fc.get(), color_constructor_name.c_str());
2529+
2530+
mi::neuraylib::Argument_editor ae(transaction, color_constructor_name.c_str(), mdl_factory, true);
2531+
result = ae.set_value("wavelengths", wavelengths.data(), wavelengths.size());
2532+
assert(result == 0);
2533+
result = ae.set_value("amplitudes", values.data(), values.size());
2534+
assert(result == 0);
2535+
25592536
//
25602537
// attach call to parameter
25612538
//
@@ -2774,13 +2751,13 @@ void Axf_reader::create_variant(
27742751
param_name = "sigma_s";
27752752
set_spectral_param(
27762753
impexp_state,
2777-
default_parameters.get(), type_factory.get(), val_factory.get(),
2754+
default_parameters.get(), mdl_factory.get(),
27782755
expr_factory.get(), m_volumetric_material.get(), material_name.c_str(),
27792756
m_transaction, param_name, m_wavelengths, m_sigma_s);
27802757
param_name = "sigma_a";
27812758
set_spectral_param(
27822759
impexp_state,
2783-
default_parameters.get(), type_factory.get(), val_factory.get(),
2760+
default_parameters.get(), mdl_factory.get(),
27842761
expr_factory.get(), m_volumetric_material.get(), material_name.c_str(),
27852762
m_transaction, param_name, m_wavelengths, m_sigma_a);
27862763
}

examples/mdl_sdk/distilling_target/CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ target_add_dependencies(TARGET ${PLUGIN_PROJECT_NAME}
124124
${LINKER_NO_WHOLE_ARCHIVE}
125125
)
126126

127+
# extend to project names
128+
get_target_property(_PROJECT_LABEL ${PROJECT_NAME} PROJECT_LABEL)
129+
set_target_properties(${PROJECT_NAME} PROPERTIES
130+
PROJECT_LABEL "${_PROJECT_LABEL} (main)" # project name
131+
)
132+
set_target_properties(${PLUGIN_PROJECT_NAME} PROPERTIES
133+
PROJECT_LABEL "${_PROJECT_LABEL} (plugin)" # project name
134+
)
135+
127136
# -------------------------------------------------------------------------------------------------
128137
# Code Generation Step
129138
# -------------------------------------------------------------------------------------------------

include/mi/neuraylib/imdl_factory.h

+8-6
Original file line numberDiff line numberDiff line change
@@ -328,31 +328,33 @@ class IMdl_factory : public
328328
/// For example, given \c "::state", the method returns \c "mdl::state".
329329
///
330330
/// \note This method does not check for existence of the corresponding DB element, nor does it
331-
/// check that the input is a valid module name.
331+
/// necessarily reject an invalid module name.
332332
///
333333
/// \note Usage of this method is strongly recommended instead of manually prepending \c "mdl",
334334
/// since (a) the mapping is more complicated than that, e.g., for MDLE modules, and (b)
335335
/// the mapping might change in the future.
336336
///
337337
/// \param mdl_name The MDL name of the module (non-MDLE and MDLE module), or the file path
338338
/// of an MDLE module.
339-
/// \return The DB name of that module, or \c NULL if \p mdl_name is invalid.
339+
/// \return The DB name of that module, or \c NULL if \p mdl_name was detected as
340+
/// invalid.
340341
virtual const IString* get_db_module_name( const char* mdl_name) = 0;
341342

342343
/// Returns the DB name for the MDL name of an material or function definition.
343344
///
344345
/// For example, given \c "::state::normal()", the method returns \c "mdl::state::normal()".
345346
///
346347
/// \note This method does not check for existence of the corresponding DB element, nor does it
347-
/// check that the input is a valid material or definition name.
348+
/// necessarily reject an invalid material or function definition name.
348349
///
349350
/// \note Usage of this method is strongly recommended instead of manually prepending \c "mdl",
350-
/// since (a) the mapping is more complicated than that, e.g., for MDLE modules, and (b)
351-
/// the mapping might change in the future.
351+
/// since (a) the mapping is more complicated than that, e.g., for definitions from the
352+
/// \c ::&lt;builtins&gt; module or MDLE modules, and (b) the mapping might change in the
353+
/// future.
352354
///
353355
/// \param mdl_name The MDL name of the material or function definition.
354356
/// \return The DB name of that material or function definition, or \c NULL if
355-
/// \p mdl_name is invalid.
357+
/// \p mdl_name was detected as invalid.
356358
virtual const IString* get_db_definition_name( const char* mdl_name) = 0;
357359

358360
/// Analyzes whether an expression graph violates the uniform constraints.

include/mi/neuraylib/ineuray.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/***************************************************************************************************
1+
/**************************************************************************************************
22
* Copyright (c) 2008-2024, NVIDIA CORPORATION. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without
@@ -105,7 +105,7 @@ class INeuray : public
105105
/// - -2: Authentication failure (challenge-response).
106106
/// - -4: Provided license expired.
107107
/// - -5: No professional GPU as required by the license in use was found.
108-
/// - -6: Authentication failure (FLEXlm).
108+
/// (historical - -6: Authentication failure (FLEXlm).)
109109
/// - -7: No NVIDIA VCA as required by the license in use was found.
110110
virtual Sint32 start( bool blocking = true) = 0;
111111

include/mi/neuraylib/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
#endif // MI_NEURAYLIB_VERSION_QUALIFIER_EMPTY
9898

9999
/// \NeurayProductName product version number in a string representation, such as \c "2.0".
100-
#define MI_NEURAYLIB_PRODUCT_VERSION_STRING "2023.1.2"
100+
#define MI_NEURAYLIB_PRODUCT_VERSION_STRING "2023.1.3"
101101

102102
/// Type of plugins for the \NeurayApiName.
103103
/// \see #mi::base::Plugin::get_type().

src/api/api/neuray/neuray_mdl_factory_impl.cpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,18 @@ const mi::IString* Mdl_factory_impl::get_db_definition_name( const char* mdl_nam
269269
if( !mdl_name)
270270
return nullptr;
271271

272+
// Reject invalid names that trigger an assertion in MDL::get_db_name()
273+
bool mdle = MDL::is_mdle( mdl_name);
272274
std::string mdl_name_str = mdl_name;
273-
if( !MDL::starts_with_scope( mdl_name_str))
274-
return nullptr;
275+
if( !mdle && !MDL::starts_with_scope( mdl_name_str)) {
276+
// The name is the builtins module (or an entity from the builtins module). Check this by
277+
// verifying that there is no scope at all (excluding the signature).
278+
size_t left_paren = mdl_name_str.find( '(');
279+
size_t scope = mdl_name_str.find( "::");
280+
if( (scope != std::string::npos)
281+
&& ((left_paren == std::string::npos) || (scope < left_paren)))
282+
return nullptr;
283+
}
275284

276285
std::string result = MDL::get_db_name( mdl_name);
277286
return new String_impl( result.c_str());

src/base/data/dblight/data/test_gc_explicit_call.dump.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ Index 0: tag = 1, count = 2, pin count = 1, removed = 0
1515

1616
Count of all transactions: 1
1717
Count of open transactions: 1
18-
ID 0: pin count = 2, state = OPEN, next sequence number = 2, visibility ID = 4294967295
18+
ID 0: pin count = 3, state = OPEN, next sequence number = 2, visibility ID = 4294967295
1919

2020
Count of infos by distinct names: 1
2121
Index 0: name = "foo", count = 1
22-
Index 0: transaction ID = 0 (cleared), version = 1, pin count = 0, tag = 1, removal = 0, references = { }
22+
Index 0: transaction ID = 0 (set), version = 1, pin count = 0, tag = 1, removal = 0, references = { }
2323

2424
Count of infos by distinct tags: 1
2525
Index 0: tag = 1, count = 1, pin count = 1, removed = 0
26-
Index 0: transaction ID = 0 (cleared), version = 1, pin count = 0, tag = 1, removal = 0, name = "foo", references = { }
26+
Index 0: transaction ID = 0 (set), version = 1, pin count = 0, tag = 1, removal = 0, name = "foo", references = { }
2727

2828

2929
Count of all transactions: 1

src/base/data/dblight/dblight_info.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ bool operator>=( const Info_impl& lhs, const Info_impl& rhs)
206206
return (lhs > rhs) || (lhs == rhs);
207207
}
208208

209+
/// Indicates whether the transaction has been committed.
210+
bool is_committed( const Transaction_impl_ptr& transaction)
211+
{
212+
return transaction && (transaction->get_state() == Transaction_impl::COMMITTED);
213+
}
214+
209215
/// Non-trivial code shared between Infos_per_name and Infos_per_tag.
210216
namespace IMPL {
211217

@@ -284,7 +290,6 @@ Info_impl* lookup_info(
284290
--it;
285291
}
286292

287-
MI_ASSERT( false);
288293
return nullptr;
289294
}
290295

@@ -977,12 +982,6 @@ bool is_aborted( const Transaction_impl_ptr& transaction)
977982
return transaction && (transaction->get_state() == Transaction_impl::ABORTED);
978983
}
979984

980-
/// Indicates whether the creator transaction is visible for the given transaction ID.
981-
bool is_visible_for( const Transaction_impl_ptr& transaction, DB::Transaction_id id)
982-
{
983-
return !transaction || (transaction->is_visible_for( id));
984-
}
985-
986985
/// Indicates whether two transactions definitely have the same visibility.
987986
///
988987
/// Assumes that both transactions are from the same scope, and that globally visible transactions
@@ -1042,7 +1041,8 @@ void Info_manager::cleanup_tag_general( DB::Tag tag, DB::Transaction_id lowest_o
10421041

10431042
// Clear creator transaction for infos that are globally visible. This is required to
10441043
// eventually release the transaction, but does not count as GC progress w.r.t. the infos.
1045-
bool globally_visible = is_visible_for( transaction, lowest_open);
1044+
bool globally_visible = !transaction
1045+
|| (is_committed( transaction) && transaction->is_visible_for( lowest_open));
10461046
if( transaction) {
10471047
if( globally_visible) {
10481048
current->clear_transaction();

src/base/hal/link/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ create_from_base_preset(
5050
target_add_dependencies(TARGET ${PROJECT_NAME}
5151
DEPENDS
5252
boost
53+
system
5354
)

src/base/lib/zlib/ChangeLog

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11

22
ChangeLog file for zlib
33

4+
Changes in 1.3.1 (22 Jan 2024)
5+
- Reject overflows of zip header fields in minizip
6+
- Fix bug in inflateSync() for data held in bit buffer
7+
- Add LIT_MEM define to use more memory for a small deflate speedup
8+
- Fix decision on the emission of Zip64 end records in minizip
9+
- Add bounds checking to ERR_MSG() macro, used by zError()
10+
- Neutralize zip file traversal attacks in miniunz
11+
- Fix a bug in ZLIB_DEBUG compiles in check_match()
12+
- Various portability and appearance improvements
13+
414
Changes in 1.3 (18 Aug 2023)
515
- Remove K&R function definitions and zlib2ansi
616
- Fix bug in deflateBound() for level 0 and memLevel 9

0 commit comments

Comments
 (0)