Repository navigation
hk: share the Gen1 ray-query uniform upload between compute and graphics (-24 lines) - #523
Merged
Merged
Conversation
hk_g17p_build_compute_program() and hk_gen1_upload_fragment_query_state() each carry a copy of the same ray-query uniform setup: state rebasing, the AS-table and candidate constant blocks, the context/table pointers and the runtime BO references. Only the launch-context template and the graphics profile pointer differ. Fold the copies into hk_gen1_upload_rq_uniforms(), which takes the caller's context and a profile flag. Both copies came from fce5f94 (DjDeveloperr). No functional change; the compute path now checks its workgroup context before allocating. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Author
|
The G17P ray-query row. A = aurora-wip 4596393, B = A + this PR, native release builds on the A18 Pro, user-space overlay: all of |
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.
Problem
The Gen1 ray-query uniform setup exists twice: once in
hk_g17p_build_compute_program()(hk_cmd_dispatch.c) and once inhk_gen1_upload_fragment_query_state()(hk_gen1_query_state.c). Both copies do the same steps: SCS init, the state rebase loop, the AS-table and candidate constant blocks, the context/table pointers, the range, and the runtime BO retains. They differ only in the launch-context template and the fragment-only profile block. Both came from fce5f94. Any fix to one copy has to be made to the other by hand.Change
Fold the two copies into one helper,
hk_gen1_upload_rq_uniforms(cmd, context, context_words, profile, range), inhk_gen1_query_state.c, declared inhk_cmd_buffer.h. The compute and graphics paths both call it, passing their own context and the profile flag.One ordering difference: the compute path now builds its workgroup context (
agx_rt_compute_gen1_context_local) before the pool allocations rather than after. Only the error path is affected.Net: +84 / -108 lines (-24), 3 files.
Testing
meson test --suite asahi(all 193 tests, including the hk Gen1 query-state unit test): 192 OK / 1 FAIL, the same as base c55152d. The failure,hk_dual_source_gpl, also fails at base in this container.Still to run
ray_query.*plus the compute ray-query cases, A/B against base. This is a live path on G17P, so it needs that row before merge.Notes
hk_cmd_dispatch.clines ~1088-1110. Open PRs hk, asahi: bound AGX3B mma8 GPRs, guard G17P dispatch barrier elision, and add weakbarrier perftest #354, borealis: hardware ray queries on M5 with a generated intersection runtime #337 and asahi, borealis: AGX3 compute shader vectorization, op_timings register-cache hints, unary bitop wait folding, and group_count upload cache #413 touch 1541+ and 3051+. Thehk_cmd_buffer.haddition is one line after 2745, away from borealis: initialize compressed storage image metadata on discard #469, borealis: keep G17P colour MSAA compressed with transient eMRT backing #115 and loader: pick zink for the M5 Ultra's GPU, so Hyprland and EGL clients start on its GPU instead of aborting #363.Assisted-by: LLM (Claude:Opus 5.5)