Noxagonal / Vulkan-API-Tutorials

Sources for my YouTube Vulkan tutorials
Creative Commons Zero v1.0 Universal
122 stars 12 forks source link

Cannot call vkCmdSetViewport() #24

Open GarethH96 opened 6 years ago

GarethH96 commented 6 years ago

On tutorial 4, when setting up the viewport I get this error: VKDBG: ERROR: @[DS]: Cannot call vkCmdSetViewport() on a command buffer allocated from a pool without VK_QUEUE_GRAPHICS_BIT capabilities. The spec valid usage text states 'The VkCommandPool that commandBuffer was allocated from must support graphics operations' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdSetViewport-commandBuffer-cmdpool). GPU: AMD RX 480 8GB, OS: GNU/Linux Antergos, Driver: Mesa 17.3.3-2.

Noxagonal commented 6 years ago

I can't immediately see what could cause this. See what values does the queueFamilyIndex get. pool_create_info.queueFamilyIndex = r._graphics_family_index; Then see in the Renderer.cpp lines

bool found = false;
for( uint32_t i=0; i < family_count; ++i ) {
    if( family_property_list[ i ].queueFlags & VK_QUEUE_GRAPHICS_BIT ) {
        found = true;
        _graphics_family_index = i;
    }
}

See what value does the _graphics_family_index have. compare it to the family_property_list flags with the same index. If you're sure that the queueFlags contains the VK_QUEUE_GRAPHICS_BIT then I think it's the validation layer bug.

hodasemi commented 6 years ago

Hi GarethH96, I'm also an Radv user. You might be interested in this article: https://www.phoronix.com/scan.php?page=news_item&px=Mesa-17.3-Remains-Buggy

Noxagonal commented 6 years ago

@hodasemi That's interesting. @GarethH96 Can you test this with AMD closed drivers to verify it's a problem with Mesa?

hodasemi commented 6 years ago

I'm also using Mesa (17.3.5 by now) and Archlinux. Tutorial 4 doesn't make any problems on my side (RX 470).