Skip to content
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

System Value semantic for accessing Execute Indirection counters #286

Open
jongreenberg-ea opened this issue Jul 26, 2024 · 0 comments
Open
Labels
enhancement New feature or request Theme:SM 7 Issues to consider for SM 7

Comments

@jongreenberg-ea
Copy link

While its wonderful to finally have a method in DX12 to access the current ExecuteIndirect "counter", doing this via a "hardwired" root-constant in the RootSig feels strange and frankly out of step with how other equivalent counters are visible in shaders. Relying on root-signature "trickery" to expose this value to the shader seems:

  • simultaneously inconsistent with how everything else works;
  • prone to error as there is little preventing a user from attempting to manually write a value to the RootSig slot that would then be overwritten by the system (at least as I understand it)
  • not automatically obvious what the value of this root constant will be if the shader is not invoked from inside an EI
  • expects that a user must acknowledge at shader authoring time exactly how the shader will be invoked/dispatched, which may not always be the case, and thus again prone to user error.
  • root-signature setup is often heavily abstracted in many engines making this often very hard for users to work with
  • lack of discoverability of this portion of the API by users, as it doesn't function consistently with everything else.

What would seem more aligned with the rest of the API design would be a SV_ system semantic similar to SV_PrimitiveID, SV_VertexID, SV_InstanceID, and so forth. Presumably this could have a name like SV_ExecutionID, be mapped to a uint and default to zero if not called from inside an EI. Ideally it should be accessible in any shader stage as well. Its important to be able to trivially discover which element in a list is being processed out of an EI workset, and doing it in a way consistent with the rest of the API would certainly be preferred.

@jongreenberg-ea jongreenberg-ea added enhancement New feature or request needs-triage labels Jul 26, 2024
@damyanp damyanp added Theme:SM 7 Issues to consider for SM 7 and removed needs-triage labels Aug 8, 2024
@damyanp damyanp added this to the Shader Model Backlog milestone Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Theme:SM 7 Issues to consider for SM 7
Projects
Status: Triaged
Development

No branches or pull requests

2 participants