VK_EXT_descriptor_buffer with swapchain images?

I’m trying to switch over to VK_EXT_descriptor_buffer to obviate the need for descriptor pools, but I seem to have hit a snag.

My GLSL has the following binding

layout (set = 0, binding = 0, rgba8) uniform image2D image_swapchain;

which is working for now with vkCmdBindDescriptorSets and VkImageView. The compute shader writes directly to the swapchain image with imageStore() just fine.

So, I’d like to switch over to descriptor buffers. To do that, I need to use vkCmdBindDescriptorBuffersEXT but that requires the resources to have a VkDeviceAddress to access. It wants buffers and not images. However, I don’t have a VkDeviceAddress since the swapchain image buffers are not allocated by me (the driver/OS controls those). All I have are various handles and I don’t seem to have a way to back those up into the VkDeviceAddress and size that I need.

And mixing and matching doesn’t seem to be allowed: See: Vulkan-Docs/proposals/VK_EXT_descriptor_buffer.adoc at main · KhronosGroup/Vulkan-Docs · GitHub

7.16. RESOLVED: Should applications be able to mix sets and buffers?

Originally the intention was to support this, but at least one vendor cannot support this natively.

What am I missing to make this all work?

Thanks.

I’m not very familiar with this extension, but my understanding of its purpose is that it allows regular device memory allocations to store descriptor sets, rather than more opaque options. This means that your program fills in the descriptors by writing directly to memory rather than using vkUpdateDescriptorSet.

For a given descriptor, you use vkGetDescriptorEXT with the descriptor’s data. This returns an opaque binary blob that you copy directly into the location in the buffer for that descriptor. I don’t see anything here which prevents you from just putting a swapchain image in the VkDescriptorImageInfo that you provide to vkGetDescriptorEXT.

vkCmdBindDescriptorBuffersEXT uses a device address, but only for the buffer containing the descriptor sets. Not the contents of those descriptor sets.

Thanks. I’ll take a longer look at this in more detail later.

I’m probably going to put this down for a while, though. Unfortunately, this extension doesn’t seem to be supported very well on Intel hardware on Linux. Which is ironic as integrated GPUs with shared memory should be able to do this much easier than a discrete card with separate memory.