Skip to content

[DirectX] Update DXContainerGlobals to get the shader flags from metadata rather than analysis #120152

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
Tracked by #57
bogner opened this issue Dec 16, 2024 · 1 comment

Comments

@bogner
Copy link
Contributor

bogner commented Dec 16, 2024

DXContainerGlobals currently grabs shader flags from the analysis. This seems reasonable at a high level, but there are a couple of caveats:

  1. We'd like to disallow running shader flags analysis after op lowering (See [DirectX] Run shader flags analysis before DXILOpLowering #120119), which means this would need to rely on the flags analysis being preserved since then
  2. The flags are already embedded in DXIL metadata at this point, so we should just be able to copy them from there.

We should update the pass to simply pull the flags in an opaque way from metadata and put them into the appropriate container part.

@bogner
Copy link
Contributor Author

bogner commented Dec 18, 2024

Had a half baked thought worth considering here - what if we continue to use the shader flags analysis in DXContainerGlobals, but we teach the analysis to trust the metadata? That is to say, the analysis can just fill the flags structure if the metadata is present, and since the metadata is always present post-lowering, then it can run at any time. This has the interesting effect that the flags pass can be run on DXIL and get the flags from metadata if we at some point want to reuse the pass in the DXIL->modern LLVM path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready
Development

No branches or pull requests

2 participants