Basic support for HLSL templating#434
Conversation
parse and pass through class inheritance fix templated struct declaration add unit test
|
github isn't letting me request a review for some reason - @laurentlb @eldritchconundrum |
|
Support for accepting (and mostly ignoring for now) templates (and inheritance)... Interesting!
That looks good! |
| template<> | ||
| struct is_floating_point<float>:true_type{}; |
There was a problem hiding this comment.
@eldritchconundrum should the template defn be emitted on the same line? does that matter for minification? same char count. '\n' or ' '
There was a problem hiding this comment.
It matters a little because it affects the compression of the generated shader.
In the printer, we use \n when the newline is mandatory (the shader won't work without it), and we use \0 to mean "unessential" newline that can be removed by the formatter when no indentation is needed (e.g. with --format text).
There was a problem hiding this comment.
ah got it, i guess that would require not having the template definition in a verbatim block though
eldritchconundrum
left a comment
There was a problem hiding this comment.
Looks good to me. I have improvements ideas, hopefully I'll do them next week.
sweet tag me in the PR(s) if you're down i'd love to help - i'm tryna get stuff like |
|
Thanks a lot! |
Support parsing & pass-through of basic HLSL templating introduced in HLSL 2021: https://devblogs.microsoft.com/directx/announcing-hlsl-2021/
Let me know if there's a way to do this that makes more sense, not too familiar with the codebase