1 Reply Latest reply on Jul 5, 2018 11:39 AM by realhet

    64bit flat memory address -> buffer_load

    realhet

      Hi,

       

      I have a 64bit address, and it works well when I'm using flat_load_dword instructions.

      However I would like to use the advanced address calculation goodies of the old buffer_load_instruction.

       

      My question is that is there a way to create the 128bit resource constant from a 64 bit flat address?

       

      I did a constant with base=0, limit=2**32-1. I have a large 1GB buffer already that works with flat_*** stuff. But I was unable to access it with buffer_**** when I peeked it at 256MB locations. I always get 0 as an out of range behaviour.

       

      Thanks in advance!

        • Re: 64bit flat memory address -> buffer_load
          realhet

          Ok, I got it: I've forgot to set the swizzle options on the last dword of the resource dqword. Somehow I thought, a simple 0 will do it, but not.

           

          So if anybody run into this: this is a working resource descriptor that points to address 0:

                  s_movk_i32 s0, 0                 //address_lo 0       

                  s_movk_i32 s1, 0                 //address_hi 0, stride 0

                  s_movk_i32 s2, -1               //no limit        

                  s_mov_b32 s3, 0x8027fac  //set the swizzle format to no swizzle