I'm attempting to use a callback with struct arguments, and I've hit this.
|
panic("ffi: unsupported callback argument type: " + argType.Kind().String()) |
- GOOS=linux
- GOARCH=amd64
- github.com/go-webgpu/goffi @ 6330e63
For reference it's clang_visitChildren where I'm running it to this.
Would it be possible to add support for struct arguments? Or are there architectural constraints that prohibit it?
It looks like the callback's argument types are determined through reflection. So I guess that there would not be a need to provide the shape of the structs with *types.TypeDescriptor as the struct size would be available through reflection?
Incidentally, I didn't spot anything in either the README.md or docs/ARCHITECTURE.md that mentioned what argument types are supported for callbacks. So I'm not sure whether this limitation is intentional or not.
I'm attempting to use a callback with struct arguments, and I've hit this.
goffi/ffi/callback.go
Line 109 in 05fe0a3
For reference it's clang_visitChildren where I'm running it to this.
Would it be possible to add support for struct arguments? Or are there architectural constraints that prohibit it?
It looks like the callback's argument types are determined through reflection. So I guess that there would not be a need to provide the shape of the structs with
*types.TypeDescriptoras the struct size would be available through reflection?Incidentally, I didn't spot anything in either the README.md or docs/ARCHITECTURE.md that mentioned what argument types are supported for callbacks. So I'm not sure whether this limitation is intentional or not.