Repository navigation
feat(agc): implement image_load through image tables - #920
Closed
Celegans12 wants to merge 3 commits into
Closed
Celegans12 wants to merge 3 commits into
Celegans12 wants to merge 3 commits into
Conversation
9 tasks done
This was referenced Oct 6, 2026
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
This was referenced Oct 6, 2026
This was referenced Oct 6, 2026
9 tasks done
9 tasks done
9 tasks done
Celegans12
force-pushed
the
feat/agc-image-table-image-load
branch
from
October 7, 2026 11:08
d0520ff to
971bfe0
Compare
This was referenced Oct 7, 2026
This was referenced Oct 7, 2026
Celegans12
force-pushed
the
feat/agc-image-table-image-load
branch
from
October 7, 2026 22:34
5db79a5 to
6e5a765
Compare
A T# or S# that s_buffer_load reads at key * stride + addend from a record-time V# was not planned unless it was an r256 T# at key * 32, and bindless entries that could not be bound sampled zeros. Such reads are now table columns: each record the offset can reach is snapshotted at record time, decoded like a direct T# or S# and bound through runtime descriptor arrays and an offset-to-entry map. An entry that cannot be bound exactly, such as a min or max S# or an sRGB T# the shader would have to decode, samples zeros and, if an executing lane selects it, raises a BDA fault that fails the dispatch. Results with unmapped records stay out of the dispatch and draw caches. Uint images, direct or in a table, now sample through the point-filtered S# copy main gives Sint images, as Vulkan leaves linear filtering of integer formats undefined. Bindless slots and APS5_BINDLESS_SLOTS are removed, image samples, gathers and queries carry EXEC, compute pipeline keys include table sizes and the shader disk cache format becomes 10.
A T# or S# that s_load reads through a 64-bit pointer at a runtime
key * stride + addend offset failed to plan ("GetImageResource dword 0
is not a valid runtime value"). Such loads now form image table
columns when the pointer is known at record time (user data or an SRT
read); a descriptor whose offset is known at record time too stays a
direct binding. The snapshot follows the BDA rule of scalar loads: the
pointer plus the dword-aligned offset and immediate, where a wrapping,
unaligned or unmapped dword makes the entry invalid. It holds the keys
the key's known bits allow (key & 0xff gives 256), else the first
65536; a key past them faults as outside the snapshot when a lane
selects it, because the console would read memory there, not zeros.
Image tables accepted only samples, gathers and queries for a T# read
from a table column, so an image_load through a V# or pointer table
threw at planning ("only samples, gathers and queries can").
The planner now also accepts ImageRead in a table column. The direct
path's EXEC-guarded OpImageFetch becomes ReadValue, which the table
emitter's Float/Uint/Sint switch calls like the sampling ops, so a table
read uses the same sampled-image views, unpacking and per-entry fault.
Packed (_pck) loads, stores and atomics through a table still throw, as
do MSAA and 1D-array dimensions.
Tests: agc_driver_image_table matches V# and pointer table reads (r128
and r256, d16 dmask 0x3) to direct image_loads, reads per-wave keys on
32-lane subgroups and checks null, invalid and EXEC-cleared entries;
agc_shader_memory plans an image_load at key * 16 + 8.
Celegans12
force-pushed
the
feat/agc-image-table-image-load
branch
from
October 8, 2026 14:52
6e5a765 to
fd758c0
Compare
9 tasks done
Contributor
Author
This was referenced Oct 10, 2026
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.
What
Stacked on #758; please review the last commit only.
image_loadthrough a V# or pointer image table throws at planning (image table: ImageRead ... only samples, gathers and queries can); #5's bindless tables accepted it and #757 dropped it.PlanTableColumnsalso acceptsImageRead; packed (_pck) loads still throw.OpImageFetchbecomesReadValue, whichReadOnlyValuealso calls in the table's Float/Uint/Sint switch, so table reads share the views, unpacking (d16 included) and per-entry fault of sampling. No binding, ABI or disk cache change.image_loadof its words gives, a null entry zeros. An invalid entry reads zeros and faults only when an executing lane reads it, as for samples (TechnicalDebt unchanged).image_storeand atomics through a table, and MSAA and 1D-array dimensions.image_load, loaded bys_load_dwordx8through its SRT pointer atface * 32; with feat(agc): implement image tables loaded through 64-bit pointers #758 it throws the message above at pc 0x26c.EmitReadOpand wrapsEmitImage; they merge cleanly. refactor(recompiler): dispatch image atomics through ImageOpcodeInfoOf #1078, now onmain, moved image atomics ahead of theEmitImageswitch whoseImageReadcase this commit changes. feat(agc): implement 8 and 8_8 srgb image loads through unorm views #866's shader sRGB decode serves direct T#s only, so a table entry that needs it stays invalid (feat(agc): implement image and sampler tables indexed at runtime offsets #757) and faults when read. Thetools/pr_overlap.pyrows come from feat(agc): implement image and sampler tables indexed at runtime offsets #757 and feat(agc): implement image tables loaded through 64-bit pointers #758.Tested
mainb3fcd6d with feat(agc): implement image and sampler tables indexed at runtime offsets #757 and feat(agc): implement image tables loaded through 64-bit pointers #758: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 454/454 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_driver_image_table(GPU) matches tableimage_loads to direct ones (V# and pointer tables, Float/Uint/Sint, d16), reads per-wave keys on 32-lane subgroups, and checks null, invalid and EXEC-cleared entries;agc_shader_memoryplanskey * 16 + 8. Both throw without this commit; onmaintheir shaders fail to plan. They pass with-DANYPS5_ENABLE_SPIRV_TOOLS=ON.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)