Vulkan: Warn Developer When Layer Not Found. #105599

Merged
Jeroen Bakker merged 1 commits from Jeroen-Bakker/blender:vulkan-make-layer-error-an-warning into main 2023-03-09 14:55:51 +01:00
1 changed files with 6 additions and 4 deletions

View File

@ -401,13 +401,15 @@ static bool checkLayerSupport(vector<VkLayerProperties> &layers_available, const
static void enableLayer(vector<VkLayerProperties> &layers_available,
vector<const char *> &layers_enabled,
const char *layer_name)
const char *layer_name,
const bool debug)
{
if (checkLayerSupport(layers_available, layer_name)) {
layers_enabled.push_back(layer_name);
}
else {
fprintf(stderr, "Error: %s not supported.\n", layer_name);
else if (debug) {
fprintf(
stderr, "Warning: Layer requested, but not supported by the platform. [%s]\n", layer_name);
}
}
@ -862,7 +864,7 @@ GHOST_TSuccess GHOST_ContextVK::initializeDrawingContext()
vector<const char *> layers_enabled;
if (m_debug) {
enableLayer(layers_available, layers_enabled, "VK_LAYER_KHRONOS_validation");
enableLayer(layers_available, layers_enabled, "VK_LAYER_KHRONOS_validation", m_debug);
}
vector<const char *> extensions_device;