Skip to content

Bind strides for indexed resource-heap buffer reads - #43

Draft
gmankab wants to merge 1 commit into
spidercraft:linux-native-runtimefrom
gmankab:contrib/linux-native-heap-view-strides
Draft

gmankab wants to merge 1 commit into
spidercraft:linux-native-runtimefrom
gmankab:contrib/linux-native-heap-view-strides

Conversation

@gmankab

@gmankab gmankab commented Nov 26, 2026

Copy link
Copy Markdown

An indexed buffer load through the full resource heap does not have a static used-resource entry. The Linux native translator refused those loads, so affected compute dispatches had no host pipeline.

This backport binds one view-stride table for the heap, with a slot count that bounds the root SRV reads. It uses the actual bound structured or raw SRV to calculate the byte address, and refreshes the candidate buffer views after descriptor replacement or deferred title memory writes. The test checks two runtime strides, RAW with a zero index multiplier, and unavailable slots. A second fixture checks host binding and replacement of a placed view.

The Linux native integration went from zero of 31 emitted compute shaders in the captured stride-refusal group to 14. All 14 passed DXIL validation and created pipelines on RX 6800. One accounted for 84 missed dispatches per frame in the earlier profile. The synthetic dispatch and host binding fixtures passed on RX 6800 and Lavapipe. The Lavapipe host-heap fixture still produced the descriptor-write validation warning seen in earlier tests.

Opening as a draft for a gameplay follow-up. The new lowering covers raw and structured buffer SRVs loaded from the resource heap. Typed views, indexed writes, and descriptor joins remain outside this path. In-game dispatch output, frame timing, and heap refresh cost still need measurement.

Based-on: Marvisak#193
Based-on: Marvisak#1544
Based-on: Marvisak@0b35b7f
Tested-on: RX 6800 and Lavapipe, Fedora Linux 45, Linux native
Assisted-by: gpt-6.2 sol xhigh

A shader that selects a buffer from the full resource heap has no
static used-resource entry for that buffer. Indexed loads previously
failed translation, leaving affected compute dispatches without host
pipelines.

Mirror the structured and raw SRV strides alongside each title view
heap. The shader bounds its metadata lookup with the heap slot count,
uses the stride to compute the byte address, and leaves an invalid or
unavailable slot at zero. Preserve the console's zero index multiplier
for a raw descriptor and reject byte offsets that would wrap.

Refresh only the relevant heap's buffer views before binding its
metadata. Revisit them after descriptor replacement or a deferred copy
so a later dispatch sees both the current metadata and its input data.
The list retains the stride buffer for the lifetime of its commands.

Based-on: Marvisak#193
Based-on: Marvisak#1544
Based-on: Marvisak@0b35b7f
Tested-on: RX 6800 and Lavapipe, Fedora Linux 45, Linux native
Assisted-by: gpt-6.2 sol xhigh
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