-
Notifications
You must be signed in to change notification settings - Fork 808
[DXIL] Add -fhlsl-unused-resource-bindings=reserve-all to ensure consistent binding assignments #7643
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
base: main
Are you sure you want to change the base?
[DXIL] Add -fhlsl-unused-resource-bindings=reserve-all to ensure consistent binding assignments #7643
Changes from 24 commits
9887b09
8454274
f60c594
74283d1
6f5689d
26a7f54
b63cdd2
8d7dc86
298ff34
28b24f1
cb9f345
777a50e
3fc2f2e
f5c545b
ea760bf
9169ce0
6a15db9
895724d
a633dc6
316e493
68f20d6
6d0531b
75f9cc0
c2b24ed
d018f94
c8efa7b
5c96b53
77275a4
ba1b43b
2f482a9
4492c44
118363f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,12 @@ | |
|
|
||
| namespace hlsl { | ||
|
|
||
| enum class UnusedResourceBinding : uint32_t { Strip, ReserveAll, Count }; | ||
|
|
||
| static_assert(UnusedResourceBinding::Count <= UnusedResourceBinding(7), | ||
| "Only 3 bits are reserved for UnusedResourceBinding by HLOptions " | ||
| "and ShaderFlags"); | ||
Nielsbishere marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
||
| /* <py> | ||
| import hctdb_instrhelp | ||
| </py> */ | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need an IR-based pass test for changes that impact this pass.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where do I add that? Any examples? (Same with the comment on DxilGenerationPass.cpp)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding these IR-based tests, there's a helper script: However, as I was anticipating questions related to how to target this specific area, I tried crafting a test myself. Along the way, I ran into a bug in the pass, so I put a PR up to fix the bug, along with a couple pass tests. Here's the PR: #7934 Notice how the metadata indicates unbound resources, then it checks the binding. For this change, this should check several things:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do in a bit. Already pulled your PR into mine locally.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tex3d I have a bit of trouble trying to wrap my head around this process. So if I simplify it in steps maybe you can see where it goes wrong.
So a few questions:
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -155,6 +155,8 @@ void InitDxilModuleFromHLModule(HLModule &H, DxilModule &M, bool HasDebugInfo) { | |
| // bool m_bDisableOptimizations; | ||
| M.SetDisableOptimization(H.GetHLOptions().bDisableOptimizations); | ||
| M.SetLegacyResourceReservation(H.GetHLOptions().bLegacyResourceReservation); | ||
| M.SetUnusedResourceBinding( | ||
| UnusedResourceBinding(H.GetHLOptions().bUnusedResourceBinding)); | ||
|
||
| // bool m_bDisableMathRefactoring; | ||
| // bool m_bEnableDoublePrecision; | ||
| // bool m_bEnableDoubleExtensions; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.