VkPhysicalDeviceProperties vkh_app_get_phy_properties (VkhApp app, uint32_t phyIndex);
// VkhPhy
VkhPhyInfo vkh_phyinfo_create (VkhApp app, VkPhysicalDevice phy);
-void vkh_phyinfo_destroy (VkhPhyInfo phy);
+void vkh_phyinfo_destroy (VkhPhyInfo phy);
+// VkhDevice
+VkhDevice vkh_device_create (VkPhysicalDevice phy, VkDevice vkDev);
+void vkh_device_destroy (VkhDevice dev);
// VkhImage
VkhImage vkh_image_create (VkhDevice pDev, VkFormat format, uint32_t width, uint32_t height, VkImageTiling tiling,
VkMemoryPropertyFlags memprops, VkImageUsageFlags usage);
*/
#include "vkh_device.h"
+VkhDevice vkh_device_create (VkPhysicalDevice phy, VkDevice vkDev) {
+ VkhDevice dev = (vkh_device_t*)malloc(sizeof(vkh_device_t));
+ dev->dev = vkDev;
+ dev->phy = phy;
+
+ vkGetPhysicalDeviceMemoryProperties (phy, &dev->phyMemProps);
+ return dev;
+}
+
+void vkh_device_destroy (VkhDevice dev) {
+ free (dev);
+}
#include "vkh.h"
typedef struct _vkh_device_t{
- VkDevice dev;
- VkPhysicalDeviceMemoryProperties phyMemProps;
- VkRenderPass renderPass;
- VkPhysicalDevice phy;
+ VkDevice dev;
+ VkPhysicalDeviceMemoryProperties phyMemProps;
+ VkPhysicalDevice phy;
}vkh_device_t;
#endif