-
Notifications
You must be signed in to change notification settings - Fork 718
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
Shader Execution Reordering implementation #7094
base: main
Are you sure you want to change the base?
Conversation
Specification PR: microsoft/hlsl-specs#277 - This enables SER with SM6.9+ - Excludes reordercoherent and REORDER_SCOPE. Their implementation is largely orthogonal and factored into another commit. - Includes a prototype header to inform a header-based implementation of the HitObject API in the HLSL implementation for Clang (docs/HitObject.h).
✅ With the latest revision this PR passed the Python code formatter. |
✅ With the latest revision this PR passed the C/C++ code formatter. |
@microsoft-github-policy-service agree company="NVIDIA" |
utils/hct/hctdb.py
Outdated
"HitObject_TraceRay,HitObject_FromRayQuery,HitObject_FromRayQueryWithAttrs,HitObject_MakeMiss,HitObject_MakeNop,HitObject_Invoke,ReorderThread,HitObject_IsMiss,HitObject_IsHit,HitObject_IsNop,HitObject_RayFlags,HitObject_RayTMin,HitObject_RayTCurrent,HitObject_WorldRayOrigin,HitObject_WorldRayDirection,HitObject_ObjectRayOrigin,HitObject_ObjectRayDirection,HitObject_ObjectToWorld3x4,HitObject_ObjectToWorld4x3,HitObject_WorldToObject3x4,HitObject_WorldToObject4x3,HitObject_GeometryIndex,HitObject_InstanceIndex,HitObject_InstanceID,HitObject_PrimitiveIndex,HitObject_HitKind,HitObject_ShaderTableIndex,HitObject_SetShaderTableIndex,HitObject_LoadLocalRootTableConstant,HitObject_Attributes" | ||
).split(","): | ||
self.name_idx[i].category = "Shader Execution Reordering" | ||
self.name_idx[i].shader_model = 6, 8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably this should be 6, 9
? @bob80905 might be able to comment on the right way to do this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it should be just that simple for the most part. There may be places in here that need to change explicit checks for certain SER behavior, but as for the intrinsics, it's a one character change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fixed with the latest commit
Hi @simoll! Thanks for this! It's clearly a lot of work. That is why I have to make a request. Could you divide this up a bit into separate PRs? If that is complicated by non-technical reasons, even having separate commits that are meant to be reviewed independently would also be useful. Some suggested divisions:
Any other division that is convenient for or makes sense to you would be great as well. It's just a matter of consuming such a volume of code with so many interdependencies. I also see that there are no checks for shader model version. I would expect to see at least a few checks for |
Yes. I've divided the change in this PR into three patches:
The first PR (#7097) contains most of the novelties for DXC (static member functions for builtins, HitObject scalar type). I suggest we keep this PR as an on-going record of the changes and open separate PRs for the patches.
There were checks: The EnableShaderExecutionReordering option is only set for SM6.9+ |
When specifying more than four stages in a PAQ, the SmallVector in the PayloadAccessAnnotation starts to allocate memory. That memory is never free'd. The hitobject-entry-errors accidentally triggered this: struct [raypayload] Payload { float elem - : write(caller,closesthit,anyhit,closesthit,miss) - : read(caller,closesthit,anyhit,closesthit,miss); + : write(caller,anyhit,closesthit,miss) + : read(caller,anyhit,closesthit,miss); };
Shader Execution Reordering (SER) implementation
Specification PR: microsoft/hlsl-specs#277