38 uint32_t component_len)
40 switch (component_type) {
44 switch (component_len) {
46 return VertAttrType::SNORM_8_DEPRECATED;
48 return VertAttrType::SNORM_8_8_DEPRECATED;
50 return VertAttrType::SNORM_8_8_8_DEPRECATED;
52 return VertAttrType::SNORM_8_8_8_8;
56 switch (component_len) {
58 return VertAttrType::SINT_8_DEPRECATED;
60 return VertAttrType::SINT_8_8_DEPRECATED;
62 return VertAttrType::SINT_8_8_8_DEPRECATED;
64 return VertAttrType::SINT_8_8_8_8;
75 switch (component_len) {
77 return VertAttrType::UNORM_8_DEPRECATED;
79 return VertAttrType::UNORM_8_8_DEPRECATED;
81 return VertAttrType::UNORM_8_8_8_DEPRECATED;
83 return VertAttrType::UNORM_8_8_8_8;
87 switch (component_len) {
89 return VertAttrType::UINT_8_DEPRECATED;
91 return VertAttrType::UINT_8_8_DEPRECATED;
93 return VertAttrType::UINT_8_8_8_DEPRECATED;
95 return VertAttrType::UINT_8_8_8_8;
104 switch (fetch_mode) {
106 switch (component_len) {
108 return VertAttrType::SNORM_16_DEPRECATED;
110 return VertAttrType::SNORM_16_16;
112 return VertAttrType::SNORM_16_16_16_DEPRECATED;
114 return VertAttrType::SNORM_16_16_16_16;
118 switch (component_len) {
120 return VertAttrType::SINT_16_DEPRECATED;
122 return VertAttrType::SINT_16_16;
124 return VertAttrType::SINT_16_16_16_DEPRECATED;
126 return VertAttrType::SINT_16_16_16_16;
135 switch (fetch_mode) {
137 switch (component_len) {
139 return VertAttrType::UNORM_16_DEPRECATED;
141 return VertAttrType::UNORM_16_16;
143 return VertAttrType::UNORM_16_16_16_DEPRECATED;
145 return VertAttrType::UNORM_16_16_16_16;
149 switch (component_len) {
151 return VertAttrType::UINT_16_DEPRECATED;
153 return VertAttrType::UINT_16_16;
155 return VertAttrType::UINT_16_16_16_DEPRECATED;
157 return VertAttrType::UINT_16_16_16_16;
166 switch (fetch_mode) {
168 switch (component_len) {
170 return VertAttrType::SINT_32;
172 return VertAttrType::SINT_32_32;
174 return VertAttrType::SINT_32_32_32;
176 return VertAttrType::SINT_32_32_32_32;
185 switch (fetch_mode) {
187 switch (component_len) {
189 return VertAttrType::UINT_32;
191 return VertAttrType::UINT_32_32;
193 return VertAttrType::UINT_32_32_32;
195 return VertAttrType::UINT_32_32_32_32;
204 switch (fetch_mode) {
206 switch (component_len) {
208 return VertAttrType::SFLOAT_32;
210 return VertAttrType::SFLOAT_32_32;
212 return VertAttrType::SFLOAT_32_32_32;
214 return VertAttrType::SFLOAT_32_32_32_32;
223 switch (fetch_mode) {
225 return VertAttrType::SNORM_10_10_10_2;
241 case VertAttrType::SNORM_8_8_8_8:
242 case VertAttrType::SNORM_16_16:
243 case VertAttrType::SNORM_16_16_16_16:
244 case VertAttrType::UNORM_8_8_8_8:
245 case VertAttrType::UNORM_16_16:
246 case VertAttrType::UNORM_16_16_16_16:
247 case VertAttrType::SNORM_10_10_10_2:
248 case VertAttrType::UNORM_10_10_10_2:
258 case VertAttrType::SINT_TO_FLT_32:
259 case VertAttrType::SINT_TO_FLT_32_32:
260 case VertAttrType::SINT_TO_FLT_32_32_32:
261 case VertAttrType::SINT_TO_FLT_32_32_32_32:
271 case VertAttrType::SFLOAT_32:
272 case VertAttrType::SFLOAT_32_32:
273 case VertAttrType::SFLOAT_32_32_32:
274 case VertAttrType::SFLOAT_32_32_32_32:
296 format->deinterleaved =
false;
313 const uint sizes[] = {1, 1, 2, 2, 4, 4, 4};
338 return max_ii(minimum_stride, c);
344 return format->stride * vertex_len;
352 const int64_t chars_to_copy = std::min(name.
size(), available);
355 format->name_offset += chars_to_copy + 1;
370 BLI_assert((comp_len >= 1 && comp_len <= 4) || comp_len == 8 || comp_len == 12 ||
446 int attr_len =
format->attr_len;
447 for (
int i = 0;
i < attr_len;
i++, attr++) {
449 for (
int j = 1; j < load_count; j++) {
451 SNPRINTF(load_name,
"%s%d", attr_name, j);
464 for (
int i = 0;
i <
format->attr_len;
i++) {
466 for (
int j = 0; j < attr->
name_len; j++) {
468 if (name == attr_name) {
481 BLI_assert(strlen(attr_name) == strlen(new_name));
483 while (attr_name[
i] !=
'\0') {
484 attr_name[
i] = new_name[
i];
493 const char safe_chars[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
496 for (
int i = 0;
i < 11;
i++) {
497 out[
i] = safe_chars[
in % 62lu];
515 reinterpret_cast<const uchar *
>(to_hash.
data()), to_hash.
size(), 0);
520 memcpy(
data, attr_name.
data(), std::min<int>(8,
len));
525 r_safe_name[11] =
'\0';
540 format->deinterleaved =
true;
545 const uint mod = offset % alignment;
546 return (
mod == 0) ? 0 : (alignment -
mod);
552 const char c =
'A' + a_idx;
569 show_pack(0, a0->
size, 0);
572 for (
uint a_idx = 1; a_idx <
format->attr_len; a_idx++) {
575 offset += mid_padding;
580 show_pack(a_idx, a->
size, mid_padding);
587 show_pack(0, 0, end_padding);
590 format->stride = offset + end_padding;
610 for (
int i = 0;
i <
format->attr_len;
i++) {
614 "Texture buffer mode should only use a attributes with the same size.");
683 int location_test = 0, attrs_added = 0;
684 while (attrs_added < attr_len) {
#define BLI_assert_msg(a, msg)
uint32_t BLI_hash_mm2(const unsigned char *data, size_t len, uint32_t seed)
MINLINE int max_ii(int a, int b)
#define SNPRINTF(dst, format,...)
int GPU_minimum_per_vertex_stride()
bool GPU_shader_get_attribute_info(const GPUShader *shader, int attr_location, char r_name[256], int *r_type)
uint GPU_shader_get_attribute_len(const GPUShader *shader)
int pad[32 - sizeof(int)]
BMesh const char void * data
unsigned long long int uint64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void copy_unsafe(char *dst) const
constexpr StringRef substr(int64_t start, int64_t size) const
constexpr int64_t size() const
constexpr const char * data() const
constexpr StringRef drop_prefix(int64_t n) const
struct @064345207361167251075330302113175271221317160336::@201157344026354305110036153026103256267276205234 attr_id
VecBase< float, D > constexpr mod(VecOp< float, D >, VecOp< float, D >) RET
static VertAttrType vertex_format_combine(GPUVertCompType component_type, GPUVertFetchMode fetch_mode, uint32_t component_len)
bool is_fetch_int_to_float(VertAttrType attr_type)
bool is_fetch_normalized(VertAttrType attr_type)
bool is_fetch_float(VertAttrType attr_type)
uchar names[GPU_VERT_ATTR_MAX_NAMES]
blender::gpu::VertAttrType format