aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2016-11-07 16:26:17 -0700
committerMark Young <marky@lunarg.com>2016-11-07 16:27:52 -0700
commit60a5b356c8369c5b304bff0adb6c39ee8d89b075 (patch)
tree13557073d217b06681ac9d14211035722456532d /loader/loader.c
parent1e508c65344d1e24e8b3f953a864e270a22028ab (diff)
downloadusermoji-60a5b356c8369c5b304bff0adb6c39ee8d89b075.tar.xz
loader: Remove warning on missing implicit layer
If the Implicit Layer registry location was missing, validation would throw a warning. This is not correct behavior as many systems will not have Implicit layers. Modify so the warning/error is only thrown if either a driver manifest path, or an explicit layer path. Change-Id: Ideccc730e0b1c613c4cc58c5f64ae31ba19bc05c
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 7c697758..2e9f09ea 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2587,10 +2587,12 @@ loader_add_layer_properties(const struct loader_instance *inst,
* Linux ICD | dirs | files
* Linux Layer| dirs | dirs
*/
-static VkResult loader_get_manifest_files(
- const struct loader_instance *inst, const char *env_override,
- char *source_override, bool is_layer, const char *location,
- const char *home_location, struct loader_manifest_files *out_files) {
+static VkResult
+loader_get_manifest_files(const struct loader_instance *inst,
+ const char *env_override, char *source_override,
+ bool is_layer, bool warn_if_not_present,
+ const char *location, const char *home_location,
+ struct loader_manifest_files *out_files) {
char * override = NULL;
char *loc, *orig_loc = NULL;
char *reg = NULL;
@@ -2660,10 +2662,12 @@ static VkResult loader_get_manifest_files(
// if this is for the loader.
res = VK_ERROR_OUT_OF_HOST_MEMORY;
} else {
- // warning only for layers
- loader_log(
- inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0,
- "Registry lookup failed can't get layer manifest files");
+ if (warn_if_not_present) {
+ // warning only for layers
+ loader_log(
+ inst, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0,
+ "Registry lookup failed can't get layer manifest files");
+ }
// Return success for now since it's not critical for layers
res = VK_SUCCESS;
}
@@ -2916,7 +2920,7 @@ VkResult loader_icd_scan(const struct loader_instance *inst,
// Get a list of manifest files for ICDs
res = loader_get_manifest_files(inst, "VK_ICD_FILENAMES", NULL, false,
- DEFAULT_VK_DRIVERS_INFO,
+ true, DEFAULT_VK_DRIVERS_INFO,
HOME_VK_DRIVERS_INFO, &manifest_files);
if (VK_SUCCESS != res || manifest_files.count == 0) {
goto out;
@@ -3111,7 +3115,7 @@ void loader_layer_scan(const struct loader_instance *inst,
// Get a list of manifest files for explicit layers
if (VK_SUCCESS !=
loader_get_manifest_files(inst, LAYERS_PATH_ENV, LAYERS_SOURCE_PATH,
- true, DEFAULT_VK_ELAYERS_INFO,
+ true, true, DEFAULT_VK_ELAYERS_INFO,
HOME_VK_ELAYERS_INFO, &manifest_files[0])) {
goto out;
}
@@ -3119,9 +3123,10 @@ void loader_layer_scan(const struct loader_instance *inst,
// Get a list of manifest files for any implicit layers
// Pass NULL for environment variable override - implicit layers are not
// overridden by LAYERS_PATH_ENV
- if (VK_SUCCESS != loader_get_manifest_files(
- inst, NULL, NULL, true, DEFAULT_VK_ILAYERS_INFO,
- HOME_VK_ILAYERS_INFO, &manifest_files[1])) {
+ if (VK_SUCCESS != loader_get_manifest_files(inst, NULL, NULL, true, false,
+ DEFAULT_VK_ILAYERS_INFO,
+ HOME_VK_ILAYERS_INFO,
+ &manifest_files[1])) {
goto out;
}
@@ -3189,8 +3194,8 @@ void loader_implicit_layer_scan(const struct loader_instance *inst,
// Pass NULL for environment variable override - implicit layers are not
// overridden by LAYERS_PATH_ENV
VkResult res = loader_get_manifest_files(
- inst, NULL, NULL, true, DEFAULT_VK_ILAYERS_INFO, HOME_VK_ILAYERS_INFO,
- &manifest_files);
+ inst, NULL, NULL, true, false, DEFAULT_VK_ILAYERS_INFO,
+ HOME_VK_ILAYERS_INFO, &manifest_files);
if (VK_SUCCESS != res || manifest_files.count == 0) {
return;
}