Skip to content

Commit dc65d0b

Browse files
committed
update Vulkan Profiles chapter with expanded details on profiles, updated links, and improved examples.
1 parent 2de266c commit dc65d0b

File tree

1 file changed

+46
-26
lines changed

1 file changed

+46
-26
lines changed

chapters/vulkan_profiles.adoc

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ifndef::images[:images: images/]
1010

1111
Vulkan Profiles is a mechanism that allows developers to target a specific set of features, extensions, and limits that are guaranteed to be supported by a range of Vulkan implementations. This is particularly useful for cross-platform development where you want to ensure your application works consistently across different devices.
1212

13-
For detailed information, refer to the link:https://docs.vulkan.org/spec/latest/appendices/profiles.html[Vulkan Profiles] section in the Vulkan Specification.
13+
For detailed information, refer to the link:https://vulkan.lunarg.com/doc/sdk/1.4.321.0/windows/profiles_api_library.html[Vulkan Profiles API Library] documentation on LunarG's website.
1414

1515
== What are Vulkan Profiles?
1616

@@ -21,7 +21,10 @@ A Vulkan Profile is a well-defined set of capabilities, (features, extensions, f
2121
* Reduce the need for complex capability checking and fallback code
2222
* Provide a clear target for both developers and hardware vendors
2323

24-
The Khronos Group maintains a set of official profiles, and vendors can also define their own profiles for their specific hardware.
24+
The Khronos Group maintains a set of official profiles, and vendors can also
25+
define their own profiles for their specific hardware. Additionally, Vulkan
26+
application developers can create profiles to specify engine code paths, like
27+
Unreal Engine does. Or libraries such as Zink can specify their Vulkan requirements for OpenGL to run, enabling hardware vendors to prioritize their driver development to support specific code paths on engines or libraries.
2528

2629
=== History and Purpose
2730

@@ -31,7 +34,7 @@ Vulkan Profiles were introduced to address the challenge of fragmentation in the
3134
* Managing fallback paths for devices with limited capabilities
3235
* Communicating requirements clearly to hardware vendors
3336

34-
Profiles solve these problems by providing a standardized way to define and reference sets of Vulkan capabilities. They serve as a contract between application developers and hardware vendors, ensuring that devices claiming support for a profile will provide all the capabilities defined in that profile.
37+
Profiles solve these problems by providing a convention to define and reference sets of Vulkan capabilities. They serve as a contract between application developers and hardware vendors, ensuring that devices claiming support for a profile will provide all the capabilities defined in that profile.
3538

3639
=== Relationship with Vulkan Versions
3740

@@ -40,24 +43,31 @@ Vulkan Profiles are complementary to Vulkan versions. While Vulkan versions (1.0
4043
For example:
4144

4245
* The Android Baseline 2022 profile requires Vulkan 1.1 core functionality
43-
* The Baseline 2022 profile for desktop platforms requires Vulkan 1.1 with specific extensions
46+
* The LunarG Desktop Baseline 2022 profile for desktop platforms requires Vulkan 1.1 with specific extensions
4447
* Future profiles may target newer Vulkan versions as they become more widely supported
4548

4649
This approach allows developers to target specific capability sets without being tied to a particular Vulkan version, providing more flexibility in application development.
4750

4851
== Official Profiles
4952

50-
The Khronos Group maintains several official profiles, which are defined in the link:https://github.com/KhronosGroup/Vulkan-Profiles/tree/main/profiles[Vulkan-Profiles repository]:
53+
The Khronos Group maintains several profiles, which are defined in the link:https://github.com/KhronosGroup/Vulkan-Profiles/tree/main/profiles[Vulkan-Profiles repository]. The only official profiles are the Khronos Roadmap profiles and the Android Baseline profile. The others are maintained by Google and LunarG:
5154

52-
* *Baseline 2022* - A baseline profile for desktop platforms (link:https://docs.vulkan.org/spec/latest/appendices/profiles.html#profile-VP_KHR_BASELINE_2022[Specification], link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/profiles/VP_KHR_BASELINE_2022.json[JSON Definition])
53-
* *Android Baseline 2022* - A baseline profile specifically for Android devices (link:https://docs.vulkan.org/spec/latest/appendices/profiles.html#profile-VP_ANDROID_BASELINE_2022[Specification], link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/profiles/VP_ANDROID_BASELINE_2022.json[JSON Definition])
54-
* *Roadmap 2022* - A forward-looking profile that hardware vendors are encouraged to support in future implementations (link:https://docs.vulkan.org/spec/latest/appendices/profiles.html#profile-VP_KHR_ROADMAP_2022[Specification], link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/profiles/VP_KHR_ROADMAP_2022.json[JSON Definition])
55+
* *LunarG Desktop Baseline 2022* - A baseline profile for desktop platforms
56+
(link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/profiles/VP_LUNARG_desktop_baseline_2022[JSON Definitions])
57+
* *Android Baseline 2022* - A baseline profile specifically for Android devices (link:https://vulkan.lunarg.com/doc/sdk/1.4.321.0/windows/profiles_api_library.html[Documentation], link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/profiles/VP_ANDROID_baseline_2022.json[JSON Definition])
58+
* *Roadmap 2022* - A forward-looking profile that hardware vendors are encouraged to support in future implementations (link:https://vulkan.lunarg.com/doc/sdk/1.4.321.0/windows/profiles_api_library.html[Documentation], link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/profiles/VP_KHR_roadmap_2022.json[JSON Definition])
5559

56-
These profiles are versioned by year to allow for evolution over time while maintaining backward compatibility. You can find sample code demonstrating the use of these profiles in the link:https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/api/profiles[Vulkan-Samples repository].
60+
These profiles are versioned by year to allow for evolution over time while maintaining backward compatibility. You can find sample code demonstrating the use of these profiles in the link:https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/tooling/profiles[Vulkan-Samples repository].
5761

58-
=== Baseline 2022 Profile Details
62+
=== LunarG Desktop Baseline 2022 Profile Details
5963

60-
The Baseline 2022 profile (`VP_KHR_BASELINE_2022`) is designed for desktop platforms and includes:
64+
The LunarG Desktop Baseline 2022 profile (`VP_LUNARG_DESKTOP_BASELINE_2022`) is designed for desktop platforms. It's described as "A profile generated by the intersection of a collection of GPUInfo.org device reports to support a large number of actual systems in the Vulkan ecosystem. This profile is meant to be a usage example for Vulkan application developers."
65+
66+
The real purpose of the LunarG Desktop Baseline profiles is to provide examples to Vulkan application developers to create profiles for their applications. It's important to note that these profiles have some limitations - for example, Windows ARM / Qualcomm GPUs are not supported because these GPUs were not released or just released when the profiles were generated.
67+
68+
If LunarG were to create a Desktop Baseline 2025 in the future, it would likely include Windows ARM / Qualcomm GPUs, which would make the Desktop Baseline 2025 both a subset and superset (likely Vulkan 1.3) of the Desktop Baseline 2024.
69+
70+
The profile includes:
6171

6272
* Core Vulkan 1.1 functionality
6373
* Key extensions such as:
@@ -116,7 +126,7 @@ There are two main ways to use Vulkan Profiles:
116126

117127
=== 1. Using the Vulkan Profiles header
118128

119-
The simplest way to use Vulkan Profiles is through the Vulkan Profiles header (`vulkan_profiles.hpp`), which is available in the link:https://vulkan.lunarg.com/sdk/home[Vulkan SDK]. This header provides a C++ API that simplifies working with profiles. The header is documented in the link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/library/README.md[Vulkan-Profiles library documentation]:
129+
The simplest way to use Vulkan Profiles is through the Vulkan Profiles header (`vulkan_profiles.hpp`), which is available in the link:https://vulkan.lunarg.com/sdk/home[Vulkan SDK]. This header provides a C++ API that simplifies working with profiles. The header is documented in the link:https://github.com/KhronosGroup/Vulkan-Profiles/tree/main[Vulkan-Profiles library documentation]:
120130

121131
[source,cpp]
122132
----
@@ -143,7 +153,11 @@ if (supported) {
143153

144154
=== 2. Using the Vulkan Profiles, JSON files directly
145155

146-
For more advanced use cases, you can work with the JSON profile definitions directly. The JSON schema is documented in the link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/schema/README.md[Vulkan-Profiles schema documentation]. You can find example code that loads and uses JSON profiles in the link:https://github.com/KhronosGroup/Vulkan-Profiles/tree/main/library/test[Vulkan-Profiles test directory]:
156+
For more advanced use cases, you can work with the JSON profile definitions
157+
directly. The JSON schema is documented in the link:https://github
158+
.com/KhronosGroup/Vulkan-Profiles/blob/main/schema/README.md[Vulkan-Profiles
159+
schema documentation]. You can find example code that loads and uses JSON
160+
profiles in the link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/layer/TUTORIAL.md[Vulkan-Profiles]:
147161

148162
[source,cpp]
149163
----
@@ -160,7 +174,7 @@ VkpProfile profile = loader.GetProfile("VP_ANDROID_BASELINE_2022");
160174

161175
=== Understanding Profile JSON Structure
162176

163-
Vulkan Profiles are defined in JSON format with a specific structure. Understanding this structure is important for developers who want to create custom profiles or modify existing ones. The full JSON schema is defined in the link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/schema/profiles-schema.json[profiles-schema.json] file and documented in the link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/schema/README.md[schema documentation]. Here's a simplified example of a profile JSON structure:
177+
Vulkan Profiles are defined in JSON format with a specific structure. Understanding this structure is important for developers who want to create custom profiles or modify existing ones. Here's a simplified example of a profile JSON structure:
164178

165179
[source,json]
166180
----
@@ -223,14 +237,23 @@ The key parts of a profile definition include:
223237

224238
=== Creating Custom Profiles
225239

226-
Developers can create custom profiles to target specific hardware configurations or to define a baseline for their own applications. The process is documented in the link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/CUSTOM_PROFILES.md[Creating Custom Profiles] guide. To create a custom profile:
240+
Developers can create custom profiles to target specific hardware configurations or to define a baseline for their own applications. To create a custom profile:
241+
242+
There are two main use cases that define the starting point:
243+
244+
1. Creating a "Platform" profile - a profile that represents all the devices you want your Vulkan application to run on. Here, the starting point would be to use data from https://vulkan.gpuinfo.org/ when merging device capabilities.
245+
2. Creating an "Engine" profile - a profile that lists all the requirements for your Vulkan application to run. In this case, modifying an existing profile is often the best approach.
246+
247+
Both approaches work together to ensure a Vulkan application can ship reliably.
248+
249+
To create a custom profile:
227250

228-
1. Start with an existing profile as a template (see link:https://github.com/KhronosGroup/Vulkan-Profiles/tree/main/profiles[official profiles])
251+
1. Start with an appropriate existing profile as a template (see link:https://github.com/KhronosGroup/Vulkan-Profiles/tree/main/profiles[profiles])
229252
2. Modify the capabilities to match your requirements
230253
3. Save the profile as a JSON file
231254
4. Use the profile in your application using either the header-based or JSON-based approach
232255

233-
You can find examples of custom profiles in the link:https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/api/profiles[Vulkan-Samples profiles examples].
256+
You can find examples of custom profiles in the link:https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/tooling/profiles[Vulkan-Samples profiles examples].
234257

235258
Custom profiles are particularly useful for:
236259

@@ -271,13 +294,12 @@ VkpProfile profile = loader.GetProfile("VP_CUSTOM_GAME_PROFILE");
271294

272295
== Android Baseline Profile
273296

274-
The Android Baseline Profile is particularly useful for Android developers as it provides a guaranteed set of features that are available on a wide range of Android devices. This profile is documented in the link:https://docs.vulkan.org/spec/latest/appendices/profiles.html#profile-VP_ANDROID_BASELINE_2022[Vulkan Specification] and the link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/profiles/VP_ANDROID_BASELINE_2022.json[JSON definition]. This profile includes:
297+
The Android Baseline Profile is particularly useful for Android developers as it provides a guaranteed set of features that are available on a wide range of Android devices. This profile is documented in the link:https://vulkan.lunarg.com/doc/sdk/1.4.321.0/windows/profiles_api_library.html[Vulkan Profiles API Library documentation] and the link:https://github.com/KhronosGroup/Vulkan-Profiles/blob/main/profiles/VP_ANDROID_baseline_2022.json[JSON definition]. This profile includes:
275298

276299
* Core Vulkan 1.1 functionality
277300
* Essential extensions for Android development
278301
* Minimum guaranteed limits and features
279302

280-
For Android-specific examples, see the link:https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/api/profiles[Vulkan-Samples profiles examples] and the link:https://developer.android.com/ndk/guides/graphics/vulkan-profiles[Android NDK documentation on Vulkan Profiles].
281303

282304
By targeting the Android Baseline Profile, developers can:
283305

@@ -334,7 +356,7 @@ Integrating Vulkan Profiles into an existing Vulkan application involves several
334356
3. *Modify Device Creation*: Update your device creation code to use profiles
335357
4. *Add Fallback Paths*: Implement fallback strategies for devices that don't support your target profile
336358

337-
For examples of integrating profiles with existing applications, see the link:https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/api/profiles[Vulkan-Samples profiles examples] and the link:https://github.com/KhronosGroup/Vulkan-Profiles/tree/main/library/test[Vulkan-Profiles test directory].
359+
For examples of integrating profiles with existing applications, see the link:https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/tooling/profiles[Vulkan-Samples profiles examples] and the link:https://github.com/KhronosGroup/Vulkan-Profiles/tree/main/library/test[Vulkan-Profiles test directory].
338360

339361
Here's an example of integrating profiles into an existing application:
340362

@@ -359,8 +381,8 @@ void CreateDeviceOriginal(VkPhysicalDevice physicalDevice) {
359381
360382
// Updated device creation code using profiles
361383
void CreateDeviceWithProfiles(VkPhysicalDevice physicalDevice) {
362-
// Try to use the Baseline 2022 profile
363-
vkp::Baseline2022Profile profile;
384+
// Try to use the LunarG Desktop Baseline 2022 profile
385+
vkp::LunargDesktopBaseline2022Profile profile;
364386
365387
VkBool32 supported = VK_FALSE;
366388
profile.CheckSupport(physicalDevice, &supported);
@@ -472,10 +494,8 @@ The profile system continues to evolve, with new profiles being defined to addre
472494

473495
For more information, refer to these resources:
474496

475-
* link:https://docs.vulkan.org/spec/latest/appendices/profiles.html[Vulkan Profiles in the Vulkan Specification]
497+
* link:https://vulkan.lunarg.com/doc/sdk/1.4.321.0/windows/profiles_api_library.html[Vulkan Profiles API Library documentation]
476498
* link:https://github.com/KhronosGroup/Vulkan-Profiles[Vulkan-Profiles repository]
477499
- Contains profile definitions, library code, and tools
478-
* link:https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/api/profiles[Vulkan-Samples profiles examples]
500+
* link:https://github.com/KhronosGroup/Vulkan-Samples/tree/main/samples/tooling/profiles[Vulkan-Samples profiles examples]
479501
- Sample code demonstrating profile usage
480-
* link:https://vulkan.lunarg.com/doc/sdk/latest/windows/profiles_api_library.html[Vulkan SDK Profiles API Library documentation]
481-
* link:https://developer.android.com/ndk/guides/graphics/vulkan-profiles[Android NDK documentation on Vulkan Profiles] - For Android-specific guidance

0 commit comments

Comments
 (0)