I decided to learn Vulkan and started writing a simple program. I then ran the program (which only called vkCreateInstance()) to see if the Vulkan instance was created successfully and was shocked to see that my computer's fan started spinning loudly (and kept doing so for 5 seconds) and I saw a spike of 8% of the computer's processes being used for a second(and the function call took 1.5 billion cycles -- enough to make the program's loading time noticeable). Complaining about a one second CPU-usage spike would seem humorous if the spike were due to a loop doing hundreds of function calls, but I only called a single function once (vkCreateInstance()). Is there a way to reduce the overhead of some of Vulkan's functions and should I be using Vulkan for 2-D rendering?
Here is the code that took 1.5 billion cycles to run:
VkInstance instance;
VkApplicationInfo appInfo = { 0, 0, 0, 0, 0, 0, 0 };
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
appInfo.pApplicationName = "Hello Triangle";
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
appInfo.pEngineName = "No Engine";
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
appInfo.apiVersion = VK_API_VERSION_1_0;
VkInstanceCreateInfo createInfo = { 0, 0, 0, 0, 0, 0, 0, 0 };
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
createInfo.pApplicationInfo = &appInfo;
createInfo.enabledExtensionCount = 0;
createInfo.ppEnabledExtensionNames = NULL;
VkResult result = vkCreateInstance(&createInfo, NULL, &instance);