diff options
| author | Yong He <yonghe@outlook.com> | 2025-01-10 10:57:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-10 10:57:04 -0800 |
| commit | 5290c580632cfb56847b863a32dc020a21d1c93e (patch) | |
| tree | 4c543f28d13f62a1dc3293b76151dda7585743ab /source/slang/slang-options.cpp | |
| parent | 4cfae806a6f9c0203ce44c4ce04df5ad66cdc8a2 (diff) | |
Initial implementation of SP#015 `DescriptorHandle<T>`. (#6028)
* Initial implementation of `ResourcePtr<T>`.
* Update docs
* Fix build error.
* Add more discussion.
* Update documentation.
* Update TOC.
* Fix.
* Fix.
* Add test case for custom `getResourceFromBindlessHandle`.
* Add namehint to generated descriptor heap param.
* Fix.
* Fix.
* format code
* Rename to `DescriptorHandle`, and add `T.Handle` alias.
* Fix compiler error.
* Fix.
* Fix build.
* Renames.
* Fix documentation.
* Documentation fix.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-options.cpp')
| -rw-r--r-- | source/slang/slang-options.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 681999168..a0e8515eb 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -527,9 +527,7 @@ void initCommandOptions(CommandOptions& options) {OptionKind::EmitReflectionJSON, "-reflection-json", "reflection-json <path>", - "Emit reflection data in JSON format to a file."}, - }; - + "Emit reflection data in JSON format to a file."}}; _addOptions(makeConstArrayView(generalOpts), options); @@ -672,7 +670,10 @@ void initCommandOptions(CommandOptions& options) "-incomplete-library", nullptr, "Allow generating code from incomplete libraries with unresolved external functions"}, - }; + {OptionKind::BindlessSpaceIndex, + "-bindless-space-index", + "-bindless-space-index <index>", + "Specify the space index for the system defined global bindless resource array."}}; _addOptions(makeConstArrayView(targetOpts), options); @@ -2475,6 +2476,10 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv) // value in only allowing a single `-profile` option per target while still allowing // zero or more `-capability` options. + // Don't treat zero args as an error. + if (!m_reader.hasArg()) + break; + CommandLineArg operand; SLANG_RETURN_ON_FAIL(m_reader.expectArg(operand)); @@ -2899,6 +2904,13 @@ SlangResult OptionsParser::_parse(int argc, char const* const* argv) linkage->m_optionSet.add(OptionKind::DisableShortCircuit, true); break; } + case OptionKind::BindlessSpaceIndex: + { + Int index = 0; + SLANG_RETURN_ON_FAIL(_expectInt(arg, index)); + linkage->m_optionSet.add(OptionKind::BindlessSpaceIndex, (int)index); + break; + } default: { // Hmmm, we looked up and produced a valid enum, but it wasn't handled in the |
