mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-12 07:03:34 +00:00
adding std namespace to all libstd provided primitive types
This commit is contained in:
@@ -94,7 +94,7 @@ namespace mlx
|
||||
core::error::report(e_kind::fatal_error, "Graphics allocator : failed to allocate a buffer, %s", RCore::verbaliseResultVk(res));
|
||||
if(name != nullptr)
|
||||
{
|
||||
Render_Core::get().getLayers().setDebugUtilsObjectNameEXT(VK_OBJECT_TYPE_BUFFER, (uint64_t)buffer, name);
|
||||
Render_Core::get().getLayers().setDebugUtilsObjectNameEXT(VK_OBJECT_TYPE_BUFFER, (std::uint64_t)buffer, name);
|
||||
vmaSetAllocationName(_allocator, allocation, name);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
@@ -124,7 +124,7 @@ namespace mlx
|
||||
core::error::report(e_kind::fatal_error, "Graphics allocator : failed to allocate an image, %s", RCore::verbaliseResultVk(res));
|
||||
if(name != nullptr)
|
||||
{
|
||||
Render_Core::get().getLayers().setDebugUtilsObjectNameEXT(VK_OBJECT_TYPE_IMAGE, (uint64_t)image, name);
|
||||
Render_Core::get().getLayers().setDebugUtilsObjectNameEXT(VK_OBJECT_TYPE_IMAGE, (std::uint64_t)image, name);
|
||||
vmaSetAllocationName(_allocator, allocation, name);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
@@ -161,7 +161,7 @@ namespace mlx
|
||||
|
||||
void GPUallocator::dumpMemoryToJson()
|
||||
{
|
||||
static uint32_t id = 0;
|
||||
static std::uint32_t id = 0;
|
||||
std::string name("memory_dump");
|
||||
name.append(std::to_string(id) + ".json");
|
||||
std::ofstream file(name);
|
||||
|
||||
@@ -44,8 +44,8 @@ namespace mlx
|
||||
|
||||
private:
|
||||
VmaAllocator _allocator;
|
||||
uint32_t _active_buffers_allocations = 0;
|
||||
uint32_t _active_images_allocations = 0;
|
||||
std::uint32_t _active_buffers_allocations = 0;
|
||||
std::uint32_t _active_images_allocations = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@ namespace mlx
|
||||
{
|
||||
namespace RCore
|
||||
{
|
||||
std::optional<uint32_t> findMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties, bool error)
|
||||
std::optional<std::uint32_t> findMemoryType(std::uint32_t typeFilter, VkMemoryPropertyFlags properties, bool error)
|
||||
{
|
||||
VkPhysicalDeviceMemoryProperties memProperties;
|
||||
vkGetPhysicalDeviceMemoryProperties(Render_Core::get().getDevice().getPhysicalDevice(), &memProperties);
|
||||
|
||||
for(uint32_t i = 0; i < memProperties.memoryTypeCount; i++)
|
||||
for(std::uint32_t i = 0; i < memProperties.memoryTypeCount; i++)
|
||||
{
|
||||
if((typeFilter & (1 << i)) && (memProperties.memoryTypes[i].propertyFlags & properties) == properties)
|
||||
return i;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace mlx
|
||||
{
|
||||
namespace RCore
|
||||
{
|
||||
std::optional<uint32_t> findMemoryType(uint32_t typeFilter, VkMemoryPropertyFlags properties, bool error = true);
|
||||
std::optional<std::uint32_t> findMemoryType(std::uint32_t typeFilter, VkMemoryPropertyFlags properties, bool error = true);
|
||||
const char* verbaliseResultVk(VkResult result);
|
||||
VkPipelineStageFlags accessFlagsToPipelineStage(VkAccessFlags accessFlags, VkPipelineStageFlags stageFlags);
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ namespace mlx
|
||||
Queues::QueueFamilyIndices indices = Render_Core::get().getQueue().getFamilies();
|
||||
|
||||
std::vector<VkDeviceQueueCreateInfo> queueCreateInfos;
|
||||
std::set<uint32_t> uniqueQueueFamilies = { indices.graphicsFamily.value(), indices.presentFamily.value() };
|
||||
std::set<std::uint32_t> uniqueQueueFamilies = { indices.graphicsFamily.value(), indices.presentFamily.value() };
|
||||
|
||||
float queuePriority = 1.0f;
|
||||
for(uint32_t queueFamily : uniqueQueueFamilies)
|
||||
for(std::uint32_t queueFamily : uniqueQueueFamilies)
|
||||
{
|
||||
VkDeviceQueueCreateInfo queueCreateInfo{};
|
||||
queueCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
|
||||
@@ -49,12 +49,12 @@ namespace mlx
|
||||
VkDeviceCreateInfo createInfo{};
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
|
||||
|
||||
createInfo.queueCreateInfoCount = static_cast<uint32_t>(queueCreateInfos.size());
|
||||
createInfo.queueCreateInfoCount = static_cast<std::uint32_t>(queueCreateInfos.size());
|
||||
createInfo.pQueueCreateInfos = queueCreateInfos.data();
|
||||
|
||||
createInfo.pEnabledFeatures = &deviceFeatures;
|
||||
|
||||
createInfo.enabledExtensionCount = static_cast<uint32_t>(deviceExtensions.size());
|
||||
createInfo.enabledExtensionCount = static_cast<std::uint32_t>(deviceExtensions.size());
|
||||
createInfo.ppEnabledExtensionNames = deviceExtensions.data();
|
||||
createInfo.enabledLayerCount = 0;
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace mlx
|
||||
|
||||
void Device::pickPhysicalDevice()
|
||||
{
|
||||
uint32_t deviceCount = 0;
|
||||
std::uint32_t deviceCount = 0;
|
||||
vkEnumeratePhysicalDevices(Render_Core::get().getInstance().get(), &deviceCount, nullptr);
|
||||
|
||||
if(deviceCount == 0)
|
||||
@@ -113,7 +113,7 @@ namespace mlx
|
||||
Queues::QueueFamilyIndices indices = Render_Core::get().getQueue().findQueueFamilies(device, surface);
|
||||
bool extensionsSupported = checkDeviceExtensionSupport(device);
|
||||
|
||||
uint32_t formatCount = 0;
|
||||
std::uint32_t formatCount = 0;
|
||||
if(extensionsSupported)
|
||||
vkGetPhysicalDeviceSurfaceFormatsKHR(device, surface, &formatCount, nullptr);
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace mlx
|
||||
|
||||
bool Device::checkDeviceExtensionSupport(VkPhysicalDevice device)
|
||||
{
|
||||
uint32_t extensionCount;
|
||||
std::uint32_t extensionCount;
|
||||
vkEnumerateDeviceExtensionProperties(device, nullptr, &extensionCount, nullptr);
|
||||
|
||||
std::vector<VkExtensionProperties> availableExtensions(extensionCount);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/04/02 17:53:06 by maldavid #+# #+# */
|
||||
/* Updated: 2024/01/06 16:57:26 by maldavid ### ########.fr */
|
||||
/* Updated: 2024/02/25 08:02:45 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/08 19:04:21 by maldavid #+# #+# */
|
||||
/* Updated: 2024/02/24 04:31:00 by maldavid ### ########.fr */
|
||||
/* Updated: 2024/02/24 21:10:32 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace mlx
|
||||
VkApplicationInfo appInfo{};
|
||||
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
|
||||
appInfo.pEngineName = "MacroLibX";
|
||||
appInfo.engineVersion = VK_MAKE_VERSION(1, 2, 1);
|
||||
appInfo.engineVersion = VK_MAKE_VERSION(1, 3, 1);
|
||||
appInfo.apiVersion = VK_API_VERSION_1_2;
|
||||
|
||||
auto extensions = getRequiredExtensions();
|
||||
@@ -30,7 +30,7 @@ namespace mlx
|
||||
VkInstanceCreateInfo createInfo{};
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||
createInfo.pApplicationInfo = &appInfo;
|
||||
createInfo.enabledExtensionCount = static_cast<uint32_t>(extensions.size());
|
||||
createInfo.enabledExtensionCount = static_cast<std::uint32_t>(extensions.size());
|
||||
createInfo.ppEnabledExtensionNames = extensions.data();
|
||||
createInfo.enabledLayerCount = 0; // will be replaced if validation layers are enabled
|
||||
createInfo.pNext = nullptr;
|
||||
@@ -40,7 +40,7 @@ namespace mlx
|
||||
{
|
||||
if(Render_Core::get().getLayers().checkValidationLayerSupport())
|
||||
{
|
||||
createInfo.enabledLayerCount = static_cast<uint32_t>(validationLayers.size());
|
||||
createInfo.enabledLayerCount = static_cast<std::uint32_t>(validationLayers.size());
|
||||
createInfo.ppEnabledLayerNames = validationLayers.data();
|
||||
Render_Core::get().getLayers().populateDebugMessengerCreateInfo(debugCreateInfo);
|
||||
createInfo.pNext = static_cast<VkDebugUtilsMessengerCreateInfoEXT*>(&debugCreateInfo);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace mlx
|
||||
{
|
||||
Queues::QueueFamilyIndices Queues::findQueueFamilies(VkPhysicalDevice device, VkSurfaceKHR surface)
|
||||
{
|
||||
uint32_t queueFamilyCount = 0;
|
||||
std::uint32_t queueFamilyCount = 0;
|
||||
vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, nullptr);
|
||||
|
||||
std::vector<VkQueueFamilyProperties> queueFamilies(queueFamilyCount);
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace mlx
|
||||
public:
|
||||
struct QueueFamilyIndices
|
||||
{
|
||||
std::optional<uint32_t> graphicsFamily;
|
||||
std::optional<uint32_t> presentFamily;
|
||||
std::optional<std::uint32_t> graphicsFamily;
|
||||
std::optional<std::uint32_t> presentFamily;
|
||||
|
||||
inline bool isComplete() { return graphicsFamily.has_value() && presentFamily.has_value(); }
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace mlx
|
||||
if constexpr(!enableValidationLayers)
|
||||
return;
|
||||
|
||||
uint32_t extensionCount;
|
||||
std::uint32_t extensionCount;
|
||||
vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);
|
||||
std::vector<VkExtensionProperties> extensions(extensionCount);
|
||||
vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, extensions.data());
|
||||
@@ -56,7 +56,7 @@ namespace mlx
|
||||
|
||||
bool ValidationLayers::checkValidationLayerSupport()
|
||||
{
|
||||
uint32_t layerCount;
|
||||
std::uint32_t layerCount;
|
||||
vkEnumerateInstanceLayerProperties(&layerCount, nullptr);
|
||||
|
||||
std::vector<VkLayerProperties> availableLayers(layerCount);
|
||||
@@ -73,7 +73,7 @@ namespace mlx
|
||||
});
|
||||
}
|
||||
|
||||
VkResult ValidationLayers::setDebugUtilsObjectNameEXT(VkObjectType object_type, uint64_t object_handle, const char* object_name)
|
||||
VkResult ValidationLayers::setDebugUtilsObjectNameEXT(VkObjectType object_type, std::uint64_t object_handle, const char* object_name)
|
||||
{
|
||||
if(!real_vkSetDebugUtilsObjectNameEXT)
|
||||
return VK_ERROR_EXTENSION_NOT_PRESENT;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace mlx
|
||||
bool checkValidationLayerSupport();
|
||||
void populateDebugMessengerCreateInfo(VkDebugUtilsMessengerCreateInfoEXT& createInfo);
|
||||
|
||||
VkResult setDebugUtilsObjectNameEXT(VkObjectType object_type, uint64_t object_handle, const char* object_name);
|
||||
VkResult setDebugUtilsObjectNameEXT(VkObjectType object_type, std::uint64_t object_handle, const char* object_name);
|
||||
|
||||
~ValidationLayers() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user