Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions en/13_Vulkan_Profiles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ Instead of manually checking for features and extensions, you can define your pr

[,c++]
----
// Define the Best Practices profile
const VpProfileProperties bestPracticesProfile = {
VP_BEST_PRACTICES_PROFILE_NAME,
VP_BEST_PRACTICES_PROFILE_SPEC_VERSION
// Define the profile we want to use
const VpProfileProperties profile = {
VP_KHR_ROADMAP_2022_NAME,
VP_KHR_ROADMAP_2022_SPEC_VERSION
};

// Check if the profile is supported
VkBool32 supported = false;
vpGetPhysicalDeviceProfileSupport(instance, physicalDevice, &bestPracticesProfile, &supported);
vpGetPhysicalDeviceProfileSupport(instance, physicalDevice, &profile, &supported);

if (!supported) {
throw std::runtime_error("Best Practices profile is not supported on this device");
throw std::runtime_error("Roadmap 2022 profile is not supported on this device");
}
----

Expand Down Expand Up @@ -256,18 +256,18 @@ With profiles, all of that complexity is reduced to:
[,c++]
----
// Define the profile
const VpProfileProperties bestPracticesProfile = {
VP_BEST_PRACTICES_PROFILE_NAME,
VP_BEST_PRACTICES_PROFILE_SPEC_VERSION
const VpProfileProperties profile = {
VP_KHR_ROADMAP_2022_NAME,
VP_KHR_ROADMAP_2022_SPEC_VERSION
};

// Check if the profile is supported
VkBool32 supported = false;
vpGetPhysicalDeviceProfileSupport(instance, physicalDevice, &bestPracticesProfile, &supported);
vpGetPhysicalDeviceProfileSupport(instance, physicalDevice, &profile, &supported);

if (supported) {
// Create device with the profile - all features enabled automatically
vpCreateDevice(physicalDevice, &deviceCreateInfo, &bestPracticesProfile, nullptr, &device);
vpCreateDevice(physicalDevice, &deviceCreateInfo, &profile, nullptr, &device);

// Now we can use any feature guaranteed by the profile without checks
// For example, dynamic rendering is always available:
Expand Down
Loading