ULRE/inc/hgl/graph/VKDeviceAttribute.h

69 lines
2.1 KiB
C
Raw Normal View History

#pragma once
2021-09-23 22:13:57 +08:00
#include<hgl/graph/VKInstance.h>
#include<hgl/graph/VKTexture.h>
2021-11-23 11:54:35 +08:00
#ifdef _DEBUG
#include<hgl/graph/VKDebugMaker.h>
#endif//_DEBUG
VK_NAMESPACE_BEGIN
2019-04-11 20:24:09 +08:00
constexpr uint32_t ERROR_FAMILY_INDEX=UINT32_MAX;
2020-10-21 12:39:22 +08:00
struct GPUDeviceAttribute
{
2021-09-23 22:13:57 +08:00
VulkanInstance * instance =nullptr;
2020-10-21 12:39:22 +08:00
const GPUPhysicalDevice * physical_device =nullptr;
2020-10-28 17:28:07 +08:00
VkPhysicalDeviceDriverPropertiesKHR driver_properties;
2019-07-06 16:46:19 +08:00
VkSurfaceKHR surface =VK_NULL_HANDLE;
VkSurfaceCapabilitiesKHR surface_caps;
2019-04-11 20:24:09 +08:00
uint32_t graphics_family =ERROR_FAMILY_INDEX;
uint32_t present_family =ERROR_FAMILY_INDEX;
2019-07-06 16:46:19 +08:00
VkQueue graphics_queue =VK_NULL_HANDLE;
VkQueue present_queue =VK_NULL_HANDLE;
List<VkQueueFamilyProperties> family_properties;
List<VkBool32> supports_present;
List<VkSurfaceFormatKHR> surface_formats_list;
VkSurfaceFormatKHR surface_format;
List<VkPresentModeKHR> present_modes;
2019-04-11 20:24:09 +08:00
VkSurfaceTransformFlagBitsKHR preTransform;
VkCompositeAlphaFlagBitsKHR compositeAlpha =VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
2019-07-06 16:46:19 +08:00
VkDevice device =VK_NULL_HANDLE;
VkCommandPool cmd_pool =VK_NULL_HANDLE;
2019-04-11 21:12:54 +08:00
2019-07-06 16:46:19 +08:00
VkDescriptorPool desc_pool =VK_NULL_HANDLE;
2019-07-06 16:46:19 +08:00
VkPipelineCache pipeline_cache =VK_NULL_HANDLE;
2021-11-23 11:54:35 +08:00
#ifdef _DEBUG
DebugMaker * debug_maker =nullptr;
#endif//_DEBUG
2019-04-12 16:35:44 +08:00
public:
2021-09-23 22:13:57 +08:00
GPUDeviceAttribute(VulkanInstance *inst,const GPUPhysicalDevice *pd,VkSurfaceKHR s);
2020-10-21 12:39:22 +08:00
~GPUDeviceAttribute();
bool CheckMemoryType(uint32_t typeBits,VkMemoryPropertyFlags properties,uint32_t *typeIndex) const;
void Refresh();
2021-09-23 22:13:57 +08:00
public:
template<typename T>
T *GetDeviceProc(const char *name)
{
return instance->GetDeviceProc<T>(device,name);
}
2020-10-21 12:39:22 +08:00
};//class GPUDeviceAttribute
VK_NAMESPACE_END