Skip to content

Commit

Permalink
Add a bit of logging to try to figure out #10477
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Dec 30, 2017
1 parent f3ba540 commit 191c4dd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Common/Vulkan/VulkanContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 8 additions & 0 deletions Common/Vulkan/VulkanContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 191c4dd

Please sign in to comment.