[BUG] Vulkan samples GPU hang (quick window resize)

Started by Dorian, February 22, 2023, 03:05:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dorian

Hi,

There seems to be a problem in CapsViewer demos, when you grab window by frame and quickly make it smaller/larger.

GPU Caps View Version 1.58.0.1
Gfx: Intel Arc A770

It looks like demos can render outside of render area/framebuffer, which is forbidden by Vulkan spec:
"The application must ensure (using scissor if necessary) that all rendering is contained within the render area"


Thread 0, Frame 930, Time 6641697 us:vkCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer) returns VkResult VK_SUCCESS (0):
  device:                         VkDevice = 0AED13A8
  pCreateInfo:                    const VkFramebufferCreateInfo* = 0D34F678:
    sType:                          VkStructureType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO (37)
pNext:                          const void* = NULL
flags:                          VkFramebufferCreateFlags = 0
renderPass:                     VkRenderPass = 243628976
attachmentCount:                uint32_t = 2
pAttachments:                   const VkImageView* = 0D34F6A8
    pAttachments[0]:                const VkImageView = 248417432
pAttachments[1]:                const VkImageView = 242692664
width:                          uint32_t = 663
height:                         uint32_t = 1
layers:                         uint32_t = 1
pAllocator:                     const VkAllocationCallbacks* = NULL
pFramebuffer:                   VkFramebuffer* = 180012888

(...)

Thread 0, Frame 930, Time 6645368 us:vkCmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports) returns void:
    commandBuffer:                  VkCommandBuffer = 0E897670   
    firstViewport:                  uint32_t = 0
    viewportCount:                  uint32_t = 1
    pViewports:                     const VkViewport* = 0D34F3F0
    pViewports[0]:                  const VkViewport = 0D34F3F0:
        x:                              float = 0
        y:                              float = 0
        width:                          float = 924   
        height:                         float = 511   
        minDepth:                       float = 0   
        maxDepth:                       float = 1

Thread 0, Frame 930, Time 6646653 us:vkCmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors) returns void:
    commandBuffer:                  VkCommandBuffer = 0E897670
    firstScissor:                   uint32_t = 0
    scissorCount:                   uint32_t = 1
    pScissors:                      const VkRect2D* = 0D34F408
        pScissors[0]:                   const VkRect2D = 0D34F408:
            offset:                         VkOffset2D = 0D34F408:
                x:                              int32_t = 0
                y:                              int32_t = 0
            extent:                         VkExtent2D = 0D34F410:
                width:                          uint32_t = 924
                height:                         uint32_t = 511

Scissors/viewport should be adjusted in time to match frameBuffer/attachment size.


JeGX

Could you do the following test?

Download the latest GeeXLab 0.51
https://www.geeks3d.com/dl/show/500

Download the Vulkan demopack:
https://www.geeks3d.com/dl/show/50102

and load into GeeXLab this demo:
geexlab-demopack-vulkan/vk2/02-triangle/v1-validation/main.xml

Let me know.

Dorian

Did a test today and I saw no issues with that triangle window.
Jiggled it couple minutes and it works fine.

Thanks,
Please let me know once fix hits caps viewer demos.

JeGX

I released GPU Caps Viewer 1.59
https://www.geeks3d.com/20230412/gpu-caps-viewer-1-59-released/

and I removed all Vulkan demos that were based on the Vulkan1 plugin. Now all Vulkan demos use the Vulkan2 plugin and should work correctly.

Dorian

Unfortunately issue is still there in caps viewer 1.59.

I tested "Vulkan - Phong Lighting Donut" demo and it shows smaller framebuffer and larger viewport and scissor region.

Thread 0, Frame 3172, Time 7594384 us:
vkCreateFramebuffer(device, pCreateInfo, pAllocator, pFramebuffer) returns VkResult VK_SUCCESS (0):
    device:                VkDevice = 1087EA78
    pCreateInfo: const VkFramebufferCreateInfo* = 1062F578:
        sType:          VkStructureType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO (37)
        pNext:              const void* = NULL
        flags:  VkFramebufferCreateFlags = 0
        renderPass:        VkRenderPass = 278432032
        attachmentCount:        uint32_t = 2
        pAttachments: const VkImageView* = 1062F5A8
            pAttachments[0]: const VkImageView = 278424552
            pAttachments[1]: const VkImageView = 285286416
        width:                  uint32_t = 120
        height:                uint32_t = 11
        layers:                uint32_t = 1
    pAllocator: const VkAllocationCallbacks* = NULL
    pFramebuffer:    VkFramebuffer* = 112212952
