cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

realhet
Miniboss

64bit flat memory address -> buffer_load

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!

0 Likes
1 Reply
realhet
Miniboss

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

0 Likes