fixed a bug that error in getting the value of features/properties of vkPhysicalDevice

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-06-14 20:17:10 +08:00
parent b72144a28b
commit b43d4cc5a3
2 changed files with 10 additions and 8 deletions

View File

@ -48,6 +48,8 @@ public:
operator VkPhysicalDevice() {return physical_device;} operator VkPhysicalDevice() {return physical_device;}
operator const VkPhysicalDevice()const {return physical_device;} operator const VkPhysicalDevice()const {return physical_device;}
const uint32_t GetVulkanVersion()const{return properties.apiVersion;}
const int GetMemoryType(uint32_t,VkMemoryPropertyFlags)const; const int GetMemoryType(uint32_t,VkMemoryPropertyFlags)const;
VkPhysicalDeviceType GetDeviceType()const{return properties.deviceType;} VkPhysicalDeviceType GetDeviceType()const{return properties.deviceType;}

View File

@ -61,6 +61,10 @@ GPUPhysicalDevice::GPUPhysicalDevice(VkInstance inst,VkPhysicalDevice pd)
physical_device=pd; physical_device=pd;
{ {
hgl_zero(features11);
hgl_zero(features12);
hgl_zero(features13);
auto func=(PFN_vkGetPhysicalDeviceFeatures2KHR)vkGetInstanceProcAddr(inst,"vkGetPhysicalDeviceFeatures2KHR"); auto func=(PFN_vkGetPhysicalDeviceFeatures2KHR)vkGetInstanceProcAddr(inst,"vkGetPhysicalDeviceFeatures2KHR");
if(func) if(func)
@ -86,14 +90,14 @@ GPUPhysicalDevice::GPUPhysicalDevice(VkInstance inst,VkPhysicalDevice pd)
else else
{ {
vkGetPhysicalDeviceFeatures(physical_device,&features); vkGetPhysicalDeviceFeatures(physical_device,&features);
hgl_zero(features11);
hgl_zero(features12);
hgl_zero(features13);
} }
} }
{ {
hgl_zero(properties11);
hgl_zero(properties12);
hgl_zero(properties13);
auto func=(PFN_vkGetPhysicalDeviceProperties2KHR)vkGetInstanceProcAddr(inst,"vkGetPhysicalDeviceProperties2KHR"); auto func=(PFN_vkGetPhysicalDeviceProperties2KHR)vkGetInstanceProcAddr(inst,"vkGetPhysicalDeviceProperties2KHR");
if(func) if(func)
@ -119,10 +123,6 @@ GPUPhysicalDevice::GPUPhysicalDevice(VkInstance inst,VkPhysicalDevice pd)
else else
{ {
vkGetPhysicalDeviceProperties(physical_device,&properties); vkGetPhysicalDeviceProperties(physical_device,&properties);
hgl_zero(properties11);
hgl_zero(properties12);
hgl_zero(properties13);
} }
} }