VkFlags usage;
VkSampleCountFlagBits samples;
size_t total_size;
+ tbm_surface_h tbm_surface;
};
struct nulldrv_mem {
static VkResult
nulldrv_img_create(struct nulldrv_dev *dev,
+ tbm_surface_h tbm_surface,
const VkImageCreateInfo *info,
bool scanout,
struct nulldrv_img **img_ret)
if (!img)
return VK_ERROR_OUT_OF_HOST_MEMORY;
+ img->tbm_surface = tbm_surface;
img->type = info->imageType;
img->depth = info->extent.depth;
img->mip_levels = info->mipLevels;
NULLDRV_LOG_FUNC;
struct nulldrv_dev *dev = nulldrv_dev(device);
- return nulldrv_img_create(dev, info, false,
+ return nulldrv_img_create(dev, NULL, info, false,
(struct nulldrv_img **) image);
}
return NULL;
}
+
+VK_EXPORT VkImage
+vk_create_presentable_image(VkDevice device, const VkImageCreateInfo *info, tbm_surface_h surface)
+{
+ NULLDRV_LOG_FUNC;
+ struct nulldrv_dev *dev = nulldrv_dev(device);
+ struct nulldrv_img *img;
+
+ if (nulldrv_img_create(dev, surface, info, false, &img) == VK_SUCCESS)
+ return (VkImage)img;
+
+ return NULL;
+}
#include <config.h>
#include <vulkan/vulkan.h>
+#include <tbm_surface.h>
VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
vk_icdGetInstanceProcAddr(VkInstance instance, const char *name);
+VkImage
+vk_create_presentable_image(VkDevice device, const VkImageCreateInfo *info, tbm_surface_h surface);
+
#endif /* NULL_DRIVER_H */