updated, needs fixes
[vkrt] / src / vk.h
index 97496b8..f28930f 100644 (file)
--- a/src/vk.h
+++ b/src/vk.h
@@ -10,7 +10,6 @@ struct vk_ctx
        VkInstance inst;
        VkPhysicalDevice pdev;
        VkDevice dev;
-       VkPipelineCache cache;
 
        VkCommandPool cmd_pool;
        VkCommandBuffer cmd_buf;
@@ -38,6 +37,8 @@ struct vk_image_props
 
        VkImageLayout in_layout;
        VkImageLayout end_layout;
+
+    bool need_export;
 };
 
 struct vk_mem_obj {
@@ -48,12 +49,7 @@ struct vk_mem_obj {
 
 struct vk_image_obj {
        VkImage img;
-       struct vk_mem_obj mobj;
-};
-
-struct vk_buf
-{
-       VkBuffer buf;
+    VkImageView img_view;
        struct vk_mem_obj mobj;
 };
 
@@ -70,6 +66,13 @@ struct vk_vertex_info
        VkPrimitiveTopology topology;
 };
 
+struct vk_buf
+{
+       VkBuffer buf;
+       struct vk_mem_obj mobj;
+};
+
+
 struct vk_renderer
 {
        VkPipeline pipeline;
@@ -120,15 +123,16 @@ vk_fill_ext_image_props(struct vk_ctx *ctx,
                                                uint32_t num_layers,
                                                VkFormat format,
                                                VkImageTiling tiling,
-                                               VkImageUsageFlagBits usage,
                                                VkImageLayout in_layout,
                                                VkImageLayout end_layout,
+                        bool need_export,
                                                struct vk_image_props *props);
 
 /* buffers */
 
 bool
 vk_create_buffer(struct vk_ctx *ctx,
+                 bool is_external,
                                 uint32_t sz,
                                 VkBufferUsageFlagBits usage,
                                 void *pnext,
@@ -142,6 +146,13 @@ vk_update_buffer_data(struct vk_ctx *ctx,
                                          uint32_t data_sz,
                                          struct vk_buf *bo);
 
+bool
+vk_create_ext_buffer(struct vk_ctx *ctx,
+                    uint32_t sz,
+                    VkBufferUsageFlagBits usage,
+                    struct vk_buf *bo);
+
+
 /* semaphores */
 
 bool
@@ -183,6 +194,18 @@ vk_draw(struct vk_ctx *ctx,
                uint32_t n_attachments,
                float x, float y, float w, float h);
 
+void
+vk_clear_color(struct vk_ctx *ctx,
+               struct vk_buf *vbo,
+               struct vk_renderer *renderer,
+               float *vk_fb_color,
+               uint32_t vk_fb_color_count,
+               struct vk_semaphores *semaphores,
+               bool has_wait, bool has_signal,
+               struct vk_image_att *attachments,
+               uint32_t n_attachments,
+               float x, float y, float w, float h);
+
 /* transitions */
 
 void