Repository navigation
recomp: memory window from the full 64-bit address (carry out of the low dword) - #123
Conversation
…low dword) With several memory windows, smem, MUBUF (load / store / atomic / d16) and FLAT / global (plain and atomic) picked the window from the high dword of the base before the offsets were added. An offset that carried out of the low dword (or a negative global offset that borrowed) read and wrote the base's window at the wrapped low address. image_bvh*_intersect_ray already did it right. window_at adds the low dword and the offsets in 64 bits and moves the window by the carry (V# stride · index in 64 bits too). With one window it emits nothing, so the single-window HLSL (and its DXIL cache) is unchanged. Test gpu_memory_window_carry: the base at 0xFFFF_F000 of window 0 and every access kind reaching window 1 through its offset.
|
This one had to come out again (merged with the batch, then reverted in 70f8dc4 – sorry for the noise, GitHub will show it as merged). With it, XDefiant crashes ~10 s in inside AMD's shader compiler: |
#105 item 3.
With more than one memory window, several access kinds picked the window from the base's high dword before the offsets were added:
s_load_*,s_buffer_load_*);If an offset carried out of the low dword, the access went to the base's window at the wrapped low address. A negative global offset that borrowed had the same problem.
image_bvh*_intersect_rayalready did this right.The new
window_atadds the low dword and the offsets in 64 bits and moves the window by the carry. The V#stride * indexproduct is 64-bit too, and the signed SMEM / global offsets are sign-extended. With one window it emits nothing, so the single-window HLSL and its DXIL cache are unchanged.gpu_memory_windows_above_4_gibstill checks that and still passes. With several windows thexcl_w =line now comes after the address computation instead of before it.Not changed: the GS vertex input (
xcl_vin) is still a 32-bit offset in window 0. It is XCL's own staging, not a title address.Test
gpu_memory_window_carry, run in a 2-window UMA arena: the base sits at0xFFFF_F000of window 0, and s_load, s_buffer_load, buffer load / store, global load with SADDR and a global atomic each reach window 1 through their offset. Without the change it fails (the s_load reads 0 from window 0). With it, it passes on a GTX 1650 under Wine, and so do the other lib tests that run there. I did not test the borrow case: in this arena, window 0 maps only its first MiB, so a borrow has nothing valid to land on.