43 format->deinterleaved =
false;
46 format->attrs[i].name_len = 0;
62 const uint sizes[] = {1, 1, 2, 2, 4, 4, 4};
80 if (a->comp_len == 3 && c <= 2) {
87 return max_ii(minimum_stride, c);
95 return format->stride * vertex_len;
102 char *name_copy =
format->names + name_offset;
104 bool terminated =
false;
106 for (
uint i = 0; i < available; i++) {
107 const char c = name[i];
111 format->name_offset += (i + 1);
134 assert((comp_len >= 1 && comp_len <= 4) || comp_len == 8 || comp_len == 12 || comp_len == 16);
144 assert(
ELEM(comp_len, 3, 4));
154 assert(!
ELEM(comp_len, 8, 12, 16));
199 int attr_len =
format->attr_len;
200 for (
int i = 0; i < attr_len; i++, attr++) {
202 for (
int j = 1; j < load_count; j++) {
204 SNPRINTF(load_name,
"%s%d", attr_name, j);
217 for (
int i = 0; i <
format->attr_len; i++) {
219 for (
int j = 0; j < attr->
name_len; j++) {
221 if (
STREQ(name, attr_name)) {
234 BLI_assert(strlen(attr_name) == strlen(new_name));
236 while (attr_name[i] !=
'\0') {
237 attr_name[i] = new_name[i];
246 const char safe_chars[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
249 for (
int i = 0; i < 11; i++) {
250 out[i] = safe_chars[in % 62lu];
262 for (
int i = 0; i < 4; i++) {
263 data[i] = attr_name[i];
273 for (
int i = 0; i < 8 && attr_name[i] !=
'\0'; i++) {
274 data[i] = attr_name[i];
280 r_safe_name[11] =
'\0';
284 printf(
"%s > %lx > %s\n", attr_name, *(
uint64_t *)data, r_safe_name);
295 format->deinterleaved =
true;
300 const uint mod = offset % alignment;
301 return (
mod == 0) ? 0 : (alignment -
mod);
307 const char c =
'A' + a_idx;
308 for (
uint i = 0; i <
pad; i++) {
324 show_pack(0, a0->
size, 0);
327 for (
uint a_idx = 1; a_idx <
format->attr_len; a_idx++) {
330 offset += mid_padding;
335 show_pack(a_idx, a->size, mid_padding);
342 show_pack(0, 0, end_padding);
345 format->stride = offset + end_padding;
365 for (
int i = 0; i <
format->attr_len; i++) {
369 "Texture buffer mode should only use a attributes with the same size.");
438 int location_test = 0, attrs_added = 0;
439 while (attrs_added < attr_len) {
#define BLI_assert_msg(a, msg)
unsigned int BLI_ghashutil_strhash_p_murmur(const void *ptr)
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)
unsigned int GPU_shader_get_attribute_len(const GPUShader *shader)
int pad[32 - sizeof(int)]
struct GPUShader GPUShader
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
struct @620::@623 attr_id
unsigned __int64 uint64_t
uchar names[GPU_VERT_ATTR_MAX_NAMES]
ccl_device_inline int mod(int x, int m)