diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-18 12:48:51 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-18 12:48:51 +0300 |
commit | 3c2a2a6c9659dd66f1a1d3a5e4153d1d2f8243eb (patch) | |
tree | 187df41cf88419bf6f0b47a863aa7967baf73cb3 /source/blender/draw/intern/draw_attributes.cc | |
parent | 8a3ff496a737daa9ce5a33c2699ac0b20e52e8f0 (diff) |
Cleanup: Always store attribute name in attribute request
Previously the attribute name was only stored in the request for curves.
Instead, pass it as part of the "add request" function, so that it is
always used. Since the whole attribute pipeline is name-based,
this can simplify code in a few places.
Diffstat (limited to 'source/blender/draw/intern/draw_attributes.cc')
-rw-r--r-- | source/blender/draw/intern/draw_attributes.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_attributes.cc b/source/blender/draw/intern/draw_attributes.cc index 8fb4210901f..3f187aef8e6 100644 --- a/source/blender/draw/intern/draw_attributes.cc +++ b/source/blender/draw/intern/draw_attributes.cc @@ -65,9 +65,10 @@ bool drw_attributes_overlap(const DRW_Attributes *a, const DRW_Attributes *b) } DRW_AttributeRequest *drw_attributes_add_request(DRW_Attributes *attrs, - eCustomDataType type, - int layer, - eAttrDomain domain) + const char *name, + const eCustomDataType type, + const int layer_index, + const eAttrDomain domain) { if (attrs->num_requests >= GPU_MAX_ATTR) { return nullptr; @@ -75,7 +76,8 @@ DRW_AttributeRequest *drw_attributes_add_request(DRW_Attributes *attrs, DRW_AttributeRequest *req = &attrs->requests[attrs->num_requests]; req->cd_type = type; - req->layer_index = layer; + BLI_strncpy(req->attribute_name, name, sizeof(req->attribute_name)); + req->layer_index = layer_index; req->domain = domain; attrs->num_requests += 1; return req; |