* Device holds the font cache so that each time a context draws text, the same cache is used.
*
* @{ */
-
+/**
+ * @brief vkvg device creation structure
+ *
+ * Structure used to pass parameter to the device creation method.
+ *
+ * @code
+ * x_new = xx * x + xy * y + x0;
+ * y_new = yx * x + yy * y + y0;
+ * @endcode
+ *
+ * @samples: sample count.
+ * @inst: vulkan instance used to create device, may be null to create a new instance.
+ * @phy: vulkan physical device to create vkvg device for, may be null.
+ * @vkdev: vulkan logical device, may be null to create a new one.
+ * @qFamIdx: graphic queue family index, ignored if vkdev is NULL.
+ * @qIndex: queue index, ignored if vkdev is NULL.
+ */
+typedef struct {
+ VkSampleCountFlags samples;
+ VkInstance inst;
+ VkPhysicalDevice phy;
+ VkDevice vkdev;
+ uint32_t qFamIdx;
+ uint32_t qIndex;
+}vkvg_device_create_info_t;
/**
* @brief Set device ready for multithreading.
*
/**
* @brief Create a new vkvg device.
*
- * Create a new #VkvgDevice owning vulkan instance and device.
+ * Create a new #VkvgDevice.
*
* On success, create a new vkvg device and set its reference count to 1.
* On error, you may query the device status by calling @ref vkvg_device_status. Error could be
* to #vkvg_surface_resolve() or
*/
vkvg_public
-VkvgDevice vkvg_device_create (VkSampleCountFlags samples, bool deferredResolve);
+VkvgDevice vkvg_device_create (vkvg_device_create_info_t* info);
/**
* @brief Create a new vkvg device from an existing vulkan logical device.
*
}
-VkvgDevice vkvg_device_create (VkSampleCountFlags samples, bool deferredResolve) {
+VkvgDevice vkvg_device_create (vkvg_device_create_info_t* info) {
LOG(VKVG_LOG_INFO, "CREATE Device\n");
VkvgDevice dev = (vkvg_device*)calloc(1,sizeof(vkvg_device));
if (!dev) {
if (!_device_try_get_phyinfo(phys, phyCount, VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU, &pi))
pi = phys[0];
- if (!(pi->properties.limits.framebufferColorSampleCounts&samples)) {
- LOG(VKVG_LOG_ERR, "CREATE Device failed: sample count not supported: %d\n", samples);
+ if (!(pi->properties.limits.framebufferColorSampleCounts & info->samples)) {
+ LOG(VKVG_LOG_ERR, "CREATE Device failed: sample count not supported: %d\n", info->samples);
dev->status = VKVG_STATUS_DEVICE_ERROR;
vkh_app_free_phyinfos (phyCount, phys);
vkh_app_destroy (app);
vkh_device_get_phy(vkhd),
vkh_device_get_vkdev(vkhd),
pi->gQueue, 0,
- samples, deferredResolve);
+ info->samples, deferredResolve);
dev->vkhDev = vkhd;