Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions host/vulkan/compositor_vk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,20 @@ void CompositorVk::setUpDescriptorSets() {
(kMaxLayersPerFrame * descriptorSetsPerLayer + kMaxImmediateDrawsPerFrame);
const uint32_t descriptorSetsTotal = descriptorSetsPerFrame * m_maxFramesInFlight;

// TODO(b/389646068): *2 should not be necessary for image samplers but
// some drivers are throwing VK_ERROR_OUT_OF_POOL_MEMORY errors.
// TODO(b/389646068): As per the note under
// https://docs.vulkan.org/refpages/latest/refpages/source/VkDescriptorPoolSize.html, the
// descriptorCount value here for use with combined image samplers must account for non-trivial
// descriptorCount consumption, otherwise some drivers are throwing VK_ERROR_OUT_OF_POOL_MEMORY.
// This information needs to be obtained from:
// VkSamplerYcbcrConversionImageFormatProperties::combinedImageSamplerDescriptorCount, or from
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have an internal change in review (ag/37589469) that checks exactly this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal ... arggh 😉

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming soon™ :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aruby-blackberry can you confirm if 7ffe384 addresses?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will give it a try today and report back, thank you!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmacnak This works, please merge into main. Thank you! 🙂

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#96 merged!

// VkPhysicalDeviceMaintenance6Properties::maxCombinedImageSamplerDescriptorCount.
// For now, use *3. A quick search in open-source drivers (i.e. upstream Mesa3D) reveals that
// the maximum value for this value is 3 across all drivers/platforms. This accounts for 3-plane
// YCbCr sampler formats in some drivers (i.e. Broadcom V3D).
const VkDescriptorPoolSize descriptorPoolSizes[2] = {
VkDescriptorPoolSize{
.type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
.descriptorCount = descriptorSetsTotal * 2,
.descriptorCount = descriptorSetsTotal * 3,
},
VkDescriptorPoolSize{
.type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
Expand Down
Loading