ULRE/inc/hgl/graph/VK.h

168 lines
3.2 KiB
C
Raw Normal View History

#ifndef HGL_GRAPH_VULKAN_INCLUDE
#define HGL_GRAPH_VULKAN_INCLUDE
2023-07-28 20:17:46 +08:00
#include<hgl/type/List.h>
#include<hgl/math/Math.h>
2020-11-05 14:02:35 +08:00
#include<hgl/type/String.h>
#include<hgl/type/Map.h>
#include<hgl/graph/VKNamespace.h>
#include<hgl/graph/VKFormat.h>
2022-06-24 17:51:05 +08:00
#include<hgl/graph/VKPrimitiveType.h>
#include<hgl/graph/VKStruct.h>
#include<hgl/graph/VKRenderbufferInfo.h>
VK_NAMESPACE_BEGIN
2021-09-13 20:39:25 +08:00
#ifndef VK_DESCRIPTOR_TYPE_BEGIN_RANGE
constexpr size_t VK_DESCRIPTOR_TYPE_BEGIN_RANGE=VK_DESCRIPTOR_TYPE_SAMPLER;
#endif//VK_DESCRIPTOR_TYPE_BEGIN_RANGE
#ifndef VK_DESCRIPTOR_TYPE_END_RANGE
constexpr size_t VK_DESCRIPTOR_TYPE_END_RANGE=VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT;
#endif//VK_DESCRIPTOR_TYPE_END_RANGE
#ifndef VK_DESCRIPTOR_TYPE_RANGE_SIZE
constexpr size_t VK_DESCRIPTOR_TYPE_RANGE_SIZE=VK_DESCRIPTOR_TYPE_END_RANGE-VK_DESCRIPTOR_TYPE_BEGIN_RANGE+1;
#endif//VK_DESCRIPTOR_TYPE_RANGE_SIZE
2024-03-06 00:29:17 +08:00
using BindingMap =Map<AnsiString,int>;
2024-03-06 00:26:23 +08:00
using BindingMapArray =BindingMap[VK_DESCRIPTOR_TYPE_RANGE_SIZE];
2019-11-13 20:50:34 +08:00
2020-10-21 12:39:22 +08:00
class VulkanInstance;
class GPUPhysicalDevice;
class GPUDevice;
struct GPUDeviceAttribute;
class DeviceQueue;
class ImageView;
class Framebuffer;
struct Swapchain;
class RenderTarget;
class RTSwapchain;
class Texture;
2019-05-18 15:41:49 +08:00
class Texture1D;
class Texture1DArray;
class Texture2D;
class Texture2DArray;
class Texture3D;
class TextureCube;
class TextureCubeArray;
2019-05-18 15:41:49 +08:00
2019-05-18 16:10:42 +08:00
class Sampler;
class DeviceMemory;
class DeviceBuffer;
struct DeviceBufferData;
2024-05-28 02:21:33 +08:00
struct PrimitiveDataBuffer;
2024-05-27 01:42:10 +08:00
struct PrimitiveRenderData;
class VertexAttribBuffer;
2024-04-24 01:38:55 +08:00
using VAB=VertexAttribBuffer;
class IndexBuffer;
2020-10-21 12:39:22 +08:00
class GPUCmdBuffer;
class RenderCmdBuffer;
class TextureCmdBuffer;
2021-09-22 15:32:20 +08:00
class RenderPass;
class DeviceRenderPassManage;
2022-10-14 19:27:29 +08:00
class Fence;
class Semaphore;
2021-09-14 20:31:15 +08:00
struct PipelineLayoutData;
class DescriptorSet;
struct ShaderAttribute;
2020-07-20 17:31:33 +08:00
class ShaderResource;
class ShaderModule;
2021-06-16 20:29:25 +08:00
class ShaderModuleMap;
class MaterialDescriptorManager;
2021-06-16 20:29:25 +08:00
class Material;
class MaterialParameters;
2021-06-16 20:29:25 +08:00
class MaterialInstance;
struct PipelineData;
enum class InlinePipeline;
class Pipeline;
2021-11-29 17:04:55 +08:00
struct VAConfig;
class VILConfig;
class VertexInput;
2023-05-04 19:35:09 +08:00
struct VertexInputFormat;
2024-04-01 23:32:18 +08:00
using VIF=VertexInputFormat;
2023-05-04 19:35:09 +08:00
class VertexInputLayout;
using VIL=VertexInputLayout;
class PrimitiveData;
2022-06-24 17:51:05 +08:00
class Primitive;
class Renderable;
class VertexDataManager;
2020-10-21 12:39:22 +08:00
class RenderResource;
2020-09-02 18:27:19 +08:00
enum class SharingMode
{
Exclusive = 0,
Concurrent
};//
2020-10-23 21:21:09 +08:00
enum class Filter
{
Nearest=0,
Linear,
};//
2020-09-02 18:36:24 +08:00
enum ImageTiling
{
Optimal=0,
Linear
};//
inline const uint32_t GetMipLevel(const VkExtent2D &ext)
{
return hgl::GetMipLevel(ext.width,ext.height);
}
inline const uint32_t GetMipLevel(const VkExtent3D &ext)
{
return hgl::GetMipLevel(ext.width,ext.height,ext.depth);
}
2021-09-28 20:26:36 +08:00
/**
* ,VkIndexType
*/
2024-04-19 00:40:51 +08:00
enum IndexType:int
{
2024-04-19 00:40:51 +08:00
AUTO=-1,
U16=0,
2023-05-11 21:07:26 +08:00
U32,
U8=VK_INDEX_TYPE_UINT8_EXT,
2024-03-16 14:08:55 +08:00
ERR=VK_INDEX_TYPE_MAX_ENUM
};
2024-04-19 00:40:51 +08:00
inline const bool IsIndexType(const IndexType it)
{
return it>=U16&&it<=U8;
}
2023-12-24 01:35:30 +08:00
//Push Constant max-lengths:
//
// 256 bytes: nvidia,arm
// 128 bytes: amd,intel,powervr,adreno
2020-06-09 19:40:08 +08:00
2020-06-24 19:13:29 +08:00
inline void copy(VkExtent3D &e3d,const VkExtent2D &e2d,const uint32 depth=1)
{
e3d.width =e2d.width;
e3d.height =e2d.height;
2020-06-24 19:13:29 +08:00
e3d.depth =depth;
}
VK_NAMESPACE_END
#endif//HGL_GRAPH_VULKAN_INCLUDE