Does synchronization2 have to be enabled explicitly?

hey folks

it is my understanding that synchronization2 is part of core vulkan 1.3 and does not have to be explicitly enabled anywhere. however, attempting to call any of its functions emits validation errors like the following:

VUID-vkCmdPipelineBarrier2-synchronization2-03848(ERROR / SPEC): msgNum: 168166404 - Validation Error: [ VUID-vkCmdPipelineBarrier2-synchronization2-03848 ] Object 0: handle = 0x5eb05a9a9510, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xa060404 | vkCmdPipelineBarrier2():  the synchronization2 feature was not enabled. The Vulkan spec states: The synchronization2 feature must be enabled (<link redacted because otherwise I can't post>)

what is a “feature”? is that another name for device extensions? does it have to be explicitly enabled? do I have to use the functions/structs that end in 2KHR instead of 2?

vkguide . dev seems to imply that you don’t have to enable anything of the sort.

I am fairly new to vulkan so I would be very grateful for any clarification or advice.

cheers
ashley

Are you telling Vulkan that you intend to use version 1.3 by passing the appropriate value in VkApplicationInfo.apiVersion?

Are you telling Vulkan that you intend to use version 1.3 by passing the appropriate value in VkApplicationInfo.apiVersion?

yes!

after reading a bit of the vulkan spec I have now found that vulkan 1.2 and 1.3 features have to be explicitly enabled during device creation. due to a design oversight the ad-hoc mechanism to do this is quite involved and confusing. I would love to post links to relevant info but it won’t let me (presumably as a spam prevention measure?)

vkguide . dev kinda hides it a bit with the vkbuilder thing, which is why I had missed it in the first place. here is a snippet that demonstrates how to populate the relevant fields of a device info struct:

VkPhysicalDeviceFeatures features = {};
VkPhysicalDeviceVulkan13Features features13 = {};
features13.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES;
// set the desired features here:
features13.dynamicRendering = VK_TRUE;
features13.synchronization2 = VK_TRUE;

VkPhysicalDeviceFeatures2 features2 = {};
features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
features2.pNext = &features13;
features2.features = features;

VkDeviceCreateInfo create_info = {};
create_info.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
create_info.pNext = &features2;
create_info.pEnabledFeatures = NULL;
[...]