Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2022-06-16 21:07:02 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-06-16 21:07:02 +0300
commitc27a395d8cd8b58b3155cfdc26ae35198fbcdb14 (patch)
tree665b37d674c62451ddd954c6012bab9d9ec4a862 /source/blender/draw/intern/draw_cache_impl_curves.cc
parent29d24182b76be06b11c66138cb26cd63da0f9130 (diff)
parent209bf7780e7c005650482fa843062864f91845af (diff)
Merge branch 'master' into asset-greasepencil
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_curves.cc')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_curves.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_curves.cc b/source/blender/draw/intern/draw_cache_impl_curves.cc
index f9cf0021fcd..992ffe16a14 100644
--- a/source/blender/draw/intern/draw_cache_impl_curves.cc
+++ b/source/blender/draw/intern/draw_cache_impl_curves.cc
@@ -52,11 +52,14 @@ struct CurvesBatchCache {
GPUBatch *edit_points;
- /* To determine if cache is invalid. */
+ /* Whether the cache is invalid. */
bool is_dirty;
- /** Needed when updating material data (e.g. attributes) as the same curves might be used for
- * multiple objects with different materials. */
+ /**
+ * The draw cache extraction is currently not multi-threaded for multiple objects, but if it was,
+ * some locking would be necessary because multiple objects can use the same curves data with
+ * different materials, etc. This is a placeholder to make multi-threading easier in the future.
+ */
ThreadMutex render_mutex;
};
@@ -160,7 +163,7 @@ void DRW_curves_batch_cache_dirty_tag(Curves *curves, int mode)
cache->is_dirty = true;
break;
default:
- BLI_assert(0);
+ BLI_assert_unreachable();
}
}
@@ -512,9 +515,9 @@ static bool curves_ensure_attributes(const Curves &curves,
ListBase gpu_attrs = GPU_material_attributes(gpu_material);
LISTBASE_FOREACH (GPUMaterialAttribute *, gpu_attr, &gpu_attrs) {
const char *name = gpu_attr->name;
- int type = gpu_attr->type;
+ eCustomDataType type = static_cast<eCustomDataType>(gpu_attr->type);
int layer = -1;
- AttributeDomain domain;
+ eAttrDomain domain;
if (drw_custom_data_match_attribute(cd_curve, name, &layer, &type)) {
domain = ATTR_DOMAIN_CURVE;
@@ -527,8 +530,6 @@ static bool curves_ensure_attributes(const Curves &curves,
}
switch (type) {
- default:
- break;
case CD_PROP_BOOL:
case CD_PROP_INT8:
case CD_PROP_INT32:
@@ -538,13 +539,15 @@ static bool curves_ensure_attributes(const Curves &curves,
case CD_PROP_COLOR: {
if (layer != -1) {
DRW_AttributeRequest *req = drw_attributes_add_request(
- &attrs_needed, (CustomDataType)type, layer, domain);
+ &attrs_needed, (eCustomDataType)type, layer, domain);
if (req) {
BLI_strncpy(req->attribute_name, name, sizeof(req->attribute_name));
}
}
break;
}
+ default:
+ break;
}
}