Lines Matching +full:vulkan +full:- +full:loader

1 <!-- markdownlint-disable MD041 -->
2 <!-- Copyright 2015-2019 LunarG, Inc. -->
3 [![Khronos Vulkan][1]][2]
5 [1]: https://vulkan.lunarg.com/img/Vulkan_100px_Dec16.png "https://www.khronos.org/vulkan/"
6 [2]: https://www.khronos.org/vulkan/
8 # GPU-Assisted Validation
12 [3]: https://i.creativecommons.org/l/by-nd/4.0/88x31.png "Creative Commons License"
13 [4]: https://creativecommons.org/licenses/by-nd/4.0/
15 GPU-Assisted validation is implemented in the SPIR-V Tools optimizer and the `VK_LAYER_LUNARG_core_…
20 The basic operation of GPU-Assisted validation is comprised of instrumenting shader code to perform…
24 The layer instruments the shaders by passing the shader's SPIR-V bytecode to the SPIR-V optimizer c…
25 …erform an instrumentation pass to add the additional instructions to perform the run-time checking.
26 The layer then passes the resulting modified SPIR-V bytecode to the driver as part of the process o…
28 As the shader is executed, the instrumented shader code performs the run-time checks.
30 This record is small and is on the order of a dozen 32-bit words.
32 … consecutive memory locations as long as there is space available in the pre-allocated block of de…
38 If the shader was compiled with debug information (source code and SPIR-V instruction mapping to so…
41 ## GPU-Assisted Validation Checks
43 The initial release (Jan 2019) of GPU-Assisted Validation includes checking for out-of-bounds descr…
49 ### Out-of-Bounds(OOB) Descriptor Array Indexing
51 Checking for correct indexing of descriptor arrays is sometimes referred to as "bind-less validatio…
52 It is called "bind-less" because a binding in a descriptor set may contain an array of like descrip…
53 And unless there is a constant or compile-time indication of which descriptor in the array is selec…
54 …ding status is considered to be ambiguous, leaving the actual binding to be determined at run-time.
67 ERROR : VALIDATION - Message Id Number: 0 | Message Id Name: UNASSIGNED-Image descriptor index out …
71 /home/user/src/Vulkan-ValidationLayers/external/Vulkan-Tools/cube/cube.frag at line 45.
75 ## GPU-Assisted Validation Options
77 Here are the options related to activating GPU-Assisted Validation:
79 1. Enable GPU-Assisted Validation - GPU-Assisted Validation is off by default and must be enabled.
81 …GPU-Assisted Validation is disabled by default because the shader instrumentation may introduce si…
83 GPU-Assisted Validation requires additional resources such as device memory and descriptors.
84 It is desirable for the user to opt-in to this feature because of these requirements.
88 2. Reserve a Descriptor Set Binding Slot - Modifies the value of the `VkPhysicalDeviceLimits::maxBo…
96 The existing layer configuration file mechanism can be used to enable GPU-Assisted Validation.
98 [LunarXchange website](https://vulkan.lunarg.com/doc/sdk/latest/windows/layer_configuration.html),
119 The `VK_EXT_validation_features` extension can be used to enable GPU-Assisted Validation at CreateI…
136 ## GPU-Assisted Validation Limitations
138 There are several limitations that may impede the operation of GPU-Assisted Validation:
140 ### Vulkan 1.1
142 Vulkan 1.1 or later is required because the GPU instrumentation code uses SPIR-V 1.3 features.
143 Vulkan 1,1 is required to ensure that SPIR-V 1.3 is available.
156 GPU-Assisted Validation cannot be performed because it needs a descriptor set to
164 then GPU-Assisted Validation cannot be performed.
167 building the graphics pipeline with non-instrumented shaders instead of instrumented ones.
175 GPU-Assisted Validation does allocate device memory for the error report buffers.
181 If GPU-Assisted Validation device memory allocations fail, the device could become
182 unstable because some previously-built pipelines may contain instrumented shaders.
214 to implement GPU-Assisted Validation without some of the limitations described above.
222 ## GPU-Assisted Validation Internal Design
224 This section may be of interest to readers who are interested on how GPU-Assisted Validation is imp…
241 An alternative design allocates this block on a per-device or per-queue basis and should work.
255 * When creating a ShaderModule, pass the SPIR-V bytecode to the SPIR-V optimizer to perform the ins…
265 non-instrumented ones when the pipeline layout is later used to create a graphics pipeline.
268 If it is, replace the instrumented shaders in the pipeline with non-instrumented ones.
273 The above describes only the high-level details of GPU-Assisted Validation operation.
281 From these options, the layer sets instance-scope flags in the core validation layer tracking data …
282 GPU-Assisted Validation has been requested, along with any other associated options.
286 Much of the GPU-Assisted Validation implementation involves making "application level" Vulkan API
289 These calls are not routed up through the top of the loader/layer/driver call stack via the loader.
299 To address this, the code can "just" be written carefully so that it is "valid" Vulkan,
306 Vulkan usage is valid.
310 * Building the core validation layer with a hack to force GPU-Assisted Validation to be enabled.
324 * The additional API calls are not state-tracked
328 For example, any device memory allocation performed by GPU-Assisted Validation won't be
333 a later implementation of GPU-Assisted Validation using the `VK_EXT_buffer_device_address`
339 The GPU-Assisted Validation code is largely contained in one
340 [file](https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/master/layers/gpu_validation.cp…
345 if (GetEnables(dev_data)->gpu_validation) {
350 The GPU-Assisted Validation code is linked into the shared library for the core validation layer.
354 Each function for a Vulkan API command intercepted in the core validation layer is usually split up
363 The GPU-Assisted Validation functions follow this pattern not by hooking into the top-level core va…
365 In a few unusual cases, the GPU-Assisted Validation function "takes over" the call to the driver (d…
366 must hook the top-level API shim.
386 * Record these objects in the per-device state
403 * Record the above objects in the per-CB state
416 because it replaces the SPIR-V, which requires modifying the bytecode passed down to the driver.
417 … sets up to call the SPIR-V optimizer to run the "BindlessCheckPass", replacing the original SPIR-
420 This function generates a "unique shader ID" that is passed to the SPIR-V optimizer,
426 Therefore, the layer keeps a "counter" in per-device state that is incremented each time a shader i…
428 This unique ID is given to the SPIR-V optimizer and is stored in the shader module state tracker af…
430 The process of instrumenting the SPIR-V also includes passing the selected descriptor set binding i…
431 to the SPIR-V optimizer which the instrumented
433 An instrumented shader is now "hard-wired" to write error records via the descriptor set at that bi…
437 The original SPIR-V bytecode is left stored in the shader module tracking data.
441 This ensures that the original SPIR-V bytecode is available if we need it to replace the instrument…
472 * Create non-instrumented shader modules from the saved original SPIR-V
473 * Modify the CreateInfo data to use these non-instrumented shaders.
508 The shader instrumentation process performed by the SPIR-V optimizer applies descriptor index bound…
517 Instrumentation is applied to the following SPIR-V operations:
556 This description includes the support for future GPU-Assisted Validation features
557 such as checking for uninitialized descriptors in the partially-bound scenario.
598 <Stage-Specific Words>
599 <Validation-Specific Words>
609 The Stage is the integer value used in SPIR-V for each of the Graphics Execution Models:
612 |--------|:-----:|
626 |--------|------------------|------------|
635 ### Validation-Specific Words
647 |-----------------------------|:----:|----------------|-----------------------|
671 [SPIRV-Tools](https://github.com/KhronosGroup/SPIRV-Tools) repository in file
672 [`instrument.hpp`](https://github.com/KhronosGroup/SPIRV-Tools/blob/master/include/spirv-tools/inst…
676 ## GPU-Assisted Validation Error Report
690 * command buffer handle - This is easily obtained because we are looping over the command
692 * draw number - keep track of how many draws we've processed for a given command buffer.
693 * pipeline handle - The shader tracker discussed earlier contains this handle
694 * shader module handle - The "Shader ID" (Word 1 in the record) is used to lookup
696 * instruction index - This is the SPIR-V instruction index where the invalid array access occurred.
697 …It is not that useful by itself, since the user would have to use it to locate a SPIR-V instruction
698 in a SPIR-V disassembly and somehow relate it back to the shader source code.
700 The user can build the shader with debug information to get source-level information.
706 The layer then adds on error message text obtained from decoding the stage-specific and
707 validation-specific data as described earlier.
709 This completes the error report when there is no source-level debug information in the shader.
711 ### Source-Level Debug Information
713 This is one of the more complicated and code-heavy parts of the GPU-Assisted Validation feature
714 and all it really does is display source-level information when the shader is compiled
715 with debugging info (`-g` option in the case of `glslangValidator`).
721 The SPIR-V generator (e.g., glslangValidator) places an OpLine SPIR-V instruction in the
728 The layer scans the SPIR-V looking for the last OpLine instruction that appears before the instruct…
732 The filename itself is obtained by scanning the SPIR-V again for an OpString instruction that
741 The SPIR-V built with source-level debug info also contains OpSource instructions that
743 Due to possible pre-processing, the layer just cannot simply use the source file line number
759 ## GPU-Assisted Validation Testing
761 Validation Layer Tests (VLTs) exist for GPU-Assisted Validation.
767 They activate GPU-Assisted Validation via the programmatic