5

I really like the idea of device buffer address, and it seems like in the future it'll become more common, and is a required feature for ray-tracing. If I have a buffer/array of object draw information, usually I would bind it to a descriptor and index into it with maybe a push constant (or even better the first_instance argument to the draw call command). However instead of indexing into the descriptor buffer it would be versatile to use buffer device addresses passed in to reach exact object draw info struct you need.

I've always found descriptors fiddly, in this case is there any reason to use them over a device buffer address like this? I don't suppose there's a performance difference?

Zebrafish
  • 11,682
  • 3
  • 43
  • 119

1 Answers1

0

Strongly suspect there will be a performance difference, but it's likely to be hardware vendor specific so the only real answer is going to be to profile your workload on the implementations you care about.

The most visible difference is going to be the fact that shader code now has to handle pointer address computation for the physical buffer access, whereas before that is likely at least partially hidden in some fixed-function descriptor handling hardware.

solidpixel
  • 10,688
  • 1
  • 20
  • 33
  • Is there also the fact that the device address is a 64 bit integer and that GPUs generally don't do that natively? Or are very poor at doing it? – Zebrafish Apr 30 '22 at 10:10
  • It's a definitely possibility, but it's going to depend on the hardware vendor. – solidpixel Apr 30 '22 at 16:18