shader: ds_min/max/add_src2_f32 throw for a reason that no longer holds #14089
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-31T18:36:42Z.
What happens
ds_min_src2_f32,ds_max_src2_f32andds_add_src2_f32throw at translation with:(
core/shader/recompiler/Translation/src/MemoryInstructions/MemoryInstructionDispatch.cpp:374, added inbe3bd9fbd7on 10-08). That reason no longer holds. Since731575c802(10-14) the LDS float atomics model the f32 denormal field:TranslationContext::dsAtomicsetsflushDenormalsandflushDenormalResults(SharedMemoryInstructions.cpp:35-36);EmitSharedAtomicFAdd32and the min/max emitters read them;docs/dev/debt/shader.md(the LDS float atomics entry).The integer src2 forms already go through
TranslationContext::dsSrc2(SharedMemoryInstructions.cpp:199), which readsDS[B]and updatesDS[A]with the matching 32-bit atomic.Proposal
Route the three f32 src2 opcodes through
dsSrc2withSharedAtomicFMin32,SharedAtomicFMax32andSharedAtomicFAdd32, after makingdsSrc2set the same two flush fields asdsAtomic. Add translation tests in the existing DS src2 suite. The 64-bit, GDS andoffset1[7]forms would keep throwing, as documented.Question for maintainers
The src2 opcodes exist only on GFX10.1, and the oracle hardware (RDNA2) has none. The behaviour would be inferred from the non-src2
ds_min/max/add_f32measured on gfx1035, which is how the integer src2 forms were done. Is that acceptable for the f32 forms, or should they keep throwing until someone measures a GFX10.1 part? Note thatshader.md's DS src2 entry gives the obsolete reason today; #14085 rewords it to "not measured".AI-assisted: yes (Claude Code)