Skip to content

Validtion error in lesson 03.03.01 Command buffers #436

Description

@peekagrub

Following the tutorial there is an validation error from using vkCmdPipelineBarrier2() without enabling the extension. This function was introduced for placing a barrier for transitioning the image layout of the framebuffer.
This function requires an extension to use but the tutorial doesn't mention this being required and the linked C++ code also doesn't update either the isDeviceSuitable() or createLogicalDevice() functions to reflect this new required extension.
The C++ code in the next chapter does have isDeviceSuitable() and createLogicalDevice() functions to enable this feature by checking and setting VkPhysicalDeviceVulkan13Features.synchronization2.

bool supportsRequiredFeatures = features.template get<vk::PhysicalDeviceVulkan11Features>().shaderDrawParameters &&
                                features.template get<vk::PhysicalDeviceVulkan13Features>().dynamicRendering &&
                                features.template get<vk::PhysicalDeviceVulkan13Features>().synchronization2 &&
                                features.template get<vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>().extendedDynamicState;
// query for Vulkan 1.3 features
vk::StructureChain<vk::PhysicalDeviceFeatures2,
                   vk::PhysicalDeviceVulkan11Features,
                   vk::PhysicalDeviceVulkan13Features,
                   vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT>
    featureChain = {
        {},                                                          // vk::PhysicalDeviceFeatures2
        {.shaderDrawParameters = true},                              // vk::PhysicalDeviceVulkan11Features
        {.synchronization2 = true, .dynamicRendering = true},        // vk::PhysicalDeviceVulkan13Features
        {.extendedDynamicState = true}                               // vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT
    };

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions