Repository navigation
agx: let G17P ray queries commit opaque triangle hits in hardware - #21
Open
DjDeveloperr wants to merge 2 commits into
Open
DjDeveloperr wants to merge 2 commits into
DjDeveloperr wants to merge 2 commits into
Conversation
Candidate control 0x9142 queues every triangle hit, opaque ones included, for the software candidate loop. With field 12:11 set (0x9942) the hardware commits opaque triangle hits itself and queues only what software has to decide. Use it when the ray flags leave opaque triangle hits to the hardware: no Opaque (such rays commit every hit anyway, and incoherent ones traced slower with hardware commits), NoOpaque, facing or opacity culls, or SkipTriangles. After each trace or refill, take the hardware's committed hit when it is closer than the committed one, building the same packets a software commit would: the distance from the tmax slot, the hit words from query words 256/512, and the instance from the committed-instance pointer at 8960. The current-instance pointer at 9152 is wherever traversal stopped, which can be past the hit. Look up only the committed fields the shader reads. (cherry picked from commit 3a20791)
[Medium impact] The PR appears safe to merge; the previous first-hit stopping issue is fixed. SummaryLets G17P hardware commit eligible opaque triangle hits and copies those hits into the query’s saved result.
Reviews (2) · Last reviewed commit: "agx: end G17P ray queries with Terminate..." · Reviewed by Greptile |
…re hit A hardware-committed hit merged into a TerminateOnFirstHit query left the query running: later refills could still hand nearer candidates to the shader after a hit was committed. End the query there, as a software commit of an opaque triangle does. (cherry picked from commit bdd43fa)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
G17P ray queries run in candidate mode (control 0x9142), so the hardware queues every triangle hit, opaque ones included, for the software candidate loop. Each hit then costs a software pass of dependent loads plus a hardware round trip.
With field 12:11 set (0x9942), the hardware commits opaque triangle hits itself and queues only the hits software has to decide. This change uses 0x9942 when the ray flags leave opaque triangle hits to the hardware. That means none of these flags is set:
After each trace or refill, the lowering takes the hardware's committed hit when it is closer than the current committed one. It builds the same packets a software commit would:
The current-instance array at 9152, which candidates use, holds the instance where traversal stopped, which can be past the committed hit. The merge only looks up the committed fields the shader reads (node, instance IDs, barycentrics).
How the layout was established:
Mirror of aurora-silicon#100 (merged as 3295ac7). Qualification on J700 (Neo) against aurora-wip 86ffb65:
gpubench-rt RT plan, alternated ×2. Every rt.scene image CRC is identical to the baseline.
Full ray-query + ray-tracing-pipeline CTS: 47102 pass / 10088 not supported / 0 fail, identical to the baseline.
Host asahi meson suite: 75/75 on aurora-wip.
No kernel errors during the runs.
This omacom tree has the identical agx_nir_gen1_ray_query.{c,h}. The cherry-pick builds with -Dwerror=true and passes the asahi meson suite 76/76.