diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-01-18 15:44:39 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2022-01-18 15:44:39 +0100 |
| commit | 3eafc2ca291cc5b3bfff10574cc0aee0ee103d6d (patch) | |
| tree | 911f10ca42ce65b3f1054031d441cdc7bb178a0d /src/vkvg_device_internal.c | |
| parent | bd47ebdd386fa691a390959c52e7f28c94605181 (diff) | |
store vbo/ibo caches, points and pathes arrays in threaded objectstinycthread
Diffstat (limited to 'src/vkvg_device_internal.c')
| -rw-r--r-- | src/vkvg_device_internal.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/vkvg_device_internal.c b/src/vkvg_device_internal.c index 1049230..1e83e4e 100644 --- a/src/vkvg_device_internal.c +++ b/src/vkvg_device_internal.c @@ -101,6 +101,11 @@ void _delete_threaded_object (VkvgDevice dev, vkvg_device_thread_items_t* throbj vkDestroyDescriptorPool (dev->vkDev, throbjs->descriptorPool,NULL); + free(throbjs->vertexCache); + free(throbjs->indexCache); + free(throbjs->pathes); + free(throbjs->points); + free (throbjs); } void _add_threaded_objects (VkvgDevice dev, vkvg_device_thread_items_t* throbjs) { @@ -126,8 +131,18 @@ vkvg_device_thread_items_t* _get_or_create_threaded_objects (VkvgDevice dev, thr tmp = (vkvg_device_thread_items_t*)calloc(1, sizeof(vkvg_device_thread_items_t)); tmp->id = thrd_current(); tmp->dev = dev; - tmp->sizeVBO = VKVG_VBO_SIZE; - tmp->sizeIBO = VKVG_IBO_SIZE; + tmp->sizeVertices = tmp->sizeVBO = VKVG_VBO_SIZE; + tmp->sizeIndices = tmp->sizeIBO = VKVG_IBO_SIZE; + tmp->sizePoints = VKVG_PTS_SIZE; + tmp->sizeVertices = VKVG_VBO_SIZE; + tmp->sizeIndices = VKVG_IBO_SIZE; + tmp->sizePathes = VKVG_PATHES_SIZE; + + tmp->points = (vec2*)malloc (VKVG_VBO_SIZE*sizeof(vec2)); + tmp->pathes = (uint32_t*)malloc (VKVG_PATHES_SIZE*sizeof(uint32_t)); + tmp->vertexCache = (Vertex*)malloc(tmp->sizeVertices * sizeof(Vertex)); + tmp->indexCache = (VKVG_IBO_INDEX_TYPE*)malloc(tmp->sizeIndices * sizeof(VKVG_IBO_INDEX_TYPE)); + const VkDescriptorPoolSize descriptorPoolSize[] = { {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 2 }, |