summaryrefslogtreecommitdiffstats
path: root/source/slang-wasm/slang-wasm-bindings.cpp
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2024-11-13 19:50:52 -0500
committerGitHub <noreply@github.com>2024-11-13 16:50:52 -0800
commit5cb960a72449dad36594e8ad2bfa899f5aaa11be (patch)
tree5ee550e8a50ccc2833b8e6fdf139a5b6da3294c2 /source/slang-wasm/slang-wasm-bindings.cpp
parentf7149b94847a91f9f1f364e79f1be750aaf90191 (diff)
Fix WGSL emit for '&' and add bindings for thread group size (#5557)
Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang-wasm/slang-wasm-bindings.cpp')
-rw-r--r--source/slang-wasm/slang-wasm-bindings.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang-wasm/slang-wasm-bindings.cpp b/source/slang-wasm/slang-wasm-bindings.cpp
index 8c8257795..43a516ccc 100644
--- a/source/slang-wasm/slang-wasm-bindings.cpp
+++ b/source/slang-wasm/slang-wasm-bindings.cpp
@@ -53,6 +53,16 @@ EMSCRIPTEN_BINDINGS(slang)
allow_raw_pointers())
.function("getBindingIndex", &slang::wgsl::VariableLayoutReflection::getBindingIndex);
+ class_<slang::wgsl::EntryPointReflection>("EntryPointReflection")
+ .function(
+ "getComputeThreadGroupSize",
+ &slang::wgsl::EntryPointReflection::getComputeThreadGroupSize);
+
+ class_<slang::wgsl::EntryPointReflection::ThreadGroupSize>("ThreadGroupSize")
+ .property("x", &slang::wgsl::EntryPointReflection::ThreadGroupSize::x)
+ .property("y", &slang::wgsl::EntryPointReflection::ThreadGroupSize::y)
+ .property("z", &slang::wgsl::EntryPointReflection::ThreadGroupSize::z);
+
class_<slang::wgsl::ProgramLayout>("ProgramLayout")
.function("toJsonObject", &slang::wgsl::ProgramLayout::toJsonObject)
.function("getParameterCount", &slang::wgsl::ProgramLayout::getParameterCount)
@@ -63,6 +73,10 @@ EMSCRIPTEN_BINDINGS(slang)
.function(
"getGlobalParamsTypeLayout",
&slang::wgsl::ProgramLayout::getGlobalParamsTypeLayout,
+ allow_raw_pointers())
+ .function(
+ "findEntryPointByName",
+ &slang::wgsl::ProgramLayout::findEntryPointByName,
allow_raw_pointers());
enum_<slang::BindingType>("BindingType")