Skip to content

hk: share the Gen1 ray-query uniform upload between compute and graphics (-24 lines) - #523

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
deadweight/hk-gen1-rq-uniforms
Nov 20, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
deadweight/hk-gen1-rq-uniforms

Conversation

@RyanTheTide

Copy link
Copy Markdown

Problem

The Gen1 ray-query uniform setup exists twice: once in hk_g17p_build_compute_program() (hk_cmd_dispatch.c) and once in hk_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), in hk_gen1_query_state.c, declared in hk_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

  • x86 build (clang, release with asserts) of the asahi Gallium and Vulkan drivers with tools=asahi,drm-shim and build-tests=true, then 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

  • A G17P hardware row (Neo or J616s): dEQP-VK 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

Assisted-by: LLM (Claude:Opus 5.5)

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>
@RyanTheTide

Copy link
Copy Markdown
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 dEQP-VK.ray_query.*, 49,359 cases, identical case by case (34,685 Pass / 14,674 NotSupported on both), no GPU errors in the kernel log. x86 clang + drm-shim meson test --suite asahi on B: 204/204.

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 20, 2026 06:48
@RyanTheTide
RyanTheTide merged commit 33d094f into aurora-wip Nov 20, 2026
@RyanTheTide
RyanTheTide deleted the deadweight/hk-gen1-rq-uniforms branch November 27, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant