Fix : Added prerequisite checks for using VK_Layer_Validation #105922

Merged
Jeroen Bakker merged 16 commits from :vk_debug_break_down into main 2023-03-28 10:45:56 +02:00
1 changed files with 2 additions and 4 deletions
Showing only changes of commit 1a743c5193 - Show all commits

View File

@ -88,8 +88,7 @@ static bool vklayer_config_exist(const char* vk_extension_config)
}
vnapdv marked this conversation as resolved Outdated

Not sure we need to open the file. can we use file stats?

Not sure we need to open the file. can we use file stats?

This section is too C. I would use std::stringstream.

This section is too C. I would use `std::stringstream`.
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

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?

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?

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

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

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.
}