In DEBUG builds, enable validation layers: VK_LAYER_KHRONOS_validation and VK_LAYER_LUNARG_standard_validation. Also register the debug utils messenger ext callback for when validation layers report a problem. We can force validation layers in non-DEBUG by defining ENABLE_VALIDATION_LAYERS to 1. In order to be able to use validation layers, load the Vulkan driver via ICD, rather than directly. To load SwiftShader, generate a temp icd.json file pointing at the driver path, and temporarily set the VK_ICD_FILENAMES env var to point at it when we load the ICD. This also allows us to load the native GPU driver by defining LOAD_NATIVE_DRIVER to 1 (default is 0). Fixed errors reported by enabling validation layers: * TriangleSampleTexture had a mismatched binding number for the sampler2D * Correctly set memoryTypeIndex for allocations instead of 0 Bug: b/176981107 Change-Id: I3c791086acea048b73d3568d6d7a45d8e0100c17 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/52749 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:Alexis Hétu <sugoi@google.com> Tested-by:
Antonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .vscode | Loading commit data... | |
| build | Loading commit data... | |
| build_overrides | Loading commit data... | |
| docs | Loading commit data... | |
| extensions | Loading commit data... | |
| include | Loading commit data... | |
| infra/config | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| third_party | Loading commit data... | |
| tools/cmake_generate_graphviz | Loading commit data... | |
| .clang-format | Loading commit data... | |
| .dir-locals.el | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| AUTHORS.txt | Loading commit data... | |
| Android.bp | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CMakeSettings.json | Loading commit data... | |
| CONTRIBUTING.txt | Loading commit data... | |
| CONTRIBUTORS.txt | Loading commit data... | |
| DIR_METADATA | Loading commit data... | |
| LICENSE.txt | Loading commit data... | |
| OWNERS | Loading commit data... | |
| README.md | Loading commit data... | |
| codereview.settings | Loading commit data... |