Blender V4.5
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_mutex.hh"
18#include "BLI_string_ref.hh"
19#include "BLI_sys_types.h"
20
21#include "BLI_vector_set.hh"
22
23namespace blender::bke {
24enum class AttrDomain : int8_t;
25}
26
27namespace blender::draw {
28
30 uint32_t uv : 8;
31 uint32_t tan : 8;
32 uint32_t orco : 1;
33 uint32_t tan_orco : 1;
34 uint32_t sculpt_overlays : 1;
38 uint32_t edit_uv : 1;
39};
40
41/* Keep `DRW_MeshCDMask` struct within a `uint32_t`.
42 * bit-wise and atomic operations are used to compare and update the struct.
43 * See `mesh_cd_layers_type_*` functions. */
44static_assert(sizeof(DRW_MeshCDMask) <= sizeof(uint32_t), "DRW_MeshCDMask exceeds 32 bits");
45
47 const VectorSet<std::string> *src,
48 Mutex &render_mutex);
49
50/* Return true if all requests in b are in a. */
52
54
55bool drw_custom_data_match_attribute(const CustomData &custom_data,
56 StringRef name,
57 int *r_layer_index,
58 eCustomDataType *r_type);
59
60} // namespace blender::draw
void drw_attributes_add_request(VectorSet< std::string > *attrs, const StringRef name)
void drw_attributes_merge(VectorSet< std::string > *dst, const VectorSet< std::string > *src, Mutex &render_mutex)
bool drw_attributes_overlap(const VectorSet< std::string > *a, const VectorSet< std::string > *b)
bool drw_custom_data_match_attribute(const CustomData &custom_data, const StringRef name, int *r_layer_index, eCustomDataType *r_type)
std::mutex Mutex
Definition BLI_mutex.hh:47