Permalink
Browse files

Add a bit of logging to try to figure out #10477

  • Loading branch information...
hrydgard committed Dec 30, 2017
1 parent f3ba540 commit 191c4ddb0d56c3ab271e875d8386a05735f8f557
Showing with 16 additions and 2 deletions.
  1. +8 −2 Common/Vulkan/VulkanContext.cpp
  2. +8 −0 Common/Vulkan/VulkanContext.h
@@ -132,15 +132,21 @@ VkResult VulkanContext::CreateInstance(const CreateInfo &info) {
instance_extensions_enabled_.push_back(VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
}
VkApplicationInfo app_info { VK_STRUCTURE_TYPE_APPLICATION_INFO };
// Validate that all the instance extensions we ask for are actually available.
for (auto ext : instance_extensions_enabled_) {
if (!IsInstanceExtensionAvailable(ext))
WLOG("WARNING: Does not seem that instance extension '%s' is available. Trying to proceed anyway.", ext);
}
VkApplicationInfo app_info{ VK_STRUCTURE_TYPE_APPLICATION_INFO };
app_info.pApplicationName = info.app_name;
app_info.applicationVersion = info.app_ver;
app_info.pEngineName = info.app_name;
// Let's increment this when we make major engine/context changes.
app_info.engineVersion = 2;
app_info.apiVersion = VK_API_VERSION_1_0;
VkInstanceCreateInfo inst_info { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO };
VkInstanceCreateInfo inst_info{ VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO };
inst_info.flags = 0;
inst_info.pApplicationInfo = &app_info;
inst_info.enabledLayerCount = (uint32_t)instance_layer_names_.size();
@@ -196,6 +196,14 @@ class VulkanContext {
const VulkanPhysicalDeviceInfo &GetDeviceInfo() const { return deviceInfo_; }
const VkSurfaceCapabilitiesKHR &GetSurfaceCapabilities() const { return surfCapabilities_; }
bool IsInstanceExtensionAvailable(const char *name) const {
for (auto &iter : instance_extension_properties_) {
if (!strcmp(name, iter.extensionName))
return true;
}
return false;
}
bool IsDeviceExtensionAvailable(const char *name) const {
for (auto &iter : device_extension_properties_) {
if (!strcmp(name, iter.extensionName))

0 comments on commit 191c4dd

Please sign in to comment.