#Error when calling `vkCmdSetDescriptorBufferOffsetsEXT`

6 messages · Page 1 of 1 (latest)

stark latch
#

I'm implementing bindless texturing and I'm trying to use vkCmdSetDescriptorBufferOffsetsEXT, however, when I call it I get this validation error:

Validation Error: [ VUID-vkCmdSetDescriptorBufferOffsetsEXT-firstSet-09006 ] Object 0: handle = 0x2c0c7e60140, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x95a125000000001a, type = VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT; Object 2: handle = 0xcb1c7c000000001b, type = VK_OBJECT_TYPE_PIPELINE_LAYOUT; | MessageID = 0xd70666b1 | vkCmdSetDescriptorBufferOffsetsEXT(): Descriptor set layout (VkDescriptorSetLayout 0x95a125000000001a[]) for set 0 was created without VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT flag set The Vulkan spec states: The VkDescriptorSetLayout for each set from firstSet to firstSet + setCount when layout was created must have been created with the VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT bit set

but I have that bit set when I create the descriptor set layout:

VkDescriptorSetLayoutBinding set_layout_binding{
    .binding = 0,
    .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
    .descriptorCount = nDescriptors,
    .stageFlags = VK_SHADER_STAGE_ALL,
    .pImmutableSamplers = VK_NULL_HANDLE,
};
VkDescriptorSetLayoutCreateInfo descriptor_layout_create_info{
    .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
    .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT,
    .bindingCount = 1,
    .pBindings = &set_layout_binding
}; 
        
VK_CHECK(vkCreateDescriptorSetLayout(device, &descriptor_layout_create_info, nullptr, &globalDescriptorSetLayout));

How can I resolve this issue?

elder flicker
#

Are you using the descriptor layout you think you are using?
Have you actually enabled the required extensions, or are there any other warnings before this one?

stark latch
#

I'm doing this to put the descriptor in the buffer:

VkDescriptorImageInfo imginfo{
    .sampler = VK_NULL_HANDLE,
    .imageView = vkImageView,
    .imageLayout = nativeFormat,
};
VkDescriptorGetInfoEXT image_descriptor_info{
    .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT,
    .type = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
    .data = {
        .pSampledImage = &imginfo
    }
};
owningDevice->rgl_vkGetDescriptorEXT(owningDevice->device, &image_descriptor_info, owningDevice->bufferProperties.sampledImageDescriptorSize, owningDevice->GetDescriptorPointerForIndex(globalDescriptorIndex));
elder flicker
#

I'm confused what you're saying, are you binding the correct pipeline layout or not?

stark latch
#

I was binding the correct pipeline, but I didn't set the flag for the layout on the pipeline