46 lines
2.7 KiB
C++
46 lines
2.7 KiB
C++
// =============================================
|
|
// Aster: helpers.h
|
|
// Copyright (c) 2020-2025 Anish Bhobe
|
|
// =============================================
|
|
|
|
#pragma once
|
|
|
|
#include "aster/aster.h"
|
|
|
|
#include "aster/core/queue_allocation.h"
|
|
|
|
#include "EASTL/span.h"
|
|
#include <EASTL/vector.h>
|
|
#include <glm/gtc/matrix_transform.hpp>
|
|
|
|
struct PhysicalDevice;
|
|
class PhysicalDevices;
|
|
|
|
PhysicalDevice FindSuitableDevice(const PhysicalDevices &physicalDevices);
|
|
QueueAllocation FindAppropriateQueueAllocation(const PhysicalDevice *physicalDevice);
|
|
|
|
template <usize TSize>
|
|
using StackString = eastl::fixed_string<char, TSize, false>;
|
|
|
|
#define AbortIfFailed(RESULT) \
|
|
do \
|
|
{ \
|
|
vk::Result _checkResultValue_; \
|
|
ERROR_IF(Failed(_checkResultValue_ = static_cast<vk::Result>(RESULT)), "Cause: {}", _checkResultValue_) \
|
|
THEN_ABORT(_checkResultValue_); \
|
|
} while (false)
|
|
|
|
#define AbortIfFailedMV(RESULT, MSG, EXTRA) \
|
|
do \
|
|
{ \
|
|
vk::Result _checkResultValue_; \
|
|
ERROR_IF(Failed(_checkResultValue_ = static_cast<vk::Result>(RESULT)), MSG " Cause: {}", EXTRA, _checkResultValue_) \
|
|
THEN_ABORT(_checkResultValue_); \
|
|
} while (false)
|
|
|
|
#define AbortIfFailedM(RESULT, MSG) \
|
|
do \
|
|
{ \
|
|
auto _checkResultValue_ = static_cast<vk::Result>(RESULT); \
|
|
ERROR_IF(Failed(_checkResultValue_), MSG " Cause: {}", _checkResultValue_) THEN_ABORT(_checkResultValue_); \
|
|
} while (false) |