You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two notes about using the Zig target for sokol-shdc when making a Material system:
Zig target does not seem to honor the --reflection argument - I'm not seeing any extra data get baked into the .zig output file.
Since Zig is already namespaced under the import name, it would be nice to have the function that builds the file to be named something more generic like pub fn getShaderDesc(backend: sg.Backend) sg.ShaderDesc { ... to work better with Zig reflection when making a Material system.
The text was updated successfully, but these errors were encountered:
Thanks! Yeah, not supporting --reflection is more or less an oversight.
The second one is a bit more tricky though, since there may be multiple shaders in the same .glsl file, and each generates its own getShaderDesc() function.
The solution is probably to add a nested per-shader namespace:
...that way it should be possible to walk the imported toplevel struct and find all shaders (== nested namespace-structs) and their getShaderDesc() functions.
I wonder if the whole shader-reflection stuff could also be simplified when taking Zig's comptime features into account... e.g. instead of having runtime functions to query the reflection information just add constants to the per-shader-namespace struct which can then be discovered by inspecting the struct via Zig's comptime type reflection (or maybe both makes sense).
So far the language binding backends in sokol-shdc are more or less copies of the C backend. But it might be worth supporting language-specific features a bit more.
Two notes about using the Zig target for
sokol-shdc
when making a Material system:--reflection
argument - I'm not seeing any extra data get baked into the .zig output file.pub fn getShaderDesc(backend: sg.Backend) sg.ShaderDesc { ...
to work better with Zig reflection when making a Material system.The text was updated successfully, but these errors were encountered: