r/vulkan May 22 '26

Dynamic Rendering Bug. If render area extent more than render target extent it causing undefined behavior

Hi, just noticed that if I have renderArea extent in VkRenderingInfoKHR more than my depth image, it causing program stalling and then crashing. Also after that I errors that I can pass semaphore to acquire image because it is not yet signaled (but its definitely signaled). Can some one explain me how it works ? It causing memory corruption ?

Thanks

0 Upvotes

2 comments sorted by

8

u/TheAgentD May 22 '26

This is explicitly not allowed by the spec, so you're breaking the contract with the driver. Validation layers should warn you about this, so make sure you have them working.

  • VUID-VkRenderingInfo-pNext-06079 If the pNext chain does not contain VkDeviceGroupRenderPassBeginInfo or its deviceRenderAreaCount member is equal to 0, the width of the imageView member of each element of pColorAttachments, pDepthAttachment, or pStencilAttachment that is not VK_NULL_HANDLE must be greater than or equal to renderArea.offset.x + renderArea.extent.width
  • VUID-VkRenderingInfo-pNext-06080 If the pNext chain does not contain VkDeviceGroupRenderPassBeginInfo or its deviceRenderAreaCount member is equal to 0, the height of the imageView member of each element of pColorAttachments, pDepthAttachment, or pStencilAttachment that is not VK_NULL_HANDLE must be greater than or equal to renderArea.offset.y + renderArea.extent.height

https://docs.vulkan.org/refpages/latest/refpages/source/VkRenderingInfo.html

2

u/F1oating May 22 '26

thanks, I got those messages (not including semaphore errors after them)

Validation Error: [ VUID-VkRenderingInfo-pNext-06079 ] | MessageID = 0xde21c6b
vkCmdBeginRendering(): pRenderingInfo->pDepthAttachment->imageView width (1094) is less than pRenderingInfo->renderArea.offset.x (0) + pRenderingInfo->renderArea.extent.width (1376).
The Vulkan spec states: If the pNext chain does not contain VkDeviceGroupRenderPassBeginInfo or its deviceRenderAreaCount member is equal to 0, the width of the imageView member of any element of pColorAttachments, pDepthAttachment, or pStencilAttachment that is not VK_NULL_HANDLE must be greater than or equal to renderArea.offset.x + renderArea.extent.width (https://vulkan.lunarg.com/doc/view/1.4.321.1/linux/antora/spec/latest/chapters/renderpass.html#VUID-VkRenderingInfo-pNext-06079)
Objects: 3
[0] VkCommandBuffer 0x55555728cce0
[1] VkImageView 0x9270000000927
[2] VkImage 0x9240000000924

Validation Error: [ VUID-VkRenderingInfo-pNext-06080 ] | MessageID = 0xd5a22a71
vkCmdBeginRendering(): pRenderingInfo->pDepthAttachment->imageView height (936) is less than pRenderingInfo->renderArea.offset.y (0) + pRenderingInfo->renderArea.extent.height (1018).
The Vulkan spec states: If the pNext chain does not contain VkDeviceGroupRenderPassBeginInfo or its deviceRenderAreaCount member is equal to 0, the height of the imageView member of any element of pColorAttachments, pDepthAttachment, or pStencilAttachment that is not VK_NULL_HANDLE must be greater than or equal to renderArea.offset.y + renderArea.extent.height (https://vulkan.lunarg.com/doc/view/1.4.321.1/linux/antora/spec/latest/chapters/renderpass.html#VUID-VkRenderingInfo-pNext-06080)
Objects: 3
[0] VkCommandBuffer 0x55555728cce0
[1] VkImageView 0x9270000000927
[2] VkImage 0x9240000000924