Files
Seele/src/Engine/Graphics/Vulkan/Enums.h
T

71 lines
3.7 KiB
C++
Raw Normal View History

2020-03-09 12:30:07 +01:00
#pragma once
2023-10-26 18:37:29 +02:00
#include "Graphics/Enums.h"
2020-03-09 12:30:07 +01:00
#include <vulkan/vulkan.h>
#include <iostream>
2024-01-16 19:24:49 +01:00
#include <thread>
2020-03-09 12:30:07 +01:00
2020-04-12 15:47:19 +02:00
#define VK_CHECK(f) \
2023-11-11 13:56:12 +01:00
{ \
VkResult res = (f); \
if (res != VK_SUCCESS) \
{ \
if(res == VK_ERROR_DEVICE_LOST) \
{ \
std::this_thread::sleep_for(std::chrono::seconds(3)); \
} \
std::cout << "Fatal : VkResult is " << res << " in " << __FILE__ << " at line " << __LINE__ << std::endl; \
assert(res == VK_SUCCESS); \
} \
2020-04-12 15:47:19 +02:00
}
2020-03-09 12:30:07 +01:00
namespace Seele
{
2020-04-12 15:47:19 +02:00
namespace Vulkan
{
2020-05-05 01:51:13 +02:00
enum class ShaderType
{
VERTEX = 0,
2023-10-26 18:37:29 +02:00
FRAGMENT = 1,
COMPUTE = 2,
TASK = 3,
MESH = 4,
2020-05-05 01:51:13 +02:00
};
2020-04-12 15:47:19 +02:00
VkDescriptorType cast(const Gfx::SeDescriptorType &descriptorType);
Gfx::SeDescriptorType cast(const VkDescriptorType &descriptorType);
VkShaderStageFlagBits cast(const Gfx::SeShaderStageFlagBits &stage);
Gfx::SeShaderStageFlagBits cast(const VkShaderStageFlagBits &stage);
VkFormat cast(const Gfx::SeFormat &format);
Gfx::SeFormat cast(const VkFormat &format);
2021-05-10 23:57:55 +02:00
VkImageLayout cast(const Gfx::SeImageLayout &imageLayout);
Gfx::SeImageLayout cast(const VkImageLayout &imageLayout);
2020-04-12 15:47:19 +02:00
VkAttachmentStoreOp cast(const Gfx::SeAttachmentStoreOp &storeOp);
Gfx::SeAttachmentStoreOp cast(const VkAttachmentStoreOp &storeOp);
VkAttachmentLoadOp cast(const Gfx::SeAttachmentLoadOp &loadOp);
Gfx::SeAttachmentLoadOp cast(const VkAttachmentLoadOp &loadOp);
2020-05-05 01:51:13 +02:00
VkIndexType cast(const Gfx::SeIndexType &indexType);
Gfx::SeIndexType cast(const VkIndexType &indexType);
VkPrimitiveTopology cast(const Gfx::SePrimitiveTopology &topology);
Gfx::SePrimitiveTopology cast(const VkPrimitiveTopology &topology);
VkPolygonMode cast(const Gfx::SePolygonMode &mode);
Gfx::SePolygonMode cast(const VkPolygonMode &mode);
VkCompareOp cast(const Gfx::SeCompareOp &op);
Gfx::SeCompareOp cast(const VkCompareOp &op);
2020-10-23 01:47:56 +02:00
VkClearValue cast(const Gfx::SeClearValue &clear);
Gfx::SeClearValue cast(const VkClearValue &clear);
2022-04-15 11:19:30 +02:00
VkSamplerAddressMode cast(const Gfx::SeSamplerAddressMode &mode);
Gfx::SeSamplerAddressMode cast(const VkSamplerAddressMode &mode);
VkBorderColor cast(const Gfx::SeBorderColor &color);
Gfx::SeBorderColor cast(const VkBorderColor &color);
VkFilter cast(const Gfx::SeFilter &filter);
Gfx::SeFilter cast(const VkFilter &filter);
VkSamplerMipmapMode cast(const Gfx::SeSamplerMipmapMode &filter);
Gfx::SeSamplerMipmapMode cast(const VkSamplerMipmapMode &filter);
VkAccessFlagBits cast(const Gfx::SeAccessFlagBits &flags);
Gfx::SeAccessFlagBits cast(const VkAccessFlagBits &flags);
VkPipelineStageFlagBits cast(const Gfx::SePipelineStageFlagBits &flags);
Gfx::SePipelineStageFlagBits cast(const VkPipelineStageFlagBits &flags);
2020-04-12 15:47:19 +02:00
} // namespace Vulkan
2023-11-11 13:56:12 +01:00
} // namespace Seele