diff --git a/src/sgl/utils/python/slangpy.cpp b/src/sgl/utils/python/slangpy.cpp index ea86d95a..a81b794b 100644 --- a/src/sgl/utils/python/slangpy.cpp +++ b/src/sgl/utils/python/slangpy.cpp @@ -624,10 +624,13 @@ SGL_PY_EXPORT(utils_slangpy) ) .def_prop_rw("shape", &NativeSlangType::get_shape, &NativeSlangType::set_shape, D_NA(NativeSlangType, shape)); - nb::class_(slangpy, "NativeMarshall") // + // This exposing of NativeMarshall as NativeMarshallBase, and the corresponding + // trampoline below is not how it is recommended in nanobind. It is a workaround + // for issue https://github.com/shader-slang/sgl/issues/159 + nb::class_(slangpy, "NativeMarshallBase") // .def( "__init__", - [](NativeMarshall& self) { new (&self) PyNativeMarshall(); }, + [](NativeMarshall& self) { new (&self) NativeMarshall(); }, D_NA(NativeMarshall, NativeMarshall) ) @@ -658,6 +661,13 @@ SGL_PY_EXPORT(utils_slangpy) .def("create_output", &NativeMarshall::create_output, D_NA(NativeMarshall, create_output)) .def("read_output", &NativeMarshall::read_output, D_NA(NativeMarshall, read_output)); + nb::class_(slangpy, "NativeMarshall") // + .def( + "__init__", + [](PyNativeMarshall& self) { new (&self) PyNativeMarshall(); }, + D_NA(PyNativeMarshall, PyNativeMarshall) + ); + nb::class_(slangpy, "NativeBoundVariableRuntime") // .def(nb::init<>(), D_NA(NativeBoundVariableRuntime, NativeBoundVariableRuntime)) .def_prop_rw(