diff options
| author | Yong He <yonghe@outlook.com> | 2023-05-02 20:29:38 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-02 20:29:38 -0700 |
| commit | d52376a65f37fcbbb67428b917fd3819436b6dfb (patch) | |
| tree | da25b3c9a00bd003b1970b4a6c4eb38eccf62aa1 /source/slang/slang-options.cpp | |
| parent | 55291b0bf6d729fcbaf75a01926da7da8975b8e9 (diff) | |
Various dxc/fxc compatibility fixes. (#2863)
* Various dxc/fxc compatibility fixes.
* Cleanup.
* Fix test cases.
* Fix comments.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-options.cpp')
| -rw-r--r-- | source/slang/slang-options.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 8437d9a6c..353c6e57f 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -81,6 +81,8 @@ enum class OptionKind LineDirectiveMode, Optimization, Obfuscate, + GLSLForceScalarLayout, + EnableEffectAnnotations, // Downstream @@ -415,6 +417,13 @@ void initCommandOptions(CommandOptions& options) "for GLSL output." }, { OptionKind::Optimization, "-O...", "-O<optimization-level>", "Set the optimization level."}, { OptionKind::Obfuscate, "-obfuscate", nullptr, "Remove all source file information from outputs." }, + { OptionKind::GLSLForceScalarLayout, + "-force-glsl-scalar-layout", + nullptr, + "Force using scalar block layout for uniform and shader storage buffers in GLSL output."}, + { OptionKind::EnableEffectAnnotations, + "-enable-effect-annotations", + "Enables support for legacy effect annotation syntax."}, }; _addOptions(makeConstArrayView(targetOpts), options); @@ -656,7 +665,7 @@ struct OptionsParser SlangTargetFlags targetFlags = 0; int targetID = -1; FloatingPointMode floatingPointMode = FloatingPointMode::Default; - + bool forceGLSLScalarLayout = false; List<CapabilityAtom> capabilityAtoms; // State for tracking command-line errors @@ -1831,6 +1840,16 @@ struct OptionsParser setFloatingPointMode(getCurrentTarget(), FloatingPointMode(value)); break; } + case OptionKind::GLSLForceScalarLayout: + { + getCurrentTarget()->forceGLSLScalarLayout = true; + break; + } + case OptionKind::EnableEffectAnnotations: + { + compileRequest->setEnableEffectAnnotations(true); + break; + } case OptionKind::Optimization: { UnownedStringSlice levelSlice = argValue.getUnownedSlice().tail(2); @@ -2525,6 +2544,10 @@ struct OptionsParser { compileRequest->setTargetFloatingPointMode(targetID, SlangFloatingPointMode(rawTarget.floatingPointMode)); } + if (rawTarget.forceGLSLScalarLayout) + { + compileRequest->setTargetForceGLSLScalarBufferLayout(targetID, true); + } } if(defaultMatrixLayoutMode != SLANG_MATRIX_LAYOUT_MODE_UNKNOWN) |
