Skip to content

Improved VK_EXT_descriptor_heap align limits - #2787

Open
mematthias wants to merge 1 commit into
KhronosGroup:mainfrom
mematthias:improved_descriptor_heap_align_limits
Open

Improved VK_EXT_descriptor_heap align limits#2787
mematthias wants to merge 1 commit into
KhronosGroup:mainfrom
mematthias:improved_descriptor_heap_align_limits

Conversation

@mematthias

Copy link
Copy Markdown
Contributor

The alignment limits must be less than or equal to the corresponding maximum size limits.
This is now represented by min.

@oddhack

oddhack commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Could you identify the spec language behind your comment "The alignment limits must be less than or equal to the corresponding maximum size limits."? We weren't able to resolve this in real time on the teleconference today and people are not sure about this change.

@spencer-lunarg

Copy link
Copy Markdown

@mematthias for context, it is allowed for drivers to have a bufferDescriptorSize of 24 but have an alignment of 32 (and those 8 bytes can contain extra stuff)

It is already invalid in the spec to have that flipped, where the alignment is less than the size

@mematthias

Copy link
Copy Markdown
Contributor Author

The fields of VkPhysicalDeviceDescriptorHeapPropertiesEXT specify the constraints:

  • samplerDescriptorSize specifies the size of descriptors returned by vkWriteSamplerDescriptorsEXT. Must be a power-of-two value.
  • imageDescriptorSize specifies the maximum size of descriptors for an image or texel buffer written by vkWriteResourceDescriptorsEXT. Must be a power-of-two value.
  • bufferDescriptorSize specifies the maximum size of descriptors for an address range written by vkWriteResourceDescriptorsEXT. Must be a power-of-two value.
  • samplerDescriptorAlignment indicates the required alignment of sampler descriptors within a sampler heap. It must be a power-of-two value, and less than or equal to samplerDescriptorSize.
  • imageDescriptorAlignment indicates the required alignment of image and texel buffer descriptors within a resource heap. It must be a power-of-two value, and less than or equal to imageDescriptorSize.
  • bufferDescriptorAlignment indicates the required alignment of unformatted buffers and acceleration structure descriptors within a resource heap. It must be a power-of-two value, and less than or equal to bufferDescriptorSize.

@spencer-lunarg According to the constraints, bufferDescriptorSize cannot be 24 bytes because it is not a power-of-two.

If the alignment value is allowed to be greater than the size value, the description must be changed accordingly.

@spencer-lunarg

Copy link
Copy Markdown

@spencer-lunarg According to the constraints, bufferDescriptorSize cannot be 24 bytes because it is not a power-of-two.

Sorry, you are right, but the "precise" size from vkGetPhysicalDeviceDescriptorSizeEXT could be 24

@spencer-lunarg

Copy link
Copy Markdown

@HansKristian-Work I think i messed this up from what you said on the call, the spec does say bufferDescriptorAlignment must be less than or equal to bufferDescriptorSize.

@mematthias

Copy link
Copy Markdown
Contributor Author

Given the constraints, it could even be shortened further; so that it is no longer min(<N>, size), but simply size.

@HansKristian-Work

Copy link
Copy Markdown
Contributor

Right, it's the individual descriptor types as queried by GetDescriptorSizeEXT that can return "odd" sizes ... Missed the requirement that bufferDescriptorSize and friends had to be POT. The PR LGTM after more spec review.

@HansKristian-Work

Copy link
Copy Markdown
Contributor

Given the constraints, it could even be shortened further; so that it is no longer min(, size), but simply size.

I think the min makes sense since it makes the spec constraint clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants