Skip to content

Q: Good way go get RootSignature from a spir-v shader? #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JCash opened this issue May 17, 2025 · 2 comments
Open

Q: Good way go get RootSignature from a spir-v shader? #71

JCash opened this issue May 17, 2025 · 2 comments

Comments

@JCash
Copy link

JCash commented May 17, 2025

Hi!

Avalanche alumni here 👋
I recently got the tip to look into this tool by a former colleague of ours.

Given the nature of this tool, I wonder if there's some part I can look at in terms of generating a RootSignature for hlsl code?
We're using spirv-cross to take a spir-v file to generate a .hlsl file, but it doesn't seem to have the option to generate the RootSignature.

So I'm looking into other toolsets if they have some helper code to do this.
I know I could roll my own, but I think it would be beneficial for me to use a more "standard" way to do it.

Any tips or pointers in the right direction would be greatly appreciated!

Regards,
Mathias

@miguel-petersen
Copy link
Collaborator

Hiya!

I don't think there's a comparable piece of code for that here.

However, thinking out loud, if you know the (HLSL) registers allocated to the respective resources (i.e., Texture2D -> t0, etc.), you can probably generate it fairly easily.

Assuming that the descriptor layout in that SPIRV kernel is what you want. I'd generate the mappings from the Spv descriptor decorations, particularly as you already know the descriptor table groupings. For root parameters, outside of root constants, I'd consider a "global" table akin to what DXC does for static values.

Hopefully that might prove of some use! 🙂

@JCash
Copy link
Author

JCash commented May 23, 2025

Thanks for your answer!
Yeah, I do have access to the descriptor layout, and I guess I'll have to start rolling our own solution.
It just felt like it should be a solved problem somewhere 🤔

Regards,
Mathias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants