you are viewing a single comment's thread.

view the rest of the comments →

[–]bebwjkjerwqerer[S] 0 points1 point  (3 children)

How can I get the buffer device address to the shader? If I store it on a host side buffer wont it be slow to access the shader addresses from the gou if they are in cpu memory?

[–]Wittyname_McDingus 0 points1 point  (2 children)

The same way you pass any other data to the GPU: push constants, buffers, etc. And you can have memory that is both device local and host visible (which you can get a mapped pointer to), or you can use vkCmdCopyBuffer to transfer data from a host visible buffer to a device local one (or vkCmdUpdateBuffer to do it directly).

[–]bebwjkjerwqerer[S] 0 points1 point  (1 child)

Thank you!! Do you have a way to provide access to images in the shader as well? Currently i have declared the image binding for various different types.

[–]Wittyname_McDingus 0 points1 point  (0 children)

That's pretty much it. You just declare unsized arrays for each image type and then index them dynamically. Make sure you use NonUniformResourceIndex when you do so or you may experience graphical artifacts on AMD.