summaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2022-04-22 20:41:34 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2022-04-22 20:41:34 +0200
commitd80262e20ab307357585407c102509b3776097d4 (patch)
treed87bd760000978299ef501b952ad2481f0706cde
parentfd3434e4f84ef83ef26a87ffe380fd6e3371b9b6 (diff)
removed unnecessary ctx->source
-rw-r--r--include/vkvg.h12
-rw-r--r--src/vkvg_context_internal.c8
-rw-r--r--src/vkvg_context_internal.h2
3 files changed, 14 insertions, 8 deletions
diff --git a/include/vkvg.h b/include/vkvg.h
index 27f562c..212511f 100644
--- a/include/vkvg.h
+++ b/include/vkvg.h
@@ -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
*/
diff --git a/src/vkvg_context_internal.c b/src/vkvg_context_internal.c
index d14ad4f..867c987 100644
--- a/src/vkvg_context_internal.c
+++ b/src/vkvg_context_internal.c
@@ -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) {
diff --git a/src/vkvg_context_internal.h b/src/vkvg_context_internal.h
index a558ff3..cff7889 100644
--- a/src/vkvg_context_internal.h
+++ b/src/vkvg_context_internal.h
@@ -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