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 |
|---|---|---|
| .. | ||
| Buffer.cpp | Loading commit data... | |
| Buffer.hpp | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| DrawTester.cpp | Loading commit data... | |
| DrawTester.hpp | Loading commit data... | |
| Framebuffer.cpp | Loading commit data... | |
| Framebuffer.hpp | Loading commit data... | |
| Image.cpp | Loading commit data... | |
| Image.hpp | Loading commit data... | |
| Swapchain.cpp | Loading commit data... | |
| Swapchain.hpp | Loading commit data... | |
| Util.cpp | Loading commit data... | |
| Util.hpp | Loading commit data... | |
| VulkanHeaders.cpp | Loading commit data... | |
| VulkanHeaders.hpp | Loading commit data... | |
| VulkanTester.cpp | Loading commit data... | |
| VulkanTester.hpp | Loading commit data... | |
| Window.cpp | Loading commit data... | |
| Window.hpp | Loading commit data... |