WGSL/rasterization: How to properly decorate structs used in parameters to entry points with semantics #8532
-
|
I'm having trouble wrapping my head around how to add semantics to the fields in a struct which I want to output from a vertex shader and input into the fragment shader. My problem is that the generated WGSL code ends up not having proper
However, no location attributes are generated for any of my fields with non-builtin semantics. I figured that page might just contain outdated info so I tried adding semantics. I am really unsure how to do it correctly though, as documentation for this is very fragmented. From various examples, I pieced together that you can probably just invent any custom semantics yourself, giving it any name you want, and Slang just uses it as a marker of sorts to (in the case of WGSL) assign matching bind points. (If this is explained somewhere, I'd appreciate it if you can point me to the relevant part of the docs) This however still results in WGSL code that does not specify any Consequently, both Chrome and Firefox complain about my entry point producing output without a binding, e.g. Chrome: What am I doing wrong? How can I tell Slang to generate a binding for my /Edit: Tested with Slang 2025.17.1 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
I just noticed that the very sensible does result in the following WGSL: I'm beginning to think I might have stumbled upon a bug? |
Beta Was this translation helpful? Give feedback.
I believe this is #8388. You can use an older version of slang until it's fixed.