Home » Developing U++ » U++ Developers corner » U++ Allocator & Vulkan
U++ Allocator & Vulkan [message #57461] |
Sat, 21 August 2021 17:47 |
|
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
I installed my Vulkan work on my Debian desktop and tried to compile the most basic code :
//#include <Core/Core.h>
#include <iostream>
#include <vulkan/vulkan.h>
int main(int argc, const char *argv[])
//CONSOLE_APP_MAIN
{
VkInstance instance;
VkApplicationInfo appInfo{};
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{};
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
createInfo.pApplicationInfo = &appInfo;
createInfo.enabledExtensionCount = 0;
createInfo.ppEnabledExtensionNames = nullptr;
createInfo.enabledLayerCount = 0;
if (vkCreateInstance(&createInfo, nullptr, &instance) != VK_SUCCESS) {
#ifndef CORE_H
std::cout << "Error\n";
#else
Upp::Cout() << "Error\n";
#endif
}else{
vkDestroyInstance(instance, nullptr);
}
}
A simple vulkan instance creation using default allocator. Here is my probblem:
If I include Core in my project without using USEMALLOC flag. This simple code result in memory leak :
with USEMALLOC (or removing Core package) no problem happen.
From my knowledge, Vulkan, in order to work properly must have allocator that's aligned on 4 octet. May it's the reason of this error ?
|
|
|
Goto Forum:
Current Time: Sat Jun 08 07:35:01 CEST 2024
Total time taken to generate the page: 0.02034 seconds
|