Skip to content

Commit de7217e

Browse files
committed
Rmove outdated comments and code for device level validation layers
1 parent a0e804f commit de7217e

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

en/03_Drawing_a_triangle/00_Setup/02_Validation_layers.adoc

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,7 @@ Vulkan does not come with any validation layers built-in, but the LunarG Vulkan
4444
They're also completely https://github.com/KhronosGroup/Vulkan-ValidationLayers[open source], so you can check which kind of mistakes they check for and contribute.
4545
Using the validation layers is the best way to avoid your application breaking on different drivers by accidentally relying on undefined behavior.
4646

47-
Validation layers can only be used if they have been installed onto the system.
48-
For example, the LunarG validation layers are only available on PCs with the Vulkan SDK installed.
49-
50-
There were formerly two different types of validation layers in Vulkan: instance and device specific.
51-
The idea was that instance layers would only check calls related to global Vulkan objects like instances, and device specific layers would only check calls related to a specific GPU.
52-
Device specific layers have now been deprecated, which means that instance validation layers apply to all Vulkan calls.
53-
The specification document still recommends that you enable validation layers at device level as well for compatibility, which is required by some implementations.
54-
We'll simply specify the same layers as the instance at logical device level, which we'll see link:./04_Logical_device_and_queues.adoc[later on].
47+
Validation layers can only be used if they have been installed onto the system. One way to get those layers is through the LunarG SDK.
5548

5649
== Using validation layers
5750

en/03_Drawing_a_triangle/00_Setup/04_Logical_device_and_queues.adoc

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,27 +92,15 @@ createInfo.queueCreateInfoCount = 1;
9292
createInfo.pEnabledFeatures = &deviceFeatures;
9393
----
9494

95-
The remainder of the information bears a resemblance to the `VkInstanceCreateInfo` struct and requires you to specify extensions and validation layers.
96-
The difference is that these are device specific this time.
95+
The remainder of the information bears a resemblance to the `VkInstanceCreateInfo` struct and lets you to specify extensions. The difference is that these are device specific this time.
9796

9897
An example of a device specific extension is `VK_KHR_swapchain`, which allows you to present rendered images from that device to windows.
9998
It is possible that there are Vulkan devices in the system that lack this ability, for example because they only support compute operations.
10099
We will come back to this extension in the swap chain chapter.
101100

102-
Previous implementations of Vulkan made a distinction between instance and device specific validation layers, but this is https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/chap40.html#extendingvulkan-layers-devicelayerdeprecation[no longer the case].
103-
That means that the `enabledLayerCount` and `ppEnabledLayerNames` fields of `VkDeviceCreateInfo` are ignored by up-to-date implementations.
104-
However, it is still a good idea to set them anyway to be compatible with older implementations:
105-
106101
[,c++]
107102
----
108103
createInfo.enabledExtensionCount = 0;
109-
110-
if (enableValidationLayers) {
111-
createInfo.enabledLayerCount = static_cast<uint32_t>(validationLayers.size());
112-
createInfo.ppEnabledLayerNames = validationLayers.data();
113-
} else {
114-
createInfo.enabledLayerCount = 0;
115-
}
116104
----
117105

118106
We won't need any device specific extensions for now.

0 commit comments

Comments
 (0)