Skip to content

zink: keep G17P lazy feedback-loop usage off bindless handles; drop test timing modes - #38

Merged
DjDeveloperr merged 2 commits into
aurora-wipfrom
aurora/zink-lazy-feedback-bindless-fix-20261023
Oct 23, 2026
Merged

DjDeveloperr merged 2 commits into
aurora-wipfrom
aurora/zink-lazy-feedback-bindless-fix-20261023

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 23, 2026 •

Copy link
Copy Markdown

Follow-up to #33 (DJ's G17P compressed render targets). Review of cf035d2 found two problems in zink's lazy feedback-loop usage and a test that carries benchmark modes.

  • zink: keep lazy feedback-loop usage to G17P and off bindless handles. A texture handle keeps the image view it was created with, and rebinding a resource doesn't refresh handles. Recreating an image because it was resident as a bindless texture left its handles on the old object, so reads went stale and then hit a destroyed VkImageView once the old object retired. Render-target images now get the usage when a texture handle is created, before the handle takes its view (the same way zink_create_image_handle() adds storage first), and residency no longer triggers a recreation. The workaround is also keyed on the G17P device ID, as the SSBO limit already is, so a later part that exposes VK_KHR_unified_image_layouts doesn't pick it up.
  • zink: give G17P image handles their feedback-loop usage first too. Image handles keep their view in the same way, so the same fix applies to them.
  • hk/tests: drop the timing modes from the compressed mip-blit test. The --bench and --grid modes go. The threshold data stays in 9d73df9's message.

M1/M2 and every non-G17P driver are unchanged by construction.

Gates (buildbox, offline SDK via buildslot): x86_64 and AArch64 builds pass (asahi, zink, vulkan). Asahi + poly host suites 92/92, agx3_rt_core 611/611, SSBO block-limit shim test unchanged against aurora-wip. Neo results are in the comment below.

🤖 Generated with Claude Code

The --bench and --grid modes timed whole mip chains and single levels to
choose the compressed mip-store threshold. That threshold and its data are
recorded in the commit that set it, and benchmark tools are kept out of
the tree, so keep only the correctness and no-op shim modes.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Two fixes to lazy feedback-loop usage.

A texture handle keeps the image view it was created with, and rebinding
a resource refreshes bound sampler views, images and attachments but not
handles. Recreating an image because it was resident as a bindless
texture therefore left its handles on the old object: stale reads, then
a destroyed VkImageView once the old object's batch retired. Give a
render-target image its feedback-loop usage when a texture handle is
created for it, before the handle takes its view, as
zink_create_image_handle() already adds storage usage first, and stop
recreating on bindless residency.

The workaround was keyed on Honeykrisp with unified image layouts, which
is G17P today but would include any part that exposes
VK_KHR_unified_image_layouts later. Only G17P decides compression on the
feedback-loop usage, so key it on the G17P device ID, as the SSBO size
limit already is.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@DjDeveloperr
DjDeveloperr merged commit 0d5e42e into aurora-wip Oct 23, 2026
2 of 4 checks passed
@DjDeveloperr

Copy link
Copy Markdown

Reviewed and merged. The bindless handle issue is real: a handle captured its view before a residency-triggered recreation could replace the image. Giving render-target images feedback-loop usage at handle creation, before init_sampler_view(), closes that, and the rebind_count refresh matches zink's existing pattern. Since zink_resource_object_init_feedback_loop() bumps res->rebind_count when it recreates the image, the handle's view is refreshed in the same call. Gating on 0x8140 matches the SSBO-limit workaround. Thanks!

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.

2 participants