diff options
Diffstat (limited to 'source/slang/options.cpp')
| -rw-r--r-- | source/slang/options.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/slang/options.cpp b/source/slang/options.cpp index 5929adabb..dbddc0bdd 100644 --- a/source/slang/options.cpp +++ b/source/slang/options.cpp @@ -247,6 +247,8 @@ struct OptionsParser // + SlangMatrixLayoutMode defaultMatrixLayoutMode = SLANG_MATRIX_LAYOUT_MODE_UNKNOWN; + char const* const* argCursor = &argv[0]; char const* const* argEnd = &argv[argc]; while (argCursor != argEnd) @@ -488,6 +490,14 @@ struct OptionsParser addOutputPath(outputPath); } + else if(argStr == "-matrix-layout-row-major") + { + defaultMatrixLayoutMode = kMatrixLayoutMode_RowMajor; + } + else if(argStr == "-matrix-layout-column-major") + { + defaultMatrixLayoutMode = kMatrixLayoutMode_ColumnMajor; + } else if (argStr == "--") { // The `--` option causes us to stop trying to parse options, @@ -745,6 +755,15 @@ struct OptionsParser spSetTargetFlags(compileRequest, 0, targetFlags); } + if(defaultMatrixLayoutMode != SLANG_MATRIX_LAYOUT_MODE_UNKNOWN) + { + UInt targetCount = requestImpl->targets.Count(); + for(UInt tt = 0; tt < targetCount; ++tt) + { + spSetTargetMatrixLayoutMode(compileRequest, int(tt), defaultMatrixLayoutMode); + } + } + // Next, we want to make sure that entry points get attached to the appropriate translation // unit that will provide them. { |
