Vulkan/Instance: Fix possible crash when not using layers or extensions

Former-commit-id: a429d0f1032f1a39ee50075b366d83cf4cba0823
This commit is contained in:
Lynix 2016-04-30 11:41:36 +02:00
parent 72e849fa85
commit 3bcde868ef
1 changed files with 4 additions and 4 deletions

View File

@ -39,9 +39,9 @@ namespace Nz
0, 0,
&appInfo, &appInfo,
static_cast<UInt32>(layers.size()), static_cast<UInt32>(layers.size()),
&layers[0], (!layers.empty()) ? layers.data() : nullptr,
static_cast<UInt32>(extensions.size()), static_cast<UInt32>(extensions.size()),
&extensions[0] (!extensions.empty()) ? extensions.data() : nullptr
}; };
return Create(instanceInfo, allocator); return Create(instanceInfo, allocator);
@ -69,12 +69,12 @@ namespace Nz
inline bool Instance::IsExtensionLoaded(const String& extensionName) inline bool Instance::IsExtensionLoaded(const String& extensionName)
{ {
return m_loadedExtensions.count(extensionName) != 0; return m_loadedExtensions.count(extensionName) > 0;
} }
inline bool Instance::IsLayerLoaded(const String& layerName) inline bool Instance::IsLayerLoaded(const String& layerName)
{ {
return m_loadedLayers.count(layerName) != 0; return m_loadedLayers.count(layerName) > 0;
} }
inline Instance::operator VkInstance() inline Instance::operator VkInstance()