(...)

Thread 0, Frame 3172, Time 7595295 us:
vkCmdBeginRenderPass(commandBuffer, pRenderPassBegin, contents) returns void:
    commandBuffer:  VkCommandBuffer = 10C7E3A0
    pRenderPassBegin: const VkRenderPassBeginInfo* = 1062F308:
        sType:          VkStructureType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO (43)
        pNext:              const void* = NULL
        renderPass:        VkRenderPass = 278432032
        framebuffer:      VkFramebuffer = 112212952
        renderArea:            VkRect2D = 1062F320:
            offset:              VkOffset2D = 1062F320:
                x:                      int32_t = 0
                y:                      int32_t = 0
            extent:              VkExtent2D = 1062F328:
                width:                  uint32_t = 120
                height:                uint32_t = 11
        clearValueCount:        uint32_t = 2
        pClearValues: const VkClearValue* = 070AF298
            pClearValues[0]: const VkClearValue = 070AF298 (Union):
                color:        VkClearColorValue = 070AF298 (Union):
                    float32:                float[4] = 070AF298
                        float32[0]:                float = 0.4
                        float32[1]:                float = 0.15
                        float32[2]:                float = 0.1
                        float32[3]:                float = 1
                    int32:                int32_t[4] = 070AF298
                        int32[0]:                int32_t = 1053609165
                        int32[1]:                int32_t = 1041865114
                        int32[2]:                int32_t = 1036831949
                        int32[3]:                int32_t = 1065353216
                    uint32:              uint32_t[4] = 070AF298
                        uint32[0]:              uint32_t = 1053609165
                        uint32[1]:              uint32_t = 1041865114
                        uint32[2]:              uint32_t = 1036831949
                        uint32[3]:              uint32_t = 1065353216
                depthStencil: VkClearDepthStencilValue = 070AF298:
                    depth:                    float = 0.4
                    stencil:                uint32_t = 1041865114
            pClearValues[1]: const VkClearValue = 070AF2A8 (Union):
                color:        VkClearColorValue = 070AF2A8 (Union):
                    float32:                float[4] = 070AF2A8
                        float32[0]:                float = 1
                        float32[1]:                float = 0
                        float32[2]:                float = 0
                        float32[3]:                float = 0
                    int32:                int32_t[4] = 070AF2A8
                        int32[0]:                int32_t = 1065353216
                        int32[1]:                int32_t = 0
                        int32[2]:                int32_t = 0
                        int32[3]:                int32_t = 0
                    uint32:              uint32_t[4] = 070AF2A8
                        uint32[0]:              uint32_t = 1065353216
                        uint32[1]:              uint32_t = 0
                        uint32[2]:              uint32_t = 0
                        uint32[3]:              uint32_t = 0
                depthStencil: VkClearDepthStencilValue = 070AF2A8:
                    depth:                    float = 1
                    stencil:                uint32_t = 0
    contents:      VkSubpassContents = VK_SUBPASS_CONTENTS_INLINE (0)

Thread 0, Frame 3172, Time 7595389 us:
vkCmdSetViewport(commandBuffer, firstViewport, viewportCount, pViewports) returns void:
    commandBuffer:  VkCommandBuffer = 10C7E3A0
    firstViewport:          uint32_t = 0
    viewportCount:          uint32_t = 1
    pViewports:    const VkViewport* = 1062F2E0
        pViewports[0]:  const VkViewport = 1062F2E0:
            x:                        float = 0
            y:                        float = 0
            width:                    float = 1280
            height:                    float = 740
            minDepth:                  float = 0
            maxDepth:                  float = 1
 
Thread 0, Frame 3172, Time 7595409 us:
vkCmdSetScissor(commandBuffer, firstScissor, scissorCount, pScissors) returns void:
    commandBuffer:  VkCommandBuffer = 10C7E3A0
    firstScissor:          uint32_t = 0
    scissorCount:          uint32_t = 1
    pScissors:      const VkRect2D* = 1062F2F8
        pScissors[0]:    const VkRect2D = 1062F2F8:
            offset:              VkOffset2D = 1062F2F8:
                x:                      int32_t = 0
                y:                      int32_t = 0
            extent:              VkExtent2D = 1062F300:
                width:                  uint32_t = 1280
                height:                uint32_t = 740