KhronosGroup / KhronosGroup/Vulkan-Tutorial

Validtion error in lesson 03.03.01 Command buffers

Open
#436 0 comments 0 reactions 1 assignee Claimed by @SaschaWillems View on GitHub
Dominant language
C++
Stars
418
Forks
126
Avg merge
11d 6h
Merged PRs (30d)
31

Description

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](https://github.com/KhronosGroup/Vulkan-Tutorial/blob/main/en/03_Drawing_a_triangle/03_Drawing/01_Command_buffers.adoc#image-layout-transitions) 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`.
```cpp
bool supportsRequiredFeatures = features.template get().shaderDrawParameters &&
features.template get().dynamicRendering &&
features.template get().synchronization2 &&
features.template get().extendedDynamicState;
```
```cpp
// query for Vulkan 1.3 features
vk::StructureChain
featureChain = {
{}, // vk::PhysicalDeviceFeatures2
{.shaderDrawParameters = true}, // vk::PhysicalDeviceVulkan11Features
{.synchronization2 = true, .dynamicRendering = true}, // vk::PhysicalDeviceVulkan13Features
{.extendedDynamicState = true} // vk::PhysicalDeviceExtendedDynamicStateFeaturesEXT
};
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.