append codes that they can output queue family properties of physical device.
This commit is contained in:
@@ -27,6 +27,18 @@ namespace hgl
|
||||
}//namespace hgl
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
/*
|
||||
* GPU设备创建信息
|
||||
*/
|
||||
struct GPUDeviceCreateInfo
|
||||
{
|
||||
VkPhysicalDeviceType device_type =VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM;
|
||||
|
||||
uint32_t swapchain_image_count =0;
|
||||
VkSurfaceFormatKHR color_format ={PF_A2BGR10UN,VK_COLOR_SPACE_SRGB_NONLINEAR_KHR};
|
||||
VkFormat depth_format =VK_FORMAT_UNDEFINED;
|
||||
};//struct GPUDeviceCreateInfo
|
||||
|
||||
class GPUDevice
|
||||
{
|
||||
GPUDeviceAttribute *attr;
|
||||
|
@@ -59,8 +59,9 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
void RefreshSurface();
|
||||
void RefreshQueueFamily();
|
||||
void GetSurfaceFormatList();
|
||||
void GetSurfacePresentMode();
|
||||
void GetQueueFamily();
|
||||
|
||||
public:
|
||||
|
||||
|
@@ -15,6 +15,7 @@ class GPUPhysicalDevice
|
||||
VkPhysicalDeviceMemoryProperties memory_properties;
|
||||
List<VkLayerProperties> layer_properties;
|
||||
List<VkExtensionProperties> extension_properties;
|
||||
List<VkQueueFamilyProperties> queue_family_properties;
|
||||
|
||||
public:
|
||||
|
||||
@@ -48,20 +49,6 @@ public:
|
||||
|
||||
const uint32_t GetConstantSize ()const{return properties.limits.maxPushConstantsSize;}
|
||||
|
||||
// support != open, so please don't direct use GetFeatures().
|
||||
// open any features in CreateDevice()&SetDeviceFeatures() functions.
|
||||
const bool IsSupportMDI ()const
|
||||
{
|
||||
// I found a few device support MDI, but its MaxDrawIndirectCount is 1.
|
||||
|
||||
return (features.multiDrawIndirect&&properties.limits.maxDrawIndirectCount>1);
|
||||
}
|
||||
|
||||
const uint32_t GetMaxMDICount ()const
|
||||
{
|
||||
return properties.limits.maxDrawIndirectCount;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
@@ -112,9 +99,23 @@ public:
|
||||
public:
|
||||
|
||||
const VkBool32 SupportGeometryShader ()const{return features.geometryShader;}
|
||||
const VkBool32 SupportMultiDrawIndirect ()const{return features.multiDrawIndirect;}
|
||||
const VkBool32 SupportCubeMapArray ()const{return features.imageCubeArray;}
|
||||
|
||||
|
||||
// support != open, so please don't direct use GetFeatures().
|
||||
// open any features in CreateDevice()&SetDeviceFeatures() functions.
|
||||
const bool SupportMDI ()const
|
||||
{
|
||||
// I found a few device support MDI, but its MaxDrawIndirectCount is 1.
|
||||
|
||||
return (features.multiDrawIndirect&&properties.limits.maxDrawIndirectCount>1);
|
||||
}
|
||||
|
||||
const uint32_t GetMaxMDICount ()const
|
||||
{
|
||||
return properties.limits.maxDrawIndirectCount;
|
||||
}
|
||||
|
||||
const uint32_t GetMaxImage1D ()const{return properties.limits.maxImageDimension1D;}
|
||||
const uint32_t GetMaxImage2D ()const{return properties.limits.maxImageDimension2D;}
|
||||
const uint32_t GetMaxImage3D ()const{return properties.limits.maxImageDimension3D;}
|
||||
|
Reference in New Issue
Block a user