Skip to content

Commit 949dc0c

Browse files
committed
Incremented version to 1.4.0.
Updated glslang and SPIRV-Cross. Fixes for command-line argouments and running the validations.
1 parent 88d93c9 commit 949dc0c

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ if (MSL_OUTPUT_DIR)
5757
endif()
5858

5959
set(MSL_MAJOR_VERSION 1)
60-
set(MSL_MINOR_VERSION 3)
60+
set(MSL_MINOR_VERSION 4)
6161
set(MSL_PATCH_VERSION 0)
6262
set(MSL_VERSION ${MSL_MAJOR_VERSION}.${MSL_MINOR_VERSION}.${MSL_PATCH_VERSION})
6363

Compile/src/Compiler.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,16 @@ void Compiler::process(SpirV& spirv, int processOptions)
348348

349349
if (processOptions & Optimize)
350350
{
351+
// NOTE: We have some known invalid code, such as missing bindings. Therefore we need to
352+
// skip validation.
353+
spv_optimizer_options options = spvOptimizerOptionsCreate();
354+
spvOptimizerOptionsSetRunValidator(options, false);
351355
spvtools::Optimizer optimizer(SPV_ENV_VULKAN_1_0);
352356
optimizer.RegisterPerformancePasses();
353357
SpirV optimizedSpirV;
354-
if (optimizer.Run(spirv.data(), spirv.size()*sizeof(std::uint32_t), &optimizedSpirV))
358+
if (optimizer.Run(spirv.data(), spirv.size(), &optimizedSpirV, options))
355359
spirv = std::move(optimizedSpirV);
360+
spvOptimizerOptionsDestroy(options);
356361
}
357362
}
358363

tools/mslc/mslc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,9 @@ int main(int argc, char** argv)
474474
("warn-none,w", "disable all warnings")
475475
("warn-error,W", "treat warnings as errors")
476476
("strip,s", "strip debug symbols")
477-
("optimize,O", value<unsigned int>()->default_value(2), "optimize the compiled result. "
478-
"An integer value (1, 2) determines the optimization level. If not provided, the "
479-
"maximum level will be used.");
477+
("optimize,O", value<unsigned int>(), "optimize the compiled result. An integer value "
478+
"(1, 2) determines the optimization level. If not provided, the maximum level will be "
479+
"used.");
480480

481481
options_description configOptions("options in target configuration file");
482482
configOptions.add_options()

0 commit comments

Comments
 (0)