Skip to content

Commit c51fe57

Browse files
authored
Improve docs for wgpu_types::InstanceFlags::VALIDATION. (#7939)
1 parent 1b4eca9 commit c51fe57

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

wgpu-types/src/instance.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,29 @@ bitflags::bitflags! {
7070
///
7171
/// When `Self::from_env()` is used takes value from `WGPU_DEBUG` environment variable.
7272
const DEBUG = 1 << 0;
73-
/// Enable validation, if possible.
73+
/// Enable validation in the backend API, if possible:
7474
///
75-
/// When `Self::from_env()` is used takes value from `WGPU_VALIDATION` environment variable.
75+
/// - On the Direct3D `dx12` backend, this calls [`ID3D12Debug::EnableDebugLayer`][dx12].
76+
///
77+
/// - On the Vulkan backend, this enables the [Vulkan Validation Layer][vvl].
78+
///
79+
/// - On the `gles` backend driving Windows OpenGL, this enables [debug
80+
/// output][gl:do], effectively calling `glEnable(GL_DEBUG_OUTPUT)`.
81+
///
82+
/// - On non-Windows `gles` backends, this calls
83+
/// [`eglDebugMessageControlKHR`][gl:dm] to enable all debugging messages.
84+
/// If the GLES implementation is ANGLE running on Vulkan, this also
85+
/// enables the Vulkan validation layers by setting
86+
/// [`EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED`][gl:av].
87+
///
88+
/// When `Self::from_env()` is used, this bit is set if the `WGPU_VALIDATION`
89+
/// environment variable has any value but "0".
90+
///
91+
/// [dx12]: https://learn.microsoft.com/en-us/windows/win32/api/d3d12sdklayers/nf-d3d12sdklayers-id3d12debug-enabledebuglayer
92+
/// [vvl]: https://github.com/KhronosGroup/Vulkan-ValidationLayers
93+
/// [gl:dm]: https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_debug.txt
94+
/// [gl:do]: https://www.khronos.org/opengl/wiki/Debug_Output
95+
/// [gl:av]: https://chromium.googlesource.com/angle/angle/+/HEAD/extensions/EGL_ANGLE_platform_angle.txt
7696
const VALIDATION = 1 << 1;
7797
/// Don't pass labels to wgpu-hal.
7898
///

0 commit comments

Comments
 (0)