]> O.S.I.I.S - jp/vkvg.git/commitdiff
removed unnecessary ctx->source 122/head
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 22 Apr 2022 18:41:34 +0000 (20:41 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 22 Apr 2022 18:41:34 +0000 (20:41 +0200)
include/vkvg.h
src/vkvg_context_internal.c
src/vkvg_context_internal.h

index 27f562c5cf92121447cebab709471f40205b7e9f..212511f72cbe925a123e067977e7e7e014266814 100644 (file)
@@ -137,7 +137,8 @@ typedef enum {
        VKVG_STATUS_DEVICE_ERROR,                       /*!< vkvg device initialization error */
        VKVG_STATUS_INVALID_IMAGE,                      /*!< */
        VKVG_STATUS_INVALID_SURFACE,            /*!< */
-       VKVG_STATUS_INVALID_FONT                        /*!< Unresolved font name*/
+       VKVG_STATUS_INVALID_FONT,                       /*!< Unresolved font name*/
+       VKVG_STATUS_ENUM_MAX = 0x7FFFFFFF
 }vkvg_status_t;
 
 typedef enum {
@@ -543,7 +544,14 @@ void vkvg_matrix_get_scale (const vkvg_matrix_t *matrix, float *sx, float *sy);
  * @{ */
 
 /**
- * @brief vkvg_device_set_thread_aware
+ * @brief Set device ready for multithreading.
+ *
+ * If thread aware mode is set to true,
+ *
+ * This method should be called only once on device creation. If this method is called while some surfaces or patterns are
+ * in use, this could have unexpected results.
+ *
+ *
  * @param dev
  * @param thread_awayre
  */
index d14ad4f4847d244a658464e37cdd1526057b328b..867c987ca6461459e0bf3cf1d8344dee9c12dd72 100644 (file)
@@ -726,7 +726,7 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) {
                if (ctx->cmdStarted){//transition of img without appropriate dependencies in subpass must be done outside renderpass.
                        _end_render_pass (ctx);
                        _flush_vertices_caches (ctx);
-               }else {
+               } else {
                        vkh_cmd_begin (ctx->cmd,VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT);
                        ctx->cmdStarted = true;
                }
@@ -741,8 +741,6 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) {
                if (!_wait_ctx_flush_end (ctx))
                        return;
 
-               ctx->source = surf->img;
-
                VkSamplerAddressMode addrMode = 0;
                VkFilter filter = VK_FILTER_NEAREST;
                switch (pat->extend) {
@@ -768,10 +766,10 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) {
                        filter = VK_FILTER_NEAREST;
                        break;
                }
-               vkh_image_create_sampler (ctx->source, filter, filter,
+               vkh_image_create_sampler (surf->img, filter, filter,
                                                                        VK_SAMPLER_MIPMAP_MODE_NEAREST, addrMode);
 
-               _update_descriptor_set (ctx, ctx->source, ctx->dsSrc);
+               _update_descriptor_set (ctx, surf->img, ctx->dsSrc);
 
                if (pat->hasMatrix) {
 
index a558ff3939d99a7a790063bfcdef91b550f224ab..cff7889b7be696243293f7d9ea24e34a470a9da1 100644 (file)
@@ -136,7 +136,7 @@ typedef struct _vkvg_context_t {
 #else
        VkFence                         flushFence;             //context fence
 #endif
-       VkhImage                        source;                 //source of painting operation
+       //VkDescriptorImageInfo sourceDescriptor;       //Store view/sampler in context
 
        VkCommandPool           cmdPool;                //local pools ensure thread safety
        VkCommandBuffer         cmdBuffers[2];  //double cmd buff for context operations