Fix : Added prerequisite checks for using VK_Layer_Validation #105922
|
@ -88,8 +88,7 @@ static bool vklayer_config_exist(const char* vk_extension_config)
|
|||
}
|
||||
vnapdv marked this conversation as resolved
Outdated
|
||||
std::stringstream filename;
|
||||
filename << ev_val;
|
||||
filename << "/";
|
||||
filename << vk_extension_config;
|
||||
filename << "/" << vk_extension_config;
|
||||
struct stat buffer;
|
||||
return (stat(filename.str().c_str(), &buffer) == 0);
|
||||
vnapdv marked this conversation as resolved
Outdated
Jeroen Bakker
commented
Not sure we should print any message to the user. So perhaps we just want to change the messahe in But then, what is the value of this PR? Not sure we should print any message to the user. `--debug-gpu` is also used by users when reporting bugs. This message will confuse them and ask questions. I rather see this fail silently.
So perhaps we just want to change the messahe in `enableLayer` (supporter=>available).
But then, what is the value of this PR?
Kazashi Yoshioka
commented
What we check with Vulkan Error : GHOST_ContextVK.cpp:937 : vkCreateInstance(&create_info, 0, &m_instance) failled with VK_ERROR_LAYER_NOT_PRESENT What we check with `enableLayer` is not whether it's actually ready for dynamic linking.
If the dll or so files are not properly configured, vkCreateInstance will fail.
This is a check to avoid that error.
-----
Vulkan Error : GHOST_ContextVK.cpp:937 : vkCreateInstance(&create_info, 0, &m_instance) failled with VK_ERROR_LAYER_NOT_PRESENT
|
||||
}
|
||||
|
@ -425,8 +424,7 @@ static void enableLayer(vector<VkLayerProperties> &layers_available,
|
|||
layers_enabled.push_back(layer_name);
|
||||
}
|
||||
else if (warning) {
|
||||
fprintf(stderr,
|
||||
"Warning: Layer requested, but not supported by the platform. [%s]\n",layer_name);
|
||||
fprintf(stderr,"Warning: Layer requested, but not supported by the platform. [%s]\n",layer_name);
|
||||
}
|
||||
vnapdv marked this conversation as resolved
Outdated
Jeroen Bakker
commented
I think the pattern you're using here will be different when adding the second extension. You don't want to copy the warning for each extension. I think the pattern you're using here will be different when adding the second extension. You don't want to copy the warning for each extension.
|
||||
}
|
||||
|
||||
|
|
Not sure we need to open the file. can we use file stats?
This section is too C. I would use
std::stringstream
.