Repository navigation
feat(shader): implement buffer_atomic_inc/dec and the 64-bit integer buffer atomics - #321
Merged
Merged
Conversation
Progress report (2cf901b → ae36aaf)📈 GPU shader instructions: 81.22% (+0.95%, +11 implemented instructions) ✅ 11 implemented
|
This was referenced Oct 2, 2026
Merged
Merged
9 tasks done
This was referenced Oct 2, 2026
adriadam10
force-pushed
the
feat/buffer-atomics
branch
from
October 3, 2026 09:44
f074308 to
cd9e629
Compare
Collaborator
…buffer atomics
buffer_atomic_inc, buffer_atomic_dec, buffer_atomic_cmpswap_x2 and
buffer_atomic_{add,sub,smin,umin,smax,umax,and,xor}_x2 threw in the decoder.
The 64-bit ones use native 64-bit SPIR-V atomics like the existing
swap_x2/or_x2; inc and dec wrap at the data operand through the existing
compare-exchange helpers.
Co-Authored-By: Claude <noreply@anthropic.com>
adriadam10
force-pushed
the
feat/buffer-atomics
branch
from
October 4, 2026 10:01
cd9e629 to
ae36aaf
Compare
Collaborator
Author
9 tasks done
9 tasks done
9 tasks done
Collaborator
|
Thanks for the rebase. The rebased commit has exactly the content I ran through my PPSA21564 check, and the full ctest passes here on current main. Ready to merge. |
oneandonlydean
added a commit
to oneandonlydean/AnyPS5
that referenced
this pull request
Oct 5, 2026
Conflicts resolved: - libSceAudioPropagation/Export.cpp: upstream's boykopovar#482 + boykopovar#489 version taken; it is the same no-propagation model as astrobot's stand-in, with SourceRender and the handle-only UnregisterMaterial already in it. - State.cpp (boykopovar#453): astrobot's resident depth model kept; it already skips the tests of an absent plane (boykopovar#453's test is on astrobot since e087a4f). - Graphics.cpp, State.hpp, ShaderResources.cpp: astrobot's DepthTarget model kept (exportIndex, no DepthSurface.hpp), upstream's ThreadOwned include added. - BdaResources.cpp: astrobot's form with boykopovar#390's message. - VulkanDevice.cpp, Context.hpp, PacketExecution.cpp: both sides kept (calibrated timestamps, host query reset, GDS, memory budget; pipeline stats). - Spirv: astrobot's split-wave rules first, then boykopovar#608's wave-mask ballot and boykopovar#587's host subgroup lane; astrobot's function LDS sizing and boykopovar#573's LDS lock both kept; conditionalDepth kept in the atomic update loops; upstream's buffer atomics (boykopovar#321 boykopovar#332 boykopovar#594) and 64-bit LDS atomics taken. - TechnicalDebt.md: both sides, duplicate lines dropped. Build fixes folded in: the upstream boykopovar#453 test block duplicated next to astrobot's adapted copy removed; a lost closing brace after the host query reset block restored; lookupLog() is a function since boykopovar#590; the duplicate MUTEX_TYPE_ADAPTIVE constant (astrobot's 93b2d0e equals boykopovar#156) removed; the ops boykopovar#596 drops removed from the masked-select list and the BDA test message updated (the gate-batch-2 integ commits 559e4fab6 and 2ec968fb5).
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
These threw "MUBUF opcode is not supported":
buffer_atomic_inc,buffer_atomic_decbuffer_atomic_cmpswap_x2buffer_atomic_{add,sub,smin,umin,smax,umax,and,xor}_x2The 64-bit ops get IR ops
BufferAtomic{IAdd,ISub,SMin,UMin,SMax,UMax,And,Xor,CmpSwap}64, which reuseBufferAtomic64, the native 64-bit SPIR-V atomic path thatswap_x2andor_x2already use.cmpswap_x2does anOpAtomicCompareExchangewithvdata[0:1]as the new value andvdata[2:3]as the comparator, like the 32-bitcmpswap.inc/dec(BufferAtomicInc32/Dec32) use the compare-exchange loop with the existingAtomicIncrement/AtomicDecrementhelpers (old >= data ? 0 : old + 1,old == 0 || old > data ? data : old - 1). Withglcevery op returns the old value, as before.Test
agc_driver_buffer_atomics: one wave32 shader. Each op runs on its own slot of the output buffer, set to a known value first. The test checks the memory afterwards and theglcreturn values ofinc,dec,add_x2andcmpswap_x2. Inputs are signed/unsigned 64-bit edges (0, -1, INT64_MIN/MAX), random values, small values for the inc/dec wrap, and matching/non-matching compare values forcmpswap_x2.Tested
Linux, full ctest (99) passes.
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)