KhronosGroup / Vulkan-Samples

One stop solution for all Vulkan samples
Apache License 2.0
4.36k stars 650 forks source link

Validation errors/crashes in samples since vkb::core::Buffer<bindingType> merge #1142

Closed SRSaunders closed 2 months ago

SRSaunders commented 3 months ago

Since commit 04291a3465397b2898a37bc9ccaf48dd4b552f9b, several examples show problems:

  1. _descriptormanagement throws validation errors on Windows, and crashes on macOS:
[debug] Building #447 buffer block ({ UniformBuffer })
[error] -1036144667 - VUID-VkDescriptorBufferInfo-offset-00340: Validation Error: [ VUID-VkDescriptorBufferInfo-offset-00340 ] Object 0: handle = 0x663ee3000000227d, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0xc23dafe5 | vkUpdateDescriptorSets(): pDescriptorWrites[0].pBufferInfo[0].offset (144) is greater than or equal to buffer size (144). The Vulkan spec states: offset must be less than the size of buffer (https://vulkan.lunarg.com/doc/view/1.3.283.0/windows/1.3-extensions/vkspec.html#VUID-VkDescriptorBufferInfo-offset-00340)
  1. _constantdata using the Single Pre-allocated Buffer Array setting throws validations errors on Windows, and flickers/performs badly on macOS:
[debug] Building #39 cache object (class vkb::DescriptorSet)
[error] -371195848 - VUID-VkDescriptorBufferInfo-range-00342: Validation Error: [ VUID-VkDescriptorBufferInfo-range-00342 ] Object 0: handle = 0x749e6a00000062ad, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0xe9e00038 | vkUpdateDescriptorSets(): pDescriptorWrites[0].pBufferInfo[0].range (475136) is larger than buffer size (524288) + offset (475136). The Vulkan spec states: If range is not equal to VK_WHOLE_SIZE, range must be less than or equal to the size of buffer minus offset (https://vulkan.lunarg.com/doc/view/1.3.283.0/windows/1.3-extensions/vkspec.html#VUID-VkDescriptorBufferInfo-range-00342)
SaschaWillems commented 3 months ago

Can you add what GPU/driver you are using?

I did a batch run before reviewing that PR and while I saw one sample with a validation error, it was not related to that PR.

SRSaunders commented 2 months ago

@SaschaWillems I am using an AMD 6600XT GPU with Vulkan SDK 1.3.283.0 on Windows, 1.3.290.0 on macOS.

@asuessenbach that fixes it on both platforms. Altough I don't think it was #1104 that broke it, since that PR did not touch buffer_pool.h. No matter since it's fixed now. Thank you very much.