Fixed lack of nullptr check for app and engine name in InstanceBuilder

This commit is contained in:
Charles Giessen 2020-02-17 13:22:49 -07:00
parent 14541f447c
commit 4a4078d276
2 changed files with 4 additions and 4 deletions

View File

@ -172,9 +172,9 @@ detail::Expected<Instance, detail::Error<InstanceError>> InstanceBuilder::build
VkApplicationInfo app_info = {};
app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
app_info.pNext = nullptr;
app_info.pApplicationName = info.app_name;
app_info.pApplicationName = info.app_name != nullptr ? info.app_name : "";
app_info.applicationVersion = info.application_version;
app_info.pEngineName = info.engine_name;
app_info.pEngineName = info.engine_name != nullptr ? info.engine_name : "";
app_info.engineVersion = info.engine_version;
app_info.apiVersion = info.api_version;

View File

@ -158,8 +158,8 @@ class InstanceBuilder {
private:
struct InstanceInfo {
// VkApplicationInfo
const char* app_name;
const char* engine_name;
const char* app_name = nullptr;
const char* engine_name = nullptr;
uint32_t application_version = 0;
uint32_t engine_version = 0;
uint32_t api_version = VK_MAKE_VERSION (1, 0, 0);