| 95 | } |
| 96 | |
| 97 | std::vector<Path> GetExplicitLayerPaths() { |
| 98 | std::vector<Path> result; |
| 99 | |
| 100 | #if VKC_ENV == VKC_ENV_WIN32 |
| 101 | const std::vector<Path> &admin_registry_paths = |
| 102 | LoadRegistrySoftwareLayers("HKEY_LOCAL_MACHINE\\Software\\Khronos\\Vulkan\\ExplicitLayers", LAYER_TYPE_EXPLICIT); |
| 103 | result.insert(result.begin(), admin_registry_paths.begin(), admin_registry_paths.end()); |
| 104 | |
| 105 | const std::vector<Path> &user_registry_paths = |
| 106 | LoadRegistrySoftwareLayers("HKEY_CURRENT_USER\\Software\\Khronos\\Vulkan\\ExplicitLayers", LAYER_TYPE_EXPLICIT); |
| 107 | result.insert(result.begin(), user_registry_paths.begin(), user_registry_paths.end()); |
| 108 | |
| 109 | // Search for drivers specific layers |
| 110 | const std::vector<Path> &drivers_registry_paths = |
| 111 | LoadRegistrySystemLayers("HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Class\\...\\VulkanExplicitLayers"); |
| 112 | result.insert(result.begin(), drivers_registry_paths.begin(), drivers_registry_paths.end()); |
| 113 | #else |
| 114 | if (VKC_PLATFORM == PLATFORM_MACOS) { |
| 115 | static const char *LAYERS_PATHS[] = { |
| 116 | "/usr/local/share/vulkan/explicit_layer.d", |
| 117 | ".local/share/vulkan/explicit_layer.d", |
| 118 | }; |
| 119 | |
| 120 | for (std::size_t i = 0, n = std::size(LAYERS_PATHS); i < n; ++i) { |
| 121 | result.push_back(LAYERS_PATHS[i]); |
| 122 | } |
| 123 | } else { |
| 124 | static const char *LAYERS_PATHS[] = { |
| 125 | "/usr/local/etc/vulkan/explicit_layer.d", |
| 126 | "/usr/local/share/vulkan/explicit_layer.d", |
| 127 | "/etc/vulkan/explicit_layer.d", |
| 128 | "/usr/share/vulkan/explicit_layer.d", |
| 129 | ".local/share/vulkan/explicit_layer.d", |
| 130 | #ifdef _DEBUG |
| 131 | #ifdef INSTALL_FULL_DATAROOTDIR |
| 132 | INSTALL_FULL_DATAROOTDIR "/vulkan/explicit_layer.d", |
| 133 | #endif |
| 134 | #ifdef INSTALL_FULL_SYSCONFDIR |
| 135 | INSTALL_FULL_SYSCONFDIR "/vulkan/explicit_layer.d", |
| 136 | #endif |
| 137 | #endif //_DEBUG |
| 138 | }; |
| 139 | |
| 140 | for (std::size_t i = 0, n = std::size(LAYERS_PATHS); i < n; ++i) { |
| 141 | result.push_back(LAYERS_PATHS[i]); |
| 142 | } |
| 143 | } |
| 144 | #endif |
| 145 | |
| 146 | return result; |
| 147 | } |
| 148 | |
| 149 | LayerManager::LayerManager() {} |
| 150 |
no test coverage detected