Skip to content

Add and use address helpers

Faith Ekstrand requested to merge gfxstrand/mesa:nvk/buffer-address into nouveau/vk

If we aren't religious about using address helpers like these, we're going to have a nightmare of missing offsets here and there. It's fine once you have an address to add to it as needed but getting the base address needs to be as automated as possible. For images, there's only the base address. For buffers, they always come as a buffer+offset pair so the helper takes both and does the sum for you. Along with giving us some protection from bugs, these helpers also make it trivial to support bindless one day because we can handle all the bindless vs. bindful differences in the helper and the rest of the driver code can remain blissfully unaware.

If, some day in the future, we decide we actually need BO+offset pairs, we can steal anv_address and use that instead. I really don't think we need it, though. This should be enough.

Edited by Faith Ekstrand

Merge request reports