Blender V5.0
draw_attributes.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#pragma once
12
13#include <string>
14
16
17#include "BLI_string_ref.hh"
18#include "BLI_sys_types.h"
19
20#include "BLI_vector_set.hh"
21
22namespace blender::bke {
23enum class AttrDomain : int8_t;
24}
25
26namespace blender::draw {
27
29 uint32_t uv : 8;
30 uint32_t tan : 8;
31 uint32_t orco : 1;
32 uint32_t tan_orco : 1;
33 uint32_t sculpt_overlays : 1;
37 uint32_t edit_uv : 1;
38};
39
40/* Keep `DRW_MeshCDMask` struct within a `uint32_t`.
41 * bit-wise and atomic operations are used to compare and update the struct.
42 * See `mesh_cd_layers_type_*` functions. */
43static_assert(sizeof(DRW_MeshCDMask) <= sizeof(uint32_t), "DRW_MeshCDMask exceeds 32 bits");
44
46
47/* Return true if all requests in b are in a. */
49
51
52bool drw_custom_data_match_attribute(const CustomData &custom_data,
54 int *r_layer_index,
55 eCustomDataType *r_type);
56
57} // namespace blender::draw
void drw_attributes_add_request(VectorSet< std::string > *attrs, const StringRef name)
bool drw_attributes_overlap(const VectorSet< std::string > *a, const VectorSet< std::string > *b)
void drw_attributes_merge(VectorSet< std::string > *dst, const VectorSet< std::string > *src)
bool drw_custom_data_match_attribute(const CustomData &custom_data, const StringRef name, int *r_layer_index, eCustomDataType *r_type)
const char * name