diff options
| author | Sai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com> | 2024-11-08 13:03:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-08 13:03:42 -0500 |
| commit | f66b046e2767cd7a38acec8c0f988e5937f062e7 (patch) | |
| tree | 178b745cea2479675a368cb67526833aad554630 /source/slang-wasm/slang-wasm.cpp | |
| parent | 0f46ce82998b2b1cb68f04bef3a097ea850ad453 (diff) | |
[WGSL] [WASM] Add reflection endpoints + Fix bit manipulation operations (#5499)
* Add key reflection endpoints for WASM
* Fix WGSL output around bit-manipulation operators
* format code
* Fix pointer ownership
* fix formatting
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang-wasm/slang-wasm.cpp')
| -rw-r--r-- | source/slang-wasm/slang-wasm.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source/slang-wasm/slang-wasm.cpp b/source/slang-wasm/slang-wasm.cpp index be30f8394..f73e70ba0 100644 --- a/source/slang-wasm/slang-wasm.cpp +++ b/source/slang-wasm/slang-wasm.cpp @@ -386,6 +386,49 @@ HashedString* ComponentType::loadStrings() return hashedStrings; } +ProgramLayout* ComponentType::getLayout(unsigned int targetIndex) +{ + return (slang::wgsl::ProgramLayout*)interface()->getLayout(targetIndex); +} + +unsigned int ProgramLayout::getParameterCount() +{ + return interface()->getParameterCount(); +} + +VariableLayoutReflection* ProgramLayout::getParameterByIndex(unsigned int index) +{ + return (slang::wgsl::VariableLayoutReflection*)(interface()->getParameterByIndex(index)); +} + +TypeLayoutReflection* ProgramLayout::getGlobalParamsTypeLayout() +{ + return (slang::wgsl::TypeLayoutReflection*)(interface()->getGlobalParamsTypeLayout()); +} + +BindingType TypeLayoutReflection::getDescriptorSetDescriptorRangeType( + unsigned int setIndex, + unsigned int rangeIndex) +{ + return interface()->getDescriptorSetDescriptorRangeType(setIndex, rangeIndex); +} + +std::string VariableLayoutReflection::getName() +{ + return interface()->getName(); +} + +TypeLayoutReflection* VariableLayoutReflection::getTypeLayout() +{ + return (slang::wgsl::TypeLayoutReflection*)(interface()->getTypeLayout()); +} + +unsigned int VariableLayoutReflection::getBindingIndex() +{ + return interface()->getBindingIndex(); +} + + namespace lsp { Position translate(Slang::LanguageServerProtocol::Position p) |